Skip to content

Commit

Permalink
Merge pull request #391 from apivideo/feature/java_readme_android_per…
Browse files Browse the repository at this point in the history
…missions

docs(java): android: improve permission guide
  • Loading branch information
bot-api-video authored Sep 25, 2024
2 parents 84a46ba + f062b90 commit 5cba03b
Showing 1 changed file with 10 additions and 258 deletions.
268 changes: 10 additions & 258 deletions openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3699,99 +3699,7 @@ paths:
status: 429
security:
- apiKey: []
x-doctave:
code-samples:
- language: php
code: |
<?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#list

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


$client = new \ApiVideo\Client\Client(
'https://ws.api.video',
'YOUR_API_KEY',
new \Symfony\Component\HttpClient\Psr18Client()
);

// list all videos (all pages)
$allVideos = [];
do {
$currentPage = $client->videos()->list([]);
$allVideos = array_merge($allVideos, $currentPage->getData());
} while($currentPage->getPagination()->getCurrentPage() < $currentPage->getPagination()->getPagesTotal());

// list videos that have all the given tags (only first results page)
$videosWithTag = $client->videos()->list(['tags' => ['TAG2','TAG1']]);

// list videos that have all the given metadata values (only first results page)
$videosWithMetadata = $client->videos()->list(['metadata' => ['key1' => 'key1value1', 'key2' => 'key2value1']]);
- language: java
code: |-
// First add the "video.api:java-api-client" maven dependency to your project
// Documentation: https://github.com/apivideo/api.video-java-client/blob/main/docs/VideosApi.md#list

ApiVideoClient client = new ApiVideoClient("YOUR_API_KEY");
VideosApi videosApi = client.videos();

// list all videos (all pages)
Page<Video> videosPages = videosApi.list().execute();
videosPages.forEach(videosPage -> videosPage.getItems().forEach(video ->
System.out.println(video.getVideoId())
));

// list videos that have all the given tags (only first results page)
List<Video> videosWithTags = videosApi.list()
.tags(Arrays.asList("tag1", "tag2"))
.execute()
.getItems();

// list videos that have all the given metadata values (only first results page)
List<Video> videosWithMetadata = videosApi.list()
.metadata(Map.of("key1", "value1", "key2", "value2"))
.execute()
.getItems();
- language: node
code: |-
// First install the "@api.video/nodejs-client" npm package
// Documentation: https://github.com/apivideo/api.video-nodejs-client/blob/main/doc/api/VideosApi.md#list

const client = new ApiVideoClient({ apiKey: "YOUR_API_KEY" });

// list all videos (all pages)
let allVideos = [];
for(let currentPage=1 ; ; currentPage++) {
const res = await client.videos.list({ currentPage });
allVideos = [...allVideos, ...res.data];
if(currentPage >= res.pagination.pagesTotal) {
break;
}
}

// list videos that have all the given tags (only first results page)
const videosWithTags = await client.videos.list({ tags: ["tag1", "tag2"] });

// list videos that have all the given metadata values (only first results page)
const videosWithMetadata = await client.videos.list({ metadata: { "key1": "value1", "key2": "value2" } })
- language: csharp
code: |
// First add the "ApiVideo" NuGet package to your project
// Documentation: https://github.com/apivideo/api.video-csharp-client/blob/main/docs/VideosApi.md#list
- language: go
code: |
// 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#list
- language: python
code: |
# First install the api client with "pip install api.video"
# Documentation: https://github.com/apivideo/api.video-python-client/blob/main/docs/VideosApi.md#list
- language: swift
code: |
// First install the api client: https://github.com/apivideo/api.video-swift-client#getting-started
// Documentation: https://github.com/apivideo/api.video-swift-client/blob/main/docs/VideosAPI.md#list
x-client-action: list
x-client-action: listDiscarded
x-group-parameters: true
x-client-paginated: true
x-optional-object: true
Expand Down Expand Up @@ -3914,163 +3822,7 @@ paths:
status: 429
security:
- apiKey: []
x-client-action: get
x-doctave:
code-samples:
- language: go
code: |
// 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#get

package main

import (
"context"
"fmt"
"os"
apivideosdk "github.com/apivideo/api.video-go-client"
)

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 := "videoId_example" // string | The unique identifier for the video you want details about.


res, err := client.Videos.Get(videoId)

if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `Videos.Get``: %v\
", err)
}
// response from `Get`: Video
fmt.Fprintf(os.Stdout, "Response from `Videos.Get`: %v\
", res)
}
- language: node
code: |
// First install the "@api.video/nodejs-client" npm package
// Documentation: https://github.com/apivideo/api.video-nodejs-client/blob/main/doc/api/VideosApi.md#get

const client = new ApiVideoClient({ apiKey: "YOUR_API_KEY" });

const videoId = 'vi4k0jvEUuaTdRAEjQ4Jfrgz'; // The unique identifier for the video you want to retrieve.
const result = await client.videos.get(videoId);
- language: python
code: |
# First install the api client with "pip install api.video"
# Documentation: https://github.com/apivideo/api.video-python-client/blob/main/docs/VideosApi.md#get

import apivideo
from apivideo.api import videos_api
from apivideo.model.not_found import NotFound
from apivideo.model.video import Video
from pprint import pprint

# Enter a context with an instance of the API client
with apivideo.AuthenticatedApiClient(__API_KEY__) as api_client:
# Create an instance of the API class
api_instance = videos_api.VideosApi(api_client)
video_id = "videoId_example" # str | The unique identifier for the video you want details about.

# example passing only required values which don't have defaults set
try:
# Show a video
api_response = api_instance.get(video_id)
pprint(api_response)
except apivideo.ApiException as e:
print("Exception when calling VideosApi->get: %s\n" % e)
- language: java
code: |
// First add the "video.api:java-api-client" maven dependency to your project
// Documentation: https://github.com/apivideo/api.video-java-client/blob/main/docs/VideosApi.md#get

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);

VideosApi apiInstance = client.videos();

String videoId = "videoId_example"; // The unique identifier for the video you want details about.

try {
Video result = apiInstance.get(videoId);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling VideosApi#get");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getMessage());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
- language: csharp
code: |
// First add the "ApiVideo" NuGet package to your project
// Documentation: https://github.com/apivideo/api.video-csharp-client/blob/main/docs/VideosApi.md#get

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 videoId = videoId_example; // string | The unique identifier for the video you want details about.
var apiVideosInstance = apiInstance.Videos();
try
{
// Show a video
Video result = apiVideosInstance.get(videoId);
Debug.WriteLine(result);
}
catch (ApiException e)
{
Debug.Print("Exception when calling VideosApi.get: " + e.Message );
Debug.Print("Status Code: "+ e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
- language: php
code: |-
<?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#getStatus

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

$client = new \ApiVideo\Client\Client(
'https://ws.api.video',
'YOUR_API_KEY',
new \Symfony\Component\HttpClient\Psr18Client()
);

$videoId = 'vi4k0jvEUuaTdRAEjQ4Jfrgz'; // The unique identifier for the video you want the status for.
$videoStatus = $client->videos()->getStatus($videoId);
- language: swift
code: |
// First install the api client: https://github.com/apivideo/api.video-swift-client#getting-started
// Documentation: https://github.com/apivideo/api.video-swift-client/blob/main/docs/VideosAPI.md#get
x-client-action: getDiscarded
patch:
tags:
- Videos
Expand Down Expand Up @@ -4223,7 +3975,7 @@ paths:
status: 429
security:
- apiKey: []
x-client-action: update
x-client-action: updateDiscarded
x-doctave:
code-samples:
- language: go
Expand Down Expand Up @@ -12733,7 +12485,7 @@ paths:
Use this query parameter to define the starting date-time of the period you want analytics for.

- If you do not set a value for `from`, the default assigned value is 1 day ago, based on the `to` parameter.
- The maximum value is 30 days ago. You can extend data retention to 3 months or 12 months through the [Analytics page in the Dashboard](https://dashboard.api.video/analytics) - click on the `3M` or `12M` buttons to get started!
- The maximum value is 30 days ago.
- The value you provide should follow the ATOM date-time format: `2024-02-05T00:00:00+01:00`
- The API ignores this parameter when you call `/data/metrics/play/total`.
style: form
Expand Down Expand Up @@ -13006,7 +12758,7 @@ paths:
Use this query parameter to define the starting date-time of the period you want analytics for.

- If you do not set a value for `from`, the default assigned value is 1 day ago, based on the `to` parameter.
- The maximum value is 30 days ago. You can extend data retention to 3 months or 12 months through the [Analytics page in the Dashboard](https://dashboard.api.video/analytics) - click on the `3M` or `12M` buttons to get started!
- The maximum value is 30 days ago.
- The value you provide should follow the ATOM date-time format: `2024-02-05T00:00:00+01:00`
style: form
explode: false
Expand Down Expand Up @@ -13302,7 +13054,7 @@ paths:
Use this query parameter to define the starting date-time of the period you want analytics for.

- If you do not set a value for `from`, the default assigned value is 1 day ago, based on the `to` parameter.
- The maximum value is 30 days ago. You can extend data retention to 3 months or 12 months through the [Analytics page in the Dashboard](https://dashboard.api.video/analytics) - click on the `3M` or `12M` buttons to get started!
- The maximum value is 30 days ago.
- The value you provide should follow the ATOM date-time format: `2024-02-05T00:00:00+01:00`
style: form
explode: false
Expand Down Expand Up @@ -13405,11 +13157,11 @@ paths:
from: '2024-05-28T11:08:39+00:00'
to: '2024-05-29T11:08:39+00:00'
data:
- emittedAt: '2024-05-29T07:00:00+00:00'
- emittedAt: '2024-05-29T07+00:00:00:00'
metricValue: 2
- emittedAt: '2024-05-29T08:00:00+00:00'
- emittedAt: '2024-05-29T08+00:00:00:00'
metricValue: 1
- emittedAt: '2024-05-29T09:00:00+00:00'
- emittedAt: '2024-05-29T09+00:00:00:00'
metricValue: 1
pagination:
currentPage: 1
Expand Down Expand Up @@ -16040,7 +15792,7 @@ components:
data:
description: Returns an array of metrics and the timestamps .
type: array
items:
items:
type: object
properties:
emittedAt:
Expand Down

0 comments on commit 5cba03b

Please sign in to comment.