From 2c4ce96760db0c0beb2b56e9599682b06071b5d9 Mon Sep 17 00:00:00 2001 From: szekelyzol Date: Fri, 8 Sep 2023 15:23:13 +0000 Subject: [PATCH] Fix code sample fields to x-doctave --- api/openapi.yaml | 104 +++++++++++------------ docs/AnalyticsApi.md | 4 +- docs/CaptionsApi.md | 36 +++++--- docs/ChaptersApi.md | 24 ++++-- docs/LiveStreamsApi.md | 134 +++++++++++++++++------------- docs/PlayerThemesApi.md | 27 ++++-- docs/RawStatisticsApi.md | 21 ++--- docs/UploadTokensApi.md | 28 +++++-- docs/VideosApi.md | 173 ++++++++++++++++++++++++--------------- docs/WatermarksApi.md | 41 +++++----- docs/WebhooksApi.md | 18 ++-- 11 files changed, 358 insertions(+), 252 deletions(-) diff --git a/api/openapi.yaml b/api/openapi.yaml index 57e3c35..78b96ff 100644 --- a/api/openapi.yaml +++ b/api/openapi.yaml @@ -56,7 +56,7 @@ paths: - Advanced authentication x-client-action: authenticate x-client-hidden: true - x-readme: + x-doctave: code-samples: - language: go code: | @@ -133,7 +133,7 @@ paths: - Advanced authentication x-client-action: refresh x-client-hidden: true - x-readme: + x-doctave: code-samples: - language: go code: | @@ -416,7 +416,7 @@ paths: default: This method returns a list of your videos (with all their details). With no parameters added, the API returns the first page of all videos. You can filter videos using the parameters described below. - x-readme: + x-doctave: code-samples: - language: php code: | @@ -599,7 +599,7 @@ paths: tags: - Videos x-client-action: create - x-readme: + x-doctave: code-samples: - language: go code: "// First install the go client with \"go get github.com/apivideo/api.video-go-client\"\ @@ -926,7 +926,7 @@ paths: \ the chunk that \"completes\" the upload).\n" x-client-action: upload x-client-chunk-upload: true - x-readme: + x-doctave: explorer-enabled: false code-samples: - language: go @@ -1195,7 +1195,7 @@ paths: x-client-action: list x-group-parameters: true x-client-paginated: true - x-readme: + x-doctave: code-samples: - language: node code: "// First install the \"@api.video/nodejs-client\" npm package\n//\ @@ -1276,7 +1276,7 @@ paths: tags: - Watermarks x-client-action: upload - x-readme: + x-doctave: code-samples: - language: go code: "// First install the go client with \"go get github.com/apivideo/api.video-go-client\"\ @@ -1464,7 +1464,7 @@ paths: tags: - Watermarks x-client-action: delete - x-readme: + x-doctave: code-samples: - language: node code: "// First install the \"@api.video/nodejs-client\" npm package\n//\ @@ -1582,7 +1582,7 @@ paths: \ upload an image for your thumbnail, use the dedicated [method](#uploadThumbnail).\ \ \n\nThere may be a short delay for the thumbnail to update.\n" x-client-action: pickThumbnail - x-readme: + x-doctave: code-samples: - language: go code: "// First install the go client with \"go get github.com/apivideo/api.video-go-client\"\ @@ -1791,7 +1791,7 @@ paths: Note: There may be a short delay before the new thumbnail is delivered to our CDN. x-client-action: uploadThumbnail - x-readme: + x-doctave: explorer-enabled: false code-samples: - language: go @@ -1928,7 +1928,7 @@ paths: default: If you do not need a video any longer, you can send a request to delete it. All you need is the videoId. x-client-action: delete - x-readme: + x-doctave: code-samples: - language: go code: "// First install the go client with \"go get github.com/apivideo/api.video-go-client\"\ @@ -2087,7 +2087,7 @@ paths: For private videos, it will generate a unique token url. Use this to retrieve any details you need about a video, or set up a private viewing URL. x-client-action: get - x-readme: + x-doctave: code-samples: - language: go code: "// First install the go client with \"go get github.com/apivideo/api.video-go-client\"\ @@ -2288,7 +2288,7 @@ paths: \ you provide here overwrites what is in the system rather than appending\ \ to it.\n" x-client-action: update - x-readme: + x-doctave: code-samples: - language: go code: "// First install the go client with \"go get github.com/apivideo/api.video-go-client\"\ @@ -2522,7 +2522,7 @@ paths: when the video is uploaded or ready to playback. Once encoding is completed, the response also lists the available stream qualities. x-client-action: getStatus - x-readme: + x-doctave: code-samples: - language: go code: "// First install the go client with \"go get github.com/apivideo/api.video-go-client\"\ @@ -2732,7 +2732,7 @@ paths: x-client-paginated: true x-optional-object: true x-client-action: list - x-readme: + x-doctave: code-samples: - language: go code: "// First install the go client with \"go get github.com/apivideo/api.video-go-client\"\ @@ -2900,7 +2900,7 @@ paths: tags: - Upload Tokens x-client-action: createToken - x-readme: + x-doctave: code-samples: - language: go code: "// First install the go client with \"go get github.com/apivideo/api.video-go-client\"\ @@ -3025,7 +3025,7 @@ paths: tags: - Upload Tokens x-client-action: deleteToken - x-readme: + x-doctave: code-samples: - language: go code: "// First install the go client with \"go get github.com/apivideo/api.video-go-client\"\ @@ -3176,7 +3176,7 @@ paths: tags: - Upload Tokens x-client-action: getToken - x-readme: + x-doctave: code-samples: - language: go code: "// First install the go client with \"go get github.com/apivideo/api.video-go-client\"\ @@ -3379,7 +3379,7 @@ paths: use the [standard upload method](#upload). x-client-action: uploadWithUploadToken x-client-chunk-upload: true - x-readme: + x-doctave: code-samples: - language: go code: | @@ -3575,7 +3575,7 @@ paths: x-group-parameters: true x-client-paginated: true x-optional-object: true - x-readme: + x-doctave: code-samples: - language: go code: "// First install the go client with \"go get github.com/apivideo/api.video-go-client\"\ @@ -3824,7 +3824,7 @@ paths: tags: - Live Streams x-client-action: create - x-readme: + x-doctave: code-samples: - language: go code: "// First install the go client with \"go get github.com/apivideo/api.video-go-client\"\ @@ -3976,7 +3976,7 @@ paths: tags: - Live Streams x-client-action: delete - x-readme: + x-doctave: code-samples: - language: go code: "// First install the go client with \"go get github.com/apivideo/api.video-go-client\"\ @@ -4115,7 +4115,7 @@ paths: tags: - Live Streams x-client-action: get - x-readme: + x-doctave: code-samples: - language: go code: "// First install the go client with \"go get github.com/apivideo/api.video-go-client\"\ @@ -4338,7 +4338,7 @@ paths: tags: - Live Streams x-client-action: update - x-readme: + x-doctave: code-samples: - language: go code: "// First install the go client with \"go get github.com/apivideo/api.video-go-client\"\ @@ -4563,7 +4563,7 @@ paths: tags: - Live Streams x-client-action: deleteThumbnail - x-readme: + x-doctave: code-samples: - language: go code: "// First install the go client with \"go get github.com/apivideo/api.video-go-client\"\ @@ -4710,7 +4710,7 @@ paths: tags: - Live Streams x-client-action: uploadThumbnail - x-readme: + x-doctave: code-samples: - language: go code: "// First install the go client with \"go get github.com/apivideo/api.video-go-client\"\ @@ -4880,7 +4880,7 @@ paths: tags: - Captions x-client-action: delete - x-readme: + x-doctave: code-samples: - language: go code: "// First install the go client with \"go get github.com/apivideo/api.video-go-client\"\ @@ -5049,7 +5049,7 @@ paths: Retrieve a caption for a video in a specific language. If the language is available, the caption is returned. Otherwise, you will get a error indicating the caption was not found. Tutorials that use the [captions endpoint](https://api.video/blog/endpoints/captions). x-client-action: get - x-readme: + x-doctave: code-samples: - language: go code: "// First install the go client with \"go get github.com/apivideo/api.video-go-client\"\ @@ -5253,7 +5253,7 @@ paths: default: 'To have the captions on automatically, use this method to set default: true.' x-client-action: update - x-readme: + x-doctave: code-samples: - language: go code: "// First install the go client with \"go get github.com/apivideo/api.video-go-client\"\ @@ -5421,7 +5421,7 @@ paths: tags: - Captions x-client-action: upload - x-readme: + x-doctave: code-samples: - language: go code: "// First install the go client with \"go get github.com/apivideo/api.video-go-client\"\ @@ -5633,7 +5633,7 @@ paths: x-client-action: list x-group-parameters: true x-client-paginated: true - x-readme: + x-doctave: code-samples: - language: go code: "// First install the go client with \"go get github.com/apivideo/api.video-go-client\"\ @@ -5798,7 +5798,7 @@ paths: tags: - Chapters x-client-action: delete - x-readme: + x-doctave: code-samples: - language: go code: "// First install the go client with \"go get github.com/apivideo/api.video-go-client\"\ @@ -5962,7 +5962,7 @@ paths: tags: - Chapters x-client-action: get - x-readme: + x-doctave: code-samples: - language: go code: "// First install the go client with \"go get github.com/apivideo/api.video-go-client\"\ @@ -6146,7 +6146,7 @@ paths: tags: - Chapters x-client-action: upload - x-readme: + x-doctave: code-samples: - language: go code: "// First install the go client with \"go get github.com/apivideo/api.video-go-client\"\ @@ -6360,7 +6360,7 @@ paths: x-client-action: list x-group-parameters: true x-client-paginated: true - x-readme: + x-doctave: code-samples: - language: go code: "// First install the go client with \"go get github.com/apivideo/api.video-go-client\"\ @@ -6631,7 +6631,7 @@ paths: x-group-parameters: true x-client-paginated: true x-optional-object: true - x-readme: + x-doctave: code-samples: - language: go code: "// First install the go client with \"go get github.com/apivideo/api.video-go-client\"\ @@ -6810,7 +6810,7 @@ paths: tags: - Player Themes x-client-action: create - x-readme: + x-doctave: code-samples: - language: go code: "// First install the go client with \"go get github.com/apivideo/api.video-go-client\"\ @@ -7022,7 +7022,7 @@ paths: tags: - Player Themes x-client-action: delete - x-readme: + x-doctave: code-samples: - language: go code: "// First install the go client with \"go get github.com/apivideo/api.video-go-client\"\ @@ -7189,7 +7189,7 @@ paths: tags: - Player Themes x-client-action: get - x-readme: + x-doctave: code-samples: - language: go code: "// First install the go client with \"go get github.com/apivideo/api.video-go-client\"\ @@ -7342,7 +7342,7 @@ paths: tags: - Player Themes x-client-action: update - x-readme: + x-doctave: code-samples: - language: go code: "// First install the go client with \"go get github.com/apivideo/api.video-go-client\"\ @@ -7542,7 +7542,7 @@ paths: tags: - Player Themes x-client-action: deleteLogo - x-readme: + x-doctave: code-samples: - language: go code: "// First install the go client with \"go get github.com/apivideo/api.video-go-client\"\ @@ -7707,7 +7707,7 @@ paths: tags: - Player Themes x-client-action: uploadLogo - x-readme: + x-doctave: code-samples: - language: go code: "// First install the go client with \"go get github.com/apivideo/api.video-go-client\"\ @@ -8105,7 +8105,7 @@ paths: x-client-action: getVideosPlays x-group-parameters: true x-client-paginated: true - x-readme: + x-doctave: code-samples: - language: go code: "package main\n\nimport (\n \"context\"\n \"fmt\"\n \"os\"\ @@ -8536,7 +8536,7 @@ paths: x-client-action: listVideoSessions x-group-parameters: true x-client-paginated: true - x-readme: + x-doctave: code-samples: - language: go code: "// First install the go client with \"go get github.com/apivideo/api.video-go-client\"\ @@ -8962,7 +8962,7 @@ paths: x-client-action: getLiveStreamsPlays x-group-parameters: true x-client-paginated: true - x-readme: + x-doctave: code-samples: - language: go code: "package main\n\nimport (\n \"context\"\n \"fmt\"\n \"os\"\ @@ -9382,7 +9382,7 @@ paths: x-client-action: listLiveStreamSessions x-group-parameters: true x-client-paginated: true - x-readme: + x-doctave: code-samples: - language: go code: "// First install the go client with \"go get github.com/apivideo/api.video-go-client\"\ @@ -9696,7 +9696,7 @@ paths: x-client-action: listSessionEvents x-group-parameters: true x-client-paginated: true - x-readme: + x-doctave: code-samples: - language: go code: "// First install the go client with \"go get github.com/apivideo/api.video-go-client\"\ @@ -9921,7 +9921,7 @@ paths: x-client-paginated: true x-optional-object: true x-client-action: list - x-readme: + x-doctave: code-samples: - language: go code: "// First install the go client with \"go get github.com/apivideo/api.video-go-client\"\ @@ -10099,7 +10099,7 @@ paths: tags: - Webhooks x-client-action: create - x-readme: + x-doctave: code-samples: - language: go code: "// First install the go client with \"go get github.com/apivideo/api.video-go-client\"\ @@ -10259,7 +10259,7 @@ paths: x-client-description: default: This method will delete the indicated webhook. x-client-action: delete - x-readme: + x-doctave: code-samples: - language: go code: "// First install the go client with \"go get github.com/apivideo/api.video-go-client\"\ @@ -10397,7 +10397,7 @@ paths: tags: - Webhooks x-client-action: get - x-readme: + x-doctave: code-samples: - language: go code: "// First install the go client with \"go get github.com/apivideo/api.video-go-client\"\ @@ -13155,7 +13155,7 @@ x-stoplight: x-client-base-paths: production: https://ws.api.video sandbox: https://sandbox.api.video -x-readme: +x-doctave: explorer-enabled: true proxy-enabled: true samples-enabled: true diff --git a/docs/AnalyticsApi.md b/docs/AnalyticsApi.md index eb07eb0..2ba90d0 100644 --- a/docs/AnalyticsApi.md +++ b/docs/AnalyticsApi.md @@ -32,7 +32,7 @@ public class Example { // ApiVideoClient client = new ApiVideoClient("YOUR_SANDBOX_API_KEY", Environment.SANDBOX); AnalyticsApi apiInstance = client.analytics(); - + LocalDate from = LocalDate.parse("2023-06-01"); // Use this query parameter to set the start date for the time period that you want analytics for. - The API returns analytics data including the day you set in `from`. - The date you set must be **within the last 30 days**. - The value you provide must follow the `YYYY-MM-DD` format. String dimension = "liveStreamId"; // Use this query parameter to define the dimension that you want analytics for. - `liveStreamId`: Returns analytics based on the public live stream identifiers. - `emittedAt`: Returns analytics based on the times of the play events. The API returns data in specific interval groups. When the date period you set in `from` and `to` is less than or equals to 2 days, the response for this dimension is grouped in hourly intervals. Otherwise, it is grouped in daily intervals. - `country`: Returns analytics based on the viewers' country. The list of supported country names are based on the [GeoNames public database](https://www.geonames.org/countries/). - `deviceType`: Returns analytics based on the type of device used by the viewers during the play event. - `operatingSystem`: Returns analytics based on the operating system used by the viewers during the play event. - `browser`: Returns analytics based on the browser used by the viewers during the play event. LocalDate to = LocalDate.parse("2023-06-10"); // Use this optional query parameter to set the end date for the time period that you want analytics for. - If you do not specify a `to` date, the API returns analytics data starting from the `from` date up until today, and excluding today. - The date you set must be **within the last 30 days**. - The value you provide must follow the `YYYY-MM-DD` format. @@ -116,7 +116,7 @@ public class Example { // ApiVideoClient client = new ApiVideoClient("YOUR_SANDBOX_API_KEY", Environment.SANDBOX); AnalyticsApi apiInstance = client.analytics(); - + LocalDate from = LocalDate.parse("2023-06-01"); // Use this query parameter to set the start date for the time period that you want analytics for. - The API returns analytics data including the day you set in `from`. - The date you set must be **within the last 30 days**. - The value you provide must follow the `YYYY-MM-DD` format. String dimension = "videoId"; // Use this query parameter to define the dimension that you want analytics for. - `videoId`: Returns analytics based on the public video identifiers. - `emittedAt`: Returns analytics based on the times of the play events. The API returns data in specific interval groups. When the date period you set in `from` and `to` is less than or equals to 2 days, the response for this dimension is grouped in hourly intervals. Otherwise, it is grouped in daily intervals. - `country`: Returns analytics based on the viewers' country. The list of supported country names are based on the [GeoNames public database](https://www.geonames.org/countries/). - `deviceType`: Returns analytics based on the type of device used by the viewers during the play event. - `operatingSystem`: Returns analytics based on the operating system used by the viewers during the play event. - `browser`: Returns analytics based on the browser used by the viewers during the play event. LocalDate to = LocalDate.parse("2023-06-10"); // Use this optional query parameter to set the end date for the time period that you want analytics for. - If you do not specify a `to` date, the API returns analytics data starting from the `from` date up until today, and excluding today. - The date you set must be **within the last 30 days**. - The value you provide must follow the `YYYY-MM-DD` format. diff --git a/docs/CaptionsApi.md b/docs/CaptionsApi.md index 6ceab5e..af66591 100644 --- a/docs/CaptionsApi.md +++ b/docs/CaptionsApi.md @@ -21,6 +21,7 @@ Upload a VTT file to add captions to your video. More information can be found [ ### Example ```java +// Import classes: import video.api.client.ApiVideoClient; import video.api.client.api.ApiException; import video.api.client.api.models.*; @@ -31,18 +32,19 @@ 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); + // ApiVideoClient client = new ApiVideoClient("YOUR_SANDBOX_API_KEY", Environment.SANDBOX); CaptionsApi apiInstance = client.captions(); - String videoId = "vi4k0jvEUuaTdRAEjQ4Prklg"; // The unique identifier for the video you want captions for. - String language = "en"; // A valid [BCP 47](https://github.com/libyal/libfwnt/wiki/Language-Code-identifiers) language representation + String videoId = "vi4k0jvEUuaTdRAEjQ4Prklg"; // The unique identifier for the video you want to add a caption to. + String language = "en"; // A valid BCP 47 language representation. + File file = new File("/path/to/file"); // The video text track (VTT) you want to upload. try { - Caption result = apiInstance.get(videoId, language); + Caption result = apiInstance.upload(videoId, language, file); System.out.println(result); } catch (ApiException e) { - System.err.println("Exception when calling CaptionsApi#get"); + System.err.println("Exception when calling CaptionsApi#upload"); System.err.println("Status code: " + e.getCode()); System.err.println("Reason: " + e.getMessage()); System.err.println("Response headers: " + e.getResponseHeaders()); @@ -93,6 +95,7 @@ Tutorials that use the [captions endpoint](https://api.video/blog/endpoints/capt ### Example ```java +// Import classes: import video.api.client.ApiVideoClient; import video.api.client.api.ApiException; import video.api.client.api.models.*; @@ -103,7 +106,7 @@ 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); + // ApiVideoClient client = new ApiVideoClient("YOUR_SANDBOX_API_KEY", Environment.SANDBOX); CaptionsApi apiInstance = client.captions(); @@ -161,6 +164,7 @@ To have the captions on automatically, use this method to set default: true. ### Example ```java +// Import classes: import video.api.client.ApiVideoClient; import video.api.client.api.ApiException; import video.api.client.api.models.*; @@ -171,7 +175,7 @@ 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); + // ApiVideoClient client = new ApiVideoClient("YOUR_SANDBOX_API_KEY", Environment.SANDBOX); CaptionsApi apiInstance = client.captions(); @@ -234,6 +238,7 @@ Delete a caption in a specific language by by video id. ### Example ```java +// Import classes: import video.api.client.ApiVideoClient; import video.api.client.api.ApiException; import video.api.client.api.models.*; @@ -244,7 +249,7 @@ 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); + // ApiVideoClient client = new ApiVideoClient("YOUR_SANDBOX_API_KEY", Environment.SANDBOX); CaptionsApi apiInstance = client.captions(); @@ -301,6 +306,7 @@ Retrieve a list of available captions by video id. ### Example ```java +// Import classes: import video.api.client.ApiVideoClient; import video.api.client.api.ApiException; import video.api.client.api.models.*; @@ -311,18 +317,22 @@ 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); + // ApiVideoClient client = new ApiVideoClient("YOUR_SANDBOX_API_KEY", Environment.SANDBOX); CaptionsApi apiInstance = client.captions(); - String videoId = "vi4k0jvEUuaTdRAEjQ4Prklg"; // The unique identifier for the video you want captions for. - String language = "en"; // A valid [BCP 47](https://github.com/libyal/libfwnt/wiki/Language-Code-identifiers) language representation + String videoId = "vi4k0jvEUuaTdRAEjQ4Prklg"; // The unique identifier for the video you want to retrieve a list of captions for. + Integer currentPage = 1; // Choose the number of search results to return per page. Minimum value: 1 + Integer pageSize = 25; // Results per page. Allowed values 1-100, default is 25. try { - Caption result = apiInstance.get(videoId, language); + Page result = apiInstance.list(videoId) + .currentPage(currentPage) + .pageSize(pageSize) + .execute(); System.out.println(result); } catch (ApiException e) { - System.err.println("Exception when calling CaptionsApi#get"); + System.err.println("Exception when calling CaptionsApi#list"); System.err.println("Status code: " + e.getCode()); System.err.println("Reason: " + e.getMessage()); System.err.println("Response headers: " + e.getResponseHeaders()); diff --git a/docs/ChaptersApi.md b/docs/ChaptersApi.md index 97ac99e..c5442ad 100644 --- a/docs/ChaptersApi.md +++ b/docs/ChaptersApi.md @@ -20,6 +20,7 @@ Upload a VTT file to add chapters to your video. Chapters help break the video i ### Example ```java +// Import classes: import video.api.client.ApiVideoClient; import video.api.client.api.ApiException; import video.api.client.api.models.*; @@ -30,7 +31,7 @@ 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); + // ApiVideoClient client = new ApiVideoClient("YOUR_SANDBOX_API_KEY", Environment.SANDBOX); ChaptersApi apiInstance = client.chapters(); @@ -91,6 +92,7 @@ Retrieve a chapter for by video id in a specific language. ### Example ```java +// Import classes: import video.api.client.ApiVideoClient; import video.api.client.api.ApiException; import video.api.client.api.models.*; @@ -101,7 +103,7 @@ 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); + // ApiVideoClient client = new ApiVideoClient("YOUR_SANDBOX_API_KEY", Environment.SANDBOX); ChaptersApi apiInstance = client.chapters(); @@ -159,6 +161,7 @@ Delete a chapter in a specific language by providing the video ID for the video ### Example ```java +// Import classes: import video.api.client.ApiVideoClient; import video.api.client.api.ApiException; import video.api.client.api.models.*; @@ -169,7 +172,7 @@ 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); + // ApiVideoClient client = new ApiVideoClient("YOUR_SANDBOX_API_KEY", Environment.SANDBOX); ChaptersApi apiInstance = client.chapters(); @@ -226,6 +229,7 @@ Retrieve a list of all chapters for by video id. ### Example ```java +// Import classes: import video.api.client.ApiVideoClient; import video.api.client.api.ApiException; import video.api.client.api.models.*; @@ -236,18 +240,22 @@ 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); + // ApiVideoClient client = new ApiVideoClient("YOUR_SANDBOX_API_KEY", Environment.SANDBOX); ChaptersApi apiInstance = client.chapters(); - String videoId = "vi4k0jvEUuaTdRAEjQ4Jfrgz"; // The unique identifier for the video you want to show a chapter for. - String language = "en"; // A valid [BCP 47](https://github.com/libyal/libfwnt/wiki/Language-Code-identifiers) language representation. + String videoId = "vi4k0jvEUuaTdRAEjQ4Jfrgz"; // The unique identifier for the video you want to retrieve a list of chapters for. + Integer currentPage = 1; // Choose the number of search results to return per page. Minimum value: 1 + Integer pageSize = 25; // Results per page. Allowed values 1-100, default is 25. try { - Chapter result = apiInstance.get(videoId, language); + Page result = apiInstance.list(videoId) + .currentPage(currentPage) + .pageSize(pageSize) + .execute(); System.out.println(result); } catch (ApiException e) { - System.err.println("Exception when calling ChaptersApi#get"); + System.err.println("Exception when calling ChaptersApi#list"); System.err.println("Status code: " + e.getCode()); System.err.println("Reason: " + e.getMessage()); System.err.println("Response headers: " + e.getResponseHeaders()); diff --git a/docs/LiveStreamsApi.md b/docs/LiveStreamsApi.md index ba49383..1ee5d62 100644 --- a/docs/LiveStreamsApi.md +++ b/docs/LiveStreamsApi.md @@ -23,25 +23,40 @@ Creates a livestream object. ### Example ```java -// instantiate the client -ApiVideoClient client = new ApiVideoClient("YOUR_API_KEY"); - -LiveStreamCreationPayload liveStreamCreationPayload = new LiveStreamCreationPayload(); -liveStreamCreationPayload.setRecord(true); // Whether you are recording or not. True for record, false for not record. -liveStreamCreationPayload.setName("My Live Stream Video"); // Add a name for your live stream here. -liveStreamCreationPayload.setPublic(); // Whether your video can be viewed by everyone, or requires authentication to see it. -liveStreamCreationPayload.setPlayerId("pl4f4ferf5erfr5zed4fsdd"); // The unique identifier for the player. -liveStreamCreationPayload.setRestreams(Collections.singletonList(new RestreamsRequestObject() // Use this parameter to add, edit, or remove RTMP services where you want to restream a live stream. The list can only contain up to 5 destinations. - .name("My RTMP server") - .serverUrl("rtmp://my.broadcast.example.com/app") - .streamKey("dw-dew8-q6w9-k67w-1ws8"))); - - -try { - LiveStream liveStream = client.liveStreams().create(liveStreamCreationPayload); - System.out.println(liveStream); -} catch (ApiException e) { - e.printStackTrace(); +// Import classes: +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", Environment.SANDBOX); + + LiveStreamsApi apiInstance = client.liveStreams(); + + LiveStreamCreationPayload liveStreamCreationPayload = new LiveStreamCreationPayload(); // + liveStreamCreationPayload.setName("My Live Stream Video"); // Add a name for your live stream here. + liveStreamCreationPayload.setRecord(true); // Whether you are recording or not. True for record, false for not record. + liveStreamCreationPayload.setPublic(); // Whether your video can be viewed by everyone, or requires authentication to see it. A setting of false will require a unique token for each view. Learn more about the Private Video feature [here](https://docs.api.video/docs/private-videos). + liveStreamCreationPayload.setPlayerId("pl4f4ferf5erfr5zed4fsdd"); // The unique identifier for the player. + liveStreamCreationPayload.setRestreams(Collections.emptyList()); // Use this parameter to add, edit, or remove RTMP services where you want to restream a live stream. The list can only contain up to 5 destinations. + + + try { + LiveStream result = apiInstance.create(liveStreamCreationPayload); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling LiveStreamsApi#create"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getMessage()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } } ``` @@ -81,6 +96,7 @@ Get a livestream by id. ### Example ```java +// Import classes: import video.api.client.ApiVideoClient; import video.api.client.api.ApiException; import video.api.client.api.models.*; @@ -91,7 +107,7 @@ 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); + // ApiVideoClient client = new ApiVideoClient("YOUR_SANDBOX_API_KEY", Environment.SANDBOX); LiveStreamsApi apiInstance = client.liveStreams(); @@ -146,6 +162,7 @@ Updates the livestream object. ### Example ```java +// Import classes: import video.api.client.ApiVideoClient; import video.api.client.api.ApiException; import video.api.client.api.models.*; @@ -156,20 +173,17 @@ 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); + // ApiVideoClient client = new ApiVideoClient("YOUR_SANDBOX_API_KEY", Environment.SANDBOX); LiveStreamsApi apiInstance = client.liveStreams(); String liveStreamId = "li400mYKSgQ6xs7taUeSaEKr"; // The unique ID for the live stream that you want to update information for such as player details, or whether you want the recording on or off. LiveStreamUpdatePayload liveStreamUpdatePayload = new LiveStreamUpdatePayload(); // liveStreamUpdatePayload.setName("My Live Stream Video"); // The name you want to use for your live stream. - liveStreamUpdatePayload.setPublic(); // Whether your video can be viewed by everyone, or requires authentication to see it. A setting of false will require a unique token for each view. + liveStreamUpdatePayload.setPublic(); // Whether your video can be viewed by everyone, or requires authentication to see it. A setting of false will require a unique token for each view. Learn more about the Private Video feature [here](https://docs.api.video/docs/private-videos). liveStreamUpdatePayload.setRecord(true); // Use this to indicate whether you want the recording on or off. On is true, off is false. liveStreamUpdatePayload.setPlayerId("pl45KFKdlddgk654dspkze"); // The unique ID for the player associated with a live stream that you want to update. - liveStreamUpdatePayload.setRestreams(Collections.singletonList(new RestreamsRequestObject() // Use this parameter to add, edit, or remove RTMP services where you want to restream a live stream. The list can only contain up to 5 destinations. This operation updates all restream destinations in the same request. If you do not want to modify an existing restream destination, you need to include it in your request, otherwise it is removed. - .name("My RTMP server") - .serverUrl("rtmp://my.broadcast.example.com/app") - .streamKey("dw-dew8-q6w9-k67w-1ws8"))); + liveStreamUpdatePayload.setRestreams(Collections.emptyList()); // Use this parameter to add, edit, or remove RTMP services where you want to restream a live stream. The list can only contain up to 5 destinations. This operation updates all restream destinations in the same request. If you do not want to modify an existing restream destination, you need to include it in your request, otherwise it is removed. try { @@ -223,33 +237,34 @@ If you do not need a live stream any longer, you can send a request to delete it ### Example ```java - 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 that you want to remove. - - try { - apiInstance.delete(liveStreamId); - } catch (ApiException e) { - System.err.println("Exception when calling LiveStreamsApi#delete"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getMessage()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } +// Import classes: +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", Environment.SANDBOX); + + LiveStreamsApi apiInstance = client.liveStreams(); + + String liveStreamId = "li400mYKSgQ6xs7taUeSaEKr"; // The unique ID for the live stream that you want to remove. + + try { + apiInstance.delete(liveStreamId); + } catch (ApiException e) { + System.err.println("Exception when calling LiveStreamsApi#delete"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getMessage()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); } } +} ``` ### Parameters @@ -287,6 +302,7 @@ Get the list of livestreams on the workspace. ### Example ```java +// Import classes: import video.api.client.ApiVideoClient; import video.api.client.api.ApiException; import video.api.client.api.models.*; @@ -297,14 +313,14 @@ 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); + // ApiVideoClient client = new ApiVideoClient("YOUR_SANDBOX_API_KEY", Environment.SANDBOX); LiveStreamsApi apiInstance = client.liveStreams(); - String streamKey = "30087931-229e-42cf-b5f9-e91bcc1f7332"; // The unique stream key that allows you to stream videos. + String streamKey = "dw-dew8-q6w9-k67w-1ws8"; // The unique stream key that allows you to stream videos. String name = "My Video"; // You can filter live streams by their name or a part of their name. String sortBy = "createdAt"; // 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. - String sortOrder = "desc"; // 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. + String sortOrder = "asc"; // 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. Integer currentPage = 1; // Choose the number of search results to return per page. Minimum value: 1 Integer pageSize = 25; // Results per page. Allowed values 1-100, default is 25. @@ -369,6 +385,7 @@ Upload the thumbnail for the livestream. ### Example ```java +// Import classes: import video.api.client.ApiVideoClient; import video.api.client.api.ApiException; import video.api.client.api.models.*; @@ -379,12 +396,12 @@ 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); + // ApiVideoClient client = new ApiVideoClient("YOUR_SANDBOX_API_KEY", Environment.SANDBOX); LiveStreamsApi apiInstance = client.liveStreams(); String liveStreamId = "vi4k0jvEUuaTdRAEjQ4Jfrgz"; // The unique ID for the live stream you want to upload. - File file = new File("/path/to/file"); // The image to be added as a thumbnail. + File file = new File("/path/to/file"); // 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. try { LiveStream result = apiInstance.uploadThumbnail(liveStreamId, file); @@ -438,6 +455,7 @@ Send the unique identifier for a live stream to delete its thumbnail. ### Example ```java +// Import classes: import video.api.client.ApiVideoClient; import video.api.client.api.ApiException; import video.api.client.api.models.*; @@ -448,11 +466,11 @@ 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); + // ApiVideoClient client = new ApiVideoClient("YOUR_SANDBOX_API_KEY", Environment.SANDBOX); LiveStreamsApi apiInstance = client.liveStreams(); - String liveStreamId = "li400mYKSgQ6xs7taUeSaEKr"; // The unique identifier for the live stream you want to delete. + String liveStreamId = "li400mYKSgQ6xs7taUeSaEKr"; // The unique identifier of the live stream whose thumbnail you want to delete. try { LiveStream result = apiInstance.deleteThumbnail(liveStreamId); diff --git a/docs/PlayerThemesApi.md b/docs/PlayerThemesApi.md index 73c7f5f..441833f 100644 --- a/docs/PlayerThemesApi.md +++ b/docs/PlayerThemesApi.md @@ -23,6 +23,7 @@ Create a player for your video, and customise it. ### Example ```java +// Import classes: import video.api.client.ApiVideoClient; import video.api.client.api.ApiException; import video.api.client.api.models.*; @@ -33,14 +34,16 @@ 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); + // ApiVideoClient client = new ApiVideoClient("YOUR_SANDBOX_API_KEY", Environment.SANDBOX); PlayerThemesApi apiInstance = client.playerThemes(); PlayerThemeCreationPayload playerThemeCreationPayload = new PlayerThemeCreationPayload(); // + playerThemeCreationPayload.setName(""null""); // Add a name for your player theme here. playerThemeCreationPayload.setText(""null""); // RGBA color for timer text. Default: rgba(255, 255, 255, 1) playerThemeCreationPayload.setLink(""null""); // RGBA color for all controls. Default: rgba(255, 255, 255, 1) playerThemeCreationPayload.setLinkHover(""null""); // RGBA color for all controls when hovered. Default: rgba(255, 255, 255, 1) + playerThemeCreationPayload.setLinkActive(""null""); // RGBA color for the play button when hovered. playerThemeCreationPayload.setTrackPlayed(""null""); // RGBA color playback bar: played content. Default: rgba(88, 131, 255, .95) playerThemeCreationPayload.setTrackUnplayed(""null""); // RGBA color playback bar: downloaded but unplayed (buffered) content. Default: rgba(255, 255, 255, .35) playerThemeCreationPayload.setTrackBackground(""null""); // RGBA color playback bar: background. Default: rgba(255, 255, 255, .2) @@ -103,6 +106,7 @@ Retreive a player theme by player id. ### Example ```java +// Import classes: import video.api.client.ApiVideoClient; import video.api.client.api.ApiException; import video.api.client.api.models.*; @@ -113,7 +117,7 @@ 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); + // ApiVideoClient client = new ApiVideoClient("YOUR_SANDBOX_API_KEY", Environment.SANDBOX); PlayerThemesApi apiInstance = client.playerThemes(); @@ -169,6 +173,7 @@ Use a player ID to update specific details for a player. NOTE: It may take up t ### Example ```java +// Import classes: import video.api.client.ApiVideoClient; import video.api.client.api.ApiException; import video.api.client.api.models.*; @@ -179,15 +184,17 @@ 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); + // ApiVideoClient client = new ApiVideoClient("YOUR_SANDBOX_API_KEY", Environment.SANDBOX); PlayerThemesApi apiInstance = client.playerThemes(); String playerId = "pl45d5vFFGrfdsdsd156dGhh"; // The unique identifier for the player. PlayerThemeUpdatePayload playerThemeUpdatePayload = new PlayerThemeUpdatePayload(); // + playerThemeUpdatePayload.setName(""null""); // Add a name for your player theme here. playerThemeUpdatePayload.setText(""null""); // RGBA color for timer text. Default: rgba(255, 255, 255, 1) playerThemeUpdatePayload.setLink(""null""); // RGBA color for all controls. Default: rgba(255, 255, 255, 1) playerThemeUpdatePayload.setLinkHover(""null""); // RGBA color for all controls when hovered. Default: rgba(255, 255, 255, 1) + playerThemeUpdatePayload.setLinkActive(""null""); // RGBA color for the play button when hovered. playerThemeUpdatePayload.setTrackPlayed(""null""); // RGBA color playback bar: played content. Default: rgba(88, 131, 255, .95) playerThemeUpdatePayload.setTrackUnplayed(""null""); // RGBA color playback bar: downloaded but unplayed (buffered) content. Default: rgba(255, 255, 255, .35) playerThemeUpdatePayload.setTrackBackground(""null""); // RGBA color playback bar: background. Default: rgba(255, 255, 255, .2) @@ -252,6 +259,7 @@ Delete a player if you no longer need it. You can delete any player that you hav ### Example ```java +// Import classes: import video.api.client.ApiVideoClient; import video.api.client.api.ApiException; import video.api.client.api.models.*; @@ -262,7 +270,7 @@ 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); + // ApiVideoClient client = new ApiVideoClient("YOUR_SANDBOX_API_KEY", Environment.SANDBOX); PlayerThemesApi apiInstance = client.playerThemes(); @@ -317,6 +325,7 @@ Retrieve a list of all the player themes you created, as well as details about e ### Example ```java +// Import classes: import video.api.client.ApiVideoClient; import video.api.client.api.ApiException; import video.api.client.api.models.*; @@ -327,11 +336,11 @@ 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); + // ApiVideoClient client = new ApiVideoClient("YOUR_SANDBOX_API_KEY", Environment.SANDBOX); PlayerThemesApi apiInstance = client.playerThemes(); - String sortBy = "createdAt"; // createdAt is the time the player was created. updatedAt is the time the player was last updated. The time is presented in ISO-8601 format. + String sortBy = "name"; // createdAt is the time the player was created. updatedAt is the time the player was last updated. The time is presented in ISO-8601 format. String sortOrder = "asc"; // Allowed: asc, desc. Ascending for date and time means that earlier values precede later ones. Descending means that later values preced earlier ones. Integer currentPage = 1; // Choose the number of search results to return per page. Minimum value: 1 Integer pageSize = 25; // Results per page. Allowed values 1-100, default is 25. @@ -394,6 +403,7 @@ Upload an image logo for a player. ### Example ```java +// Import classes: import video.api.client.ApiVideoClient; import video.api.client.api.ApiException; import video.api.client.api.models.*; @@ -404,7 +414,7 @@ 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); + // ApiVideoClient client = new ApiVideoClient("YOUR_SANDBOX_API_KEY", Environment.SANDBOX); PlayerThemesApi apiInstance = client.playerThemes(); @@ -465,6 +475,7 @@ Delete the logo associated to a player. ### Example ```java +// Import classes: import video.api.client.ApiVideoClient; import video.api.client.api.ApiException; import video.api.client.api.models.*; @@ -475,7 +486,7 @@ 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); + // ApiVideoClient client = new ApiVideoClient("YOUR_SANDBOX_API_KEY", Environment.SANDBOX); PlayerThemesApi apiInstance = client.playerThemes(); diff --git a/docs/RawStatisticsApi.md b/docs/RawStatisticsApi.md index 1ccf1d8..b3d4e40 100644 --- a/docs/RawStatisticsApi.md +++ b/docs/RawStatisticsApi.md @@ -17,6 +17,7 @@ List live stream player sessions ### Example ```java +// Import classes: import video.api.client.ApiVideoClient; import video.api.client.api.ApiException; import video.api.client.api.models.*; @@ -27,18 +28,17 @@ 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); + // ApiVideoClient client = new ApiVideoClient("YOUR_SANDBOX_API_KEY", Environment.SANDBOX); RawStatisticsApi apiInstance = client.rawStatistics(); String liveStreamId = "vi4k0jvEUuaTdRAEjQ4Jfrgz"; // The unique identifier for the live stream you want to retrieve analytics for. - String period = "2019-01-01"; // 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" + String period = "2019-01-01T00:00:00.000Z"; // 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\" Integer currentPage = 1; // Choose the number of search results to return per page. Minimum value: 1 Integer pageSize = 25; // Results per page. Allowed values 1-100, default is 25. try { - Page result = apiInstance.listLiveStreamSessions(liveStreamId) - .period(period) + Page result = apiInstance.listLiveStreamSessions(liveStreamId, period) .currentPage(currentPage) .pageSize(pageSize) .execute(); @@ -93,6 +93,7 @@ Useful to track and measure video's engagement. ### Example ```java +// Import classes: import video.api.client.ApiVideoClient; import video.api.client.api.ApiException; import video.api.client.api.models.*; @@ -103,7 +104,7 @@ 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); + // ApiVideoClient client = new ApiVideoClient("YOUR_SANDBOX_API_KEY", Environment.SANDBOX); RawStatisticsApi apiInstance = client.rawStatistics(); @@ -166,6 +167,7 @@ Retrieve all available user sessions for a specific video. Tutorials that use th ### Example ```java +// Import classes: import video.api.client.ApiVideoClient; import video.api.client.api.ApiException; import video.api.client.api.models.*; @@ -176,19 +178,18 @@ 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); + // ApiVideoClient client = new ApiVideoClient("YOUR_SANDBOX_API_KEY", Environment.SANDBOX); RawStatisticsApi apiInstance = client.rawStatistics(); String videoId = "vi4k0jvEUuaTdRAEjQ4Prklg"; // The unique identifier for the video you want to retrieve session information for. - String period = "period_example"; // 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 - Map metadata = new HashMap(); // Metadata and Dynamic Metadata filter. Send an array of key value pairs you want to filter sessios with. + String period = "period_example"; // 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 + Map metadata = new HashMap(); // 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. Integer currentPage = 1; // Choose the number of search results to return per page. Minimum value: 1 Integer pageSize = 25; // Results per page. Allowed values 1-100, default is 25. try { - Page result = apiInstance.listVideoSessions(videoId) - .period(period) + Page result = apiInstance.listVideoSessions(videoId, period) .metadata(metadata) .currentPage(currentPage) .pageSize(pageSize) diff --git a/docs/UploadTokensApi.md b/docs/UploadTokensApi.md index b046ea7..c138910 100644 --- a/docs/UploadTokensApi.md +++ b/docs/UploadTokensApi.md @@ -20,6 +20,7 @@ Generates an upload token that can be used to replace the API Key. More informat ### Example ```java +// Import classes: import video.api.client.ApiVideoClient; import video.api.client.api.ApiException; import video.api.client.api.models.*; @@ -30,12 +31,12 @@ 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); + // ApiVideoClient client = new ApiVideoClient("YOUR_SANDBOX_API_KEY", Environment.SANDBOX); UploadTokensApi apiInstance = client.uploadTokens(); TokenCreationPayload tokenCreationPayload = new TokenCreationPayload(); // - tokenCreationPayload.setTtl(); // Time in seconds that the token will be active. A value of 0 means that the token has no expiration date. The default is to have no expiration. + tokenCreationPayload.setTtl(); // Time in seconds that the token will be active. A value of 0 means that the token has no exipration date. The default is to have no expiration. try { @@ -88,6 +89,7 @@ Retrieve details about a specific upload token by id. ### Example ```java +// Import classes: import video.api.client.ApiVideoClient; import video.api.client.api.ApiException; import video.api.client.api.models.*; @@ -98,7 +100,7 @@ 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); + // ApiVideoClient client = new ApiVideoClient("YOUR_SANDBOX_API_KEY", Environment.SANDBOX); UploadTokensApi apiInstance = client.uploadTokens(); @@ -154,6 +156,7 @@ Delete an existing upload token. This is especially useful for tokens you may ha ### Example ```java +// Import classes: import video.api.client.ApiVideoClient; import video.api.client.api.ApiException; import video.api.client.api.models.*; @@ -164,7 +167,7 @@ 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); + // ApiVideoClient client = new ApiVideoClient("YOUR_SANDBOX_API_KEY", Environment.SANDBOX); UploadTokensApi apiInstance = client.uploadTokens(); @@ -219,6 +222,7 @@ Retrieve a list of all currently active delegated tokens. ### Example ```java +// Import classes: import video.api.client.ApiVideoClient; import video.api.client.api.ApiException; import video.api.client.api.models.*; @@ -229,17 +233,25 @@ 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); + // ApiVideoClient client = new ApiVideoClient("YOUR_SANDBOX_API_KEY", Environment.SANDBOX); UploadTokensApi apiInstance = client.uploadTokens(); - String uploadToken = "to1tcmSFHeYY5KzyhOqVKMKb"; // The unique identifier for the token you want information about. + String sortBy = "createdAt"; // 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. + String sortOrder = "asc"; // Allowed: asc, desc. Ascending is 0-9 or A-Z. Descending is 9-0 or Z-A. + Integer currentPage = 1; // Choose the number of search results to return per page. Minimum value: 1 + Integer pageSize = 25; // Results per page. Allowed values 1-100, default is 25. try { - UploadToken result = apiInstance.getToken(uploadToken); + Page result = apiInstance.list() + .sortBy(sortBy) + .sortOrder(sortOrder) + .currentPage(currentPage) + .pageSize(pageSize) + .execute(); System.out.println(result); } catch (ApiException e) { - System.err.println("Exception when calling UploadTokensApi#getToken"); + System.err.println("Exception when calling UploadTokensApi#list"); System.err.println("Status code: " + e.getCode()); System.err.println("Reason: " + e.getMessage()); System.err.println("Response headers: " + e.getResponseHeaders()); diff --git a/docs/VideosApi.md b/docs/VideosApi.md index b95eb95..83772c4 100644 --- a/docs/VideosApi.md +++ b/docs/VideosApi.md @@ -26,6 +26,7 @@ Creates a video object. More information on video objects can be found [here](ht ### Example ```java +// Import classes: import video.api.client.ApiVideoClient; import video.api.client.api.ApiException; import video.api.client.api.models.*; @@ -36,20 +37,22 @@ 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); + // ApiVideoClient client = new ApiVideoClient("YOUR_SANDBOX_API_KEY", Environment.SANDBOX); VideosApi apiInstance = client.videos(); VideoCreationPayload videoCreationPayload = new VideoCreationPayload(); // video to create videoCreationPayload.setTitle("Maths video"); // The title of your new video. videoCreationPayload.setDescription("A video about string theory."); // A brief description of your video. - videoCreationPayload.setSource("https://www.myvideo.url.com/video.mp4"); // If you add a video already on the web, this is where you enter the url for the video. - videoCreationPayload.setPublic(true); // Whether your video can be viewed by everyone, or requires authentication to see it. A setting of false will require a unique token for each view. + videoCreationPayload.setSource("https://www.myvideo.url.com/video.mp4 OR vi4k0jvEUuaTdRAEjQ4JfOyl"); // You can either add a video already on the web, by entering the URL of the video, or you can also enter the `videoId` of one of the videos you already have on your api.video acccount, and this will generate a copy of your video. Creating a copy of a video can be especially useful if you want to keep your original video and trim or apply a watermark onto the copy you would create. + videoCreationPayload.setPublic(true); // Default: True. If set to `false` the video will become private. More information on private videos can be found [here](https://docs.api.video/docs/private-videos) videoCreationPayload.setPanoramic(false); // Indicates if your video is a 360/immersive video. videoCreationPayload.setMp4Support(true); // Enables mp4 version in addition to streamed version. videoCreationPayload.setPlayerId("pl45KFKdlddgk654dspkze"); // The unique identification number for your video player. videoCreationPayload.setTags(Arrays.asList("maths", "string theory", "video")); // A list of tags you want to use to describe your video. - videoCreationPayload.setMetadata(Collections.emptyList()); // A list of key value pairs that you use to provide metadata for your video. These pairs can be made dynamic, allowing you to segment your audience. You can also just use the pairs as another way to tag and categorize your videos. + videoCreationPayload.setMetadata(Collections.emptyList()); // A list of key value pairs that you use to provide metadata for your video. These pairs can be made dynamic, allowing you to segment your audience. Read more on [dynamic metadata](https://api.video/blog/endpoints/dynamic-metadata). + videoCreationPayload.setClip(); // + videoCreationPayload.setWatermark(); // try { @@ -121,6 +124,7 @@ The latter allows you to split a video source into X chunks and send those chunk ### Example ```java +// Import classes: import video.api.client.ApiVideoClient; import video.api.client.api.ApiException; import video.api.client.api.models.*; @@ -131,12 +135,12 @@ 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); + // ApiVideoClient client = new ApiVideoClient("YOUR_SANDBOX_API_KEY", Environment.SANDBOX); VideosApi apiInstance = client.videos(); - + String videoId = "vi4k0jvEUuaTdRAEjQ4Jfrgz"; // Enter the videoId you want to use to upload your video. - File file = new File("/path/to/file"); // The path to the video you would like to upload. The path must be local. If you want to use a video from an online source, you must use the "/videos" endpoint and add the "source" parameter when you create a new video. + File file = new File("/path/to/file"); // The path to the video you would like to upload. The path must be local. If you want to use a video from an online source, you must use the \\\"/videos\\\" endpoint and add the \\\"source\\\" parameter when you create a new video. try { Video result = apiInstance.upload(videoId, file); @@ -313,6 +317,7 @@ This call provides the same information provided on video creation. For private ### Example ```java +// Import classes: import video.api.client.ApiVideoClient; import video.api.client.api.ApiException; import video.api.client.api.models.*; @@ -323,7 +328,7 @@ 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); + // ApiVideoClient client = new ApiVideoClient("YOUR_SANDBOX_API_KEY", Environment.SANDBOX); VideosApi apiInstance = client.videos(); @@ -340,7 +345,7 @@ public class Example { e.printStackTrace(); } } -} +} ``` ### Parameters @@ -385,6 +390,7 @@ NOTE: If you are updating an array, you must provide the entire array as what yo ### Example ```java +// Import classes: import video.api.client.ApiVideoClient; import video.api.client.api.ApiException; import video.api.client.api.models.*; @@ -395,20 +401,20 @@ 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); + // ApiVideoClient client = new ApiVideoClient("YOUR_SANDBOX_API_KEY", Environment.SANDBOX); VideosApi apiInstance = client.videos(); - String videoId = "vi4k0jvEUuaTdRAEjQ4Jfrgz"; // The video ID for the video you want to delete. + String videoId = "vi4k0jvEUuaTdRAEjQ4Jfrgz"; // The video ID for the video you want to update. VideoUpdatePayload videoUpdatePayload = new VideoUpdatePayload(); // videoUpdatePayload.setPlayerId("pl4k0jvEUuaTdRAEjQ4Jfrgz"); // The unique ID for the player you want to associate with your video. videoUpdatePayload.setTitle("null"); // The title you want to use for your video. videoUpdatePayload.setDescription("A film about good books."); // A brief description of the video. - videoUpdatePayload.setPublic(true); // Whether the video is publicly available or not. False means it is set to private. + videoUpdatePayload.setPublic(true); // Whether the video is publicly available or not. False means it is set to private. Default is true. Tutorials on [private videos](https://api.video/blog/endpoints/private-videos). videoUpdatePayload.setPanoramic(false); // Whether the video is a 360 degree or immersive video. videoUpdatePayload.setMp4Support(true); // Whether the player supports the mp4 format. videoUpdatePayload.setTags(Arrays.asList("maths", "string theory", "video")); // A list of terms or words you want to tag the video with. Make sure the list includes all the tags you want as whatever you send in this list will overwrite the existing list for the video. - videoUpdatePayload.setMetadata(Collections.emptyList()); // A list (array) of dictionaries where each dictionary contains a key value pair that describes the video. As with tags, you must send the complete list of metadata you want as whatever you send here will overwrite the existing metadata for the video. + videoUpdatePayload.setMetadata(Collections.emptyList()); // A list (array) of dictionaries where each dictionary contains a key value pair that describes the video. As with tags, you must send the complete list of metadata you want as whatever you send here will overwrite the existing metadata for the video. [Dynamic Metadata](https://api.video/blog/endpoints/dynamic-metadata) allows you to define a key that allows any value pair. try { @@ -463,22 +469,23 @@ If you do not need a video any longer, you can send a request to delete it. All ### Example ```java +// Import classes: import video.api.client.ApiVideoClient; import video.api.client.api.ApiException; import video.api.client.api.models.*; import video.api.client.api.clients.VideosApi; 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); - + // ApiVideoClient client = new ApiVideoClient("YOUR_SANDBOX_API_KEY", Environment.SANDBOX); + VideosApi apiInstance = client.videos(); String videoId = "vi4k0jvEUuaTdRAEjQ4Jfrgz"; // The video ID for the video you want to delete. - + try { apiInstance.delete(videoId); } catch (ApiException e) { @@ -528,26 +535,53 @@ This method returns a list of your videos (with all their details). With no para ### Example ```java -ApiVideoClient client = new ApiVideoClient("YOUR_API_KEY"); -VideosApi videosApi = client.videos(); - -// list all videos (all pages) -Page