Skip to content

Commit

Permalink
Fix code sample fields to x-doctave
Browse files Browse the repository at this point in the history
  • Loading branch information
szekelyzol committed Sep 8, 2023
1 parent af2b6d9 commit 74eac37
Show file tree
Hide file tree
Showing 10 changed files with 142 additions and 115 deletions.
2 changes: 1 addition & 1 deletion .openapi-generator/oas_apivideo.yaml-defaut-cli.sha256
Original file line number Diff line number Diff line change
@@ -1 +1 @@
b63577184c322f946a8311a2331a6a6d437d96870e2945f77782ce899e2ebc32
1887f11face54a0a043265ab98f1d56e2ac08c39bef0c30dbaa6fc9dfdefb3db
17 changes: 9 additions & 8 deletions docs/CaptionsApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ namespace Example
var apiCaptionsInstance = apiInstance.Captions();
try
{
// Show a caption
// Retrieve a caption
Caption result = apiCaptionsInstance.get(videoId, language);
Debug.WriteLine(result);
}
Expand Down Expand Up @@ -184,7 +184,7 @@ namespace Example
var apiCaptionsInstance = apiInstance.Captions();
try
{
// Update caption
// Update a caption
Caption result = apiCaptionsInstance.update(videoId, language, captionsUpdatePayload);
Debug.WriteLine(result);
}
Expand Down Expand Up @@ -309,7 +309,7 @@ using ApiVideo.Client;

namespace Example
{
public class getExample
public class listExample
{
public static void Main()
{
Expand All @@ -318,18 +318,19 @@ namespace Example

var apiInstance = new ApiVideoClient(apiKey,basePath);

var videoId = vi4k0jvEUuaTdRAEjQ4Prklg; // string | The unique identifier for the video you want captions for.
var language = en; // string | A valid [BCP 47](https://github.com/libyal/libfwnt/wiki/Language-Code-identifiers) language representation
var videoId = vi4k0jvEUuaTdRAEjQ4Prklg; // string | The unique identifier for the video you want to retrieve a list of captions for.
var currentPage = 2; // int? | Choose the number of search results to return per page. Minimum value: 1 (optional) (default to 1)
var pageSize = 30; // int? | Results per page. Allowed values 1-100, default is 25. (optional) (default to 25)
var apiCaptionsInstance = apiInstance.Captions();
try
{
// Show a caption
Caption result = apiCaptionsInstance.get(videoId, language);
// List video captions
CaptionsListResponse result = apiCaptionsInstance.list(videoId, currentPage, pageSize);
Debug.WriteLine(result);
}
catch (ApiException e)
{
Debug.Print("Exception when calling CaptionsApi.get: " + e.Message );
Debug.Print("Exception when calling CaptionsApi.list: " + e.Message );
Debug.Print("Status Code: "+ e.ErrorCode);
Debug.Print(e.StackTrace);
}
Expand Down
15 changes: 8 additions & 7 deletions docs/ChaptersApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ namespace Example
var apiChaptersInstance = apiInstance.Chapters();
try
{
// Show a chapter
// Retrieve a chapter
Chapter result = apiChaptersInstance.get(videoId, language);
Debug.WriteLine(result);
}
Expand Down Expand Up @@ -234,7 +234,7 @@ using ApiVideo.Client;

namespace Example
{
public class getExample
public class listExample
{
public static void Main()
{
Expand All @@ -243,18 +243,19 @@ namespace Example

var apiInstance = new ApiVideoClient(apiKey,basePath);

var videoId = vi4k0jvEUuaTdRAEjQ4Jfrgz; // string | The unique identifier for the video you want to show a chapter for.
var language = en; // string | A valid [BCP 47](https://github.com/libyal/libfwnt/wiki/Language-Code-identifiers) language representation.
var videoId = vi4k0jvEUuaTdRAEjQ4Jfrgz; // string | The unique identifier for the video you want to retrieve a list of chapters for.
var currentPage = 2; // int? | Choose the number of search results to return per page. Minimum value: 1 (optional) (default to 1)
var pageSize = 30; // int? | Results per page. Allowed values 1-100, default is 25. (optional) (default to 25)
var apiChaptersInstance = apiInstance.Chapters();
try
{
// Show a chapter
Chapter result = apiChaptersInstance.get(videoId, language);
// List video chapters
ChaptersListResponse result = apiChaptersInstance.list(videoId, currentPage, pageSize);
Debug.WriteLine(result);
}
catch (ApiException e)
{
Debug.Print("Exception when calling ChaptersApi.get: " + e.Message );
Debug.Print("Exception when calling ChaptersApi.list: " + e.Message );
Debug.Print("Status Code: "+ e.ErrorCode);
Debug.Print(e.StackTrace);
}
Expand Down
118 changes: 68 additions & 50 deletions docs/LiveStreamsApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,26 +23,36 @@ Creates a livestream object.

### Example
```csharp
var apiVideoClient = new ApiVideoClient("YOUR_API_KEY");
using System.Diagnostics;
using ApiVideo.Client;

var liveStreamCreationPayload = new LiveStreamCreationPayload()
namespace Example
{
record = false,
name = "My Live Stream Video",
_public = true,
playerid = "pl4f4ferf5erfr5zed4fsdd",
restreams = new List<RestreamsRequestObject>(){
new RestreamsRequestObject(){name="My RTMP server", streamKey="dw-dew8-q6w9-k67w-1ws8", serverUrl="rtmp://my.broadcast.example.com/app" }
}
};
public class createExample
{
public static void Main()
{
var basePath = ApiVideoClient.Client.Environment.SANDBOX;
var apiKey = "YOUR_API_KEY";

try
{
var liveStream = apiVideoClient.LiveStreams().create(liveStreamCreationPayload);
}
catch (ApiException e)
{
// Manage create error here
var apiInstance = new ApiVideoClient(apiKey,basePath);

var liveStreamCreationPayload = new LiveStreamCreationPayload(); // LiveStreamCreationPayload |
var apiLiveStreamsInstance = apiInstance.LiveStreams();
try
{
// Create live stream
LiveStream result = apiLiveStreamsInstance.create(liveStreamCreationPayload);
Debug.WriteLine(result);
}
catch (ApiException e)
{
Debug.Print("Exception when calling LiveStreamsApi.create: " + e.Message );
Debug.Print("Status Code: "+ e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
```

Expand Down Expand Up @@ -80,33 +90,36 @@ Get a livestream by id.

### Example
```csharp
import video.api.client.ApiVideoClient;
import video.api.client.api.ApiException;
import video.api.client.api.models.*;
import video.api.client.api.clients.LiveStreamsApi;
import java.util.*;

public class Example {
public static void main(String[] args) {
ApiVideoClient client = new ApiVideoClient("YOUR_API_KEY");
// if you rather like to use the sandbox environment:
// ApiVideoClient client = new ApiVideoClient("YOUR_SANDBOX_API_KEY", ApiVideoClient.Environment.SANDBOX);
LiveStreamsApi apiInstance = client.liveStreams();

String liveStreamId = "li400mYKSgQ6xs7taUeSaEKr"; // The unique ID for the live stream you want to watch.
try {
LiveStream result = apiInstance.get(liveStreamId);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling LiveStreamsApi#get");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getMessage());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
using System.Diagnostics;
using ApiVideo.Client;

namespace Example
{
public class getExample
{
public static void Main()
{
var basePath = ApiVideoClient.Client.Environment.SANDBOX;
var apiKey = "YOUR_API_KEY";

var apiInstance = new ApiVideoClient(apiKey,basePath);

var liveStreamId = li400mYKSgQ6xs7taUeSaEKr; // string | The unique ID for the live stream you want to watch.
var apiLiveStreamsInstance = apiInstance.LiveStreams();
try
{
// Retrieve live stream
LiveStream result = apiLiveStreamsInstance.get(liveStreamId);
Debug.WriteLine(result);
}
catch (ApiException e)
{
Debug.Print("Exception when calling LiveStreamsApi.get: " + e.Message );
Debug.Print("Status Code: "+ e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
}
```

Expand Down Expand Up @@ -282,7 +295,7 @@ using ApiVideo.Client;

namespace Example
{
public class getExample
public class listExample
{
public static void Main()
{
Expand All @@ -291,17 +304,22 @@ namespace Example

var apiInstance = new ApiVideoClient(apiKey,basePath);

var liveStreamId = li400mYKSgQ6xs7taUeSaEKr; // string | The unique ID for the live stream you want to watch.
var streamKey = dw-dew8-q6w9-k67w-1ws8; // string | The unique stream key that allows you to stream videos. (optional)
var name = My Video; // string | You can filter live streams by their name or a part of their name. (optional)
var sortBy = createdAt; // string | Allowed: createdAt, publishedAt, name. createdAt - the time a livestream was created using the specified streamKey. publishedAt - the time a livestream was published using the specified streamKey. name - the name of the livestream. If you choose one of the time based options, the time is presented in ISO-8601 format. (optional)
var sortOrder = desc; // string | Allowed: asc, desc. Ascending for date and time means that earlier values precede later ones. Descending means that later values preced earlier ones. For title, it is 0-9 and A-Z ascending and Z-A, 9-0 descending. (optional)
var currentPage = 2; // int? | Choose the number of search results to return per page. Minimum value: 1 (optional) (default to 1)
var pageSize = 30; // int? | Results per page. Allowed values 1-100, default is 25. (optional) (default to 25)
var apiLiveStreamsInstance = apiInstance.LiveStreams();
try
{
// Show live stream
LiveStream result = apiLiveStreamsInstance.get(liveStreamId);
// List all live streams
LiveStreamListResponse result = apiLiveStreamsInstance.list(streamKey, name, sortBy, sortOrder, currentPage, pageSize);
Debug.WriteLine(result);
}
catch (ApiException e)
{
Debug.Print("Exception when calling LiveStreamsApi.get: " + e.Message );
Debug.Print("Exception when calling LiveStreamsApi.list: " + e.Message );
Debug.Print("Status Code: "+ e.ErrorCode);
Debug.Print(e.StackTrace);
}
Expand Down Expand Up @@ -363,7 +381,7 @@ namespace Example
var apiInstance = new ApiVideoClient(apiKey,basePath);

var liveStreamId = vi4k0jvEUuaTdRAEjQ4Jfrgz; // string | The unique ID for the live stream you want to upload.
var file = BINARY_DATA_HERE; // System.IO.Stream | The image to be added as a thumbnail.
var file = BINARY_DATA_HERE; // System.IO.Stream | The image to be added as a thumbnail. The mime type should be image/jpeg, image/png or image/webp. The max allowed size is 8 MiB.
var apiLiveStreamsInstance = apiInstance.LiveStreams();
try
{
Expand Down Expand Up @@ -432,7 +450,7 @@ namespace Example

var apiInstance = new ApiVideoClient(apiKey,basePath);

var liveStreamId = li400mYKSgQ6xs7taUeSaEKr; // string | The unique identifier for the live stream you want to delete.
var liveStreamId = li400mYKSgQ6xs7taUeSaEKr; // string | The unique identifier of the live stream whose thumbnail you want to delete.
var apiLiveStreamsInstance = apiInstance.LiveStreams();
try
{
Expand Down
4 changes: 2 additions & 2 deletions docs/PlayerThemesApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ namespace Example
var apiPlayerThemesInstance = apiInstance.PlayerThemes();
try
{
// Show a player
// Retrieve a player
PlayerTheme result = apiPlayerThemesInstance.get(playerId);
Debug.WriteLine(result);
}
Expand Down Expand Up @@ -312,7 +312,7 @@ namespace Example
var apiPlayerThemesInstance = apiInstance.PlayerThemes();
try
{
// List all players
// List all player themes
PlayerThemesListResponse result = apiPlayerThemesInstance.list(sortBy, sortOrder, currentPage, pageSize);
Debug.WriteLine(result);
}
Expand Down
6 changes: 3 additions & 3 deletions docs/RawStatisticsApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ namespace Example
var apiInstance = new ApiVideoClient(apiKey,basePath);

var liveStreamId = vi4k0jvEUuaTdRAEjQ4Jfrgz; // string | The unique identifier for the live stream you want to retrieve analytics for.
var period = 2019-01-01; // string | Period must have one of the following formats: - For a day : "2018-01-01", - For a week: "2018-W01", - For a month: "2018-01" - For a year: "2018" For a range period: - Date range: "2018-01-01/2018-01-15" (optional)
var period = 2019-01-01T00:00:00.000Z; // string | Period must have one of the following formats: - For a day : \"2018-01-01\", - For a week: \"2018-W01\", - For a month: \"2018-01\" - For a year: \"2018\" For a range period: - Date range: \"2018-01-01/2018-01-15\"
var currentPage = 2; // int? | Choose the number of search results to return per page. Minimum value: 1 (optional) (default to 1)
var pageSize = 30; // int? | Results per page. Allowed values 1-100, default is 25. (optional) (default to 25)
var apiRawStatisticsInstance = apiInstance.RawStatistics();
Expand Down Expand Up @@ -176,8 +176,8 @@ namespace Example
var apiInstance = new ApiVideoClient(apiKey,basePath);

var videoId = vi4k0jvEUuaTdRAEjQ4Prklg; // string | The unique identifier for the video you want to retrieve session information for.
var period = period_example; // string | Period must have one of the following formats: - For a day : 2018-01-01, - For a week: 2018-W01, - For a month: 2018-01 - For a year: 2018 For a range period: - Date range: 2018-01-01/2018-01-15 (optional)
var metadata = new Dictionary<string, string>(); // Dictionary<string, string> | Metadata and Dynamic Metadata filter. Send an array of key value pairs you want to filter sessios with. (optional)
var period = period_example; // string | Period must have one of the following formats: - For a day : 2018-01-01, - For a week: 2018-W01, - For a month: 2018-01 - For a year: 2018 For a range period: - Date range: 2018-01-01/2018-01-15
var metadata = new Dictionary<string, string>(); // Dictionary<string, string> | Metadata and [Dynamic Metadata](https://api.video/blog/endpoints/dynamic-metadata) filter. Send an array of key value pairs you want to filter sessios with. (optional)
var currentPage = 2; // int? | Choose the number of search results to return per page. Minimum value: 1 (optional) (default to 1)
var pageSize = 30; // int? | Results per page. Allowed values 1-100, default is 25. (optional) (default to 25)
var apiRawStatisticsInstance = apiInstance.RawStatistics();
Expand Down
60 changes: 33 additions & 27 deletions docs/UploadTokensApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ namespace Example
var apiUploadTokensInstance = apiInstance.UploadTokens();
try
{
// Show upload token
// Retrieve upload token
UploadToken result = apiUploadTokensInstance.getToken(uploadToken);
Debug.WriteLine(result);
}
Expand Down Expand Up @@ -220,33 +220,39 @@ Retrieve a list of all currently active delegated tokens.

### Example
```csharp
import video.api.client.ApiVideoClient;
import video.api.client.api.ApiException;
import video.api.client.api.models.*;
import video.api.client.api.clients.UploadTokensApi;
import java.util.*;

public class Example {
public static void main(String[] args) {
ApiVideoClient client = new ApiVideoClient("YOUR_API_KEY");
// if you rather like to use the sandbox environment:
// ApiVideoClient client = new ApiVideoClient("YOUR_SANDBOX_API_KEY", ApiVideoClient.Environment.SANDBOX);
UploadTokensApi apiInstance = client.uploadTokens();

String uploadToken = "to1tcmSFHeYY5KzyhOqVKMKb"; // The unique identifier for the token you want information about.
try {
UploadToken result = apiInstance.getToken(uploadToken);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling UploadTokensApi#getToken");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getMessage());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
using System.Diagnostics;
using ApiVideo.Client;

namespace Example
{
public class listExample
{
public static void Main()
{
var basePath = ApiVideoClient.Client.Environment.SANDBOX;
var apiKey = "YOUR_API_KEY";

var apiInstance = new ApiVideoClient(apiKey,basePath);

var sortBy = ttl; // string | Allowed: createdAt, ttl. You can use these to sort by when a token was created, or how much longer the token will be active (ttl - time to live). Date and time is presented in ISO-8601 format. (optional)
var sortOrder = asc; // string | Allowed: asc, desc. Ascending is 0-9 or A-Z. Descending is 9-0 or Z-A. (optional)
var currentPage = 2; // int? | Choose the number of search results to return per page. Minimum value: 1 (optional) (default to 1)
var pageSize = 30; // int? | Results per page. Allowed values 1-100, default is 25. (optional) (default to 25)
var apiUploadTokensInstance = apiInstance.UploadTokens();
try
{
// List all active upload tokens
TokenListResponse result = apiUploadTokensInstance.list(sortBy, sortOrder, currentPage, pageSize);
Debug.WriteLine(result);
}
catch (ApiException e)
{
Debug.Print("Exception when calling UploadTokensApi.list: " + e.Message );
Debug.Print("Status Code: "+ e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
}
```

Expand Down

0 comments on commit 74eac37

Please sign in to comment.