Skip to content
This repository was archived by the owner on Aug 26, 2021. It is now read-only.
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

@diegoot-dev

Description

@diegoot-dev

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions