This repository was archived by the owner on Aug 26, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 51
This repository was archived by the owner on Aug 26, 2021. It is now read-only.
How can I edit the title and description of a video? #427
Copy link
Copy link
Open
Description
I try various ways and I have the following error:
Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'Invalid type in JSON write (VIMVideo)'
I have the following code:
`authenticationController.clientCredentialsGrant { result in
switch result {
case .success(let account):
print("Successfully authenticated with account: \(account)")
let videoRequest = Request<VIMVideo>(path: "/videos/"+self.videoId!)
vimeoClient.request(videoRequest) { result in
switch result {
case .success(let response):
let video: VIMVideo = response.model
print("retrieved video: \(video)")
video.name = "new title"
video.videoDescription = "new description"
let videoRequest1 = Request<VIMVideo>(method: HTTPMethod.patch, path: "/videos/"+self.videoId!, parameters: [video], modelKeyPath: nil, useCache: false, cacheResponse: false, retryPolicy: nil)
vimeoClient.request(videoRequest1){result in
switch result {
case .success(let response):
let video: VIMVideo = response.model
print("retrieved video: \(video)")
case .failure(let error):
print("error updating video: \(error)")
}
}
case .failure(let error ):
print("error retrieving video: \(error)")
}
}
case .failure(let error):
print("error authenticating: \(error)")
}
}`
Thanks for your support
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels