Skip to content

Commit

Permalink
Fix code snippets
Browse files Browse the repository at this point in the history
  • Loading branch information
szekelyzol committed Nov 9, 2023
1 parent c870ef9 commit 629f134
Showing 1 changed file with 41 additions and 42 deletions.
83 changes: 41 additions & 42 deletions templates/documentation/vod/video-download.md
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ It’s also possible to disable the download ability for the users, after the vi

{% capture samples %}
```javascript
/ First install the "@api.video/nodejs-client" npm package
// First install the "@api.video/nodejs-client" npm package
// Documentation: https://github.com/apivideo/api.video-nodejs-client/blob/main/doc/api/VideosApi.md#update

const client = new ApiVideoClient({ apiKey: "YOUR_API_KEY" });
Expand All @@ -229,39 +229,22 @@ const videoUpdatePayload = {
};
const updatedVideo = await client.videos.update(videoId, videoUpdatePayload);
```
```php
<?php
// First install the api client: "composer require api-video/php-api-client"
// Documentation: https://github.com/apivideo/api.video-php-client/blob/main/docs/Api/VideosApi.md#update

```go
// First install the go client with "go get github.com/apivideo/api.video-go-client"
// Documentation: https://github.com/apivideo/api.video-go-client/blob/main/docs/VideosApi.md#update
package main
require __DIR__ . '/vendor/autoload.php';

import (
"context"
"fmt"
"os"
apivideosdk "github.com/apivideo/api.video-go-client"
)
$client = new \ApiVideo\Client\Client(
'https://ws.api.video',
'YOUR_API_KEY',
new \Symfony\Component\HttpClient\Psr18Client()
);

func main() {
client := apivideosdk.ClientBuilder("YOUR_API_KEY").Build()
// if you rather like to use the sandbox environment:
// client := apivideosdk.SandboxClientBuilder("YOUR_SANDBOX_API_KEY").Build()
videoId := "vi4k0jvEUuaTdRAEjQ4Jfrgz" // string | The video ID for the video you want to delete.
videoUpdatePayload := *apivideosdk.VideoUpdatePayload{} // VideoUpdatePayload |
videoUpdatePayload.SetMp4Support(false)
res, err := client.Videos.Update(videoId, videoUpdatePayload)
$videoId = 'vi4k0jvEUuaTdRAEjQ4Jfrgz'; // The video ID for the video you want to update.

if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `Videos.Update``: %v\
", err)
}
// response from `Update`: Video
fmt.Fprintf(os.Stdout, "Response from `Videos.Update`: %v\
", res)
}
$client->videos()->update($videoId, (new \ApiVideo\Client\Model\VideoUpdatePayload())->setMp4Support(false) // Whether the player supports the mp4 format.
```
```python
# First install the api client with "pip install api.video"
Expand Down Expand Up @@ -328,22 +311,38 @@ public class Example {
}
}
```
```php
<?php
// First install the api client: "composer require api-video/php-api-client"
// Documentation: https://github.com/apivideo/api.video-php-client/blob/main/docs/Api/VideosApi.md#update
```go
// First install the go client with "go get github.com/apivideo/api.video-go-client"
// Documentation: https://github.com/apivideo/api.video-go-client/blob/main/docs/VideosApi.md#update

require __DIR__ . '/vendor/autoload.php';
package main

$client = new \ApiVideo\Client\Client(
'https://ws.api.video',
'YOUR_API_KEY',
new \Symfony\Component\HttpClient\Psr18Client()
);
import (
"context"
"fmt"
"os"
apivideosdk "github.com/apivideo/api.video-go-client"
)

$videoId = 'vi4k0jvEUuaTdRAEjQ4Jfrgz'; // The video ID for the video you want to update.
func main() {
client := apivideosdk.ClientBuilder("YOUR_API_KEY").Build()
// if you rather like to use the sandbox environment:
// client := apivideosdk.SandboxClientBuilder("YOUR_SANDBOX_API_KEY").Build()

videoId := "vi4k0jvEUuaTdRAEjQ4Jfrgz" // string | The video ID for the video you want to delete.
videoUpdatePayload := *apivideosdk.VideoUpdatePayload{} // VideoUpdatePayload |
videoUpdatePayload.SetMp4Support(false)

res, err := client.Videos.Update(videoId, videoUpdatePayload)

$client->videos()->update($videoId, (new \ApiVideo\Client\Model\VideoUpdatePayload())->setMp4Support(false) // Whether the player supports the mp4 format.
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `Videos.Update``: %v\
", err)
}
// response from `Update`: Video
fmt.Fprintf(os.Stdout, "Response from `Videos.Update`: %v\
", res)
}
```
{% endcapture %}
{% include "_partials/code-tabs.md" samples: samples %}
Expand Down

0 comments on commit 629f134

Please sign in to comment.