/// <summary> /// Create or updates a video resource. /// </summary> /// <remarks> /// Creates a new video resource or updates an existing one in an account. /// </remarks> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='resourceGroupName'> /// The name of the resource group. The name is case insensitive. /// </param> /// <param name='accountName'> /// The Azure Video Analyzer account name. /// </param> /// <param name='videoName'> /// The name of the video to create or update. /// </param> /// <param name='title'> /// Optional video title provided by the user. Value can be up to 256 /// characters long. /// </param> /// <param name='description'> /// Optional video description provided by the user. Value can be up to 2048 /// characters long. /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task <VideoEntity> CreateOrUpdateAsync(this IVideosOperations operations, string resourceGroupName, string accountName, string videoName, string title = default(string), string description = default(string), CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, accountName, videoName, title, description, null, cancellationToken).ConfigureAwait(false)) { return(_result.Body); } }
/// <summary> /// Retrieves all existing video resources. /// </summary> /// <remarks> /// Retrieves a list of video resources that have been created, along with /// their JSON representations. /// </remarks> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='resourceGroupName'> /// The name of the resource group. The name is case insensitive. /// </param> /// <param name='accountName'> /// The Azure Video Analyzer account name. /// </param> /// <param name='top'> /// Specifies a non-negative integer n that limits the number of items returned /// from a collection. The service returns the number of available items up to /// but not greater than the specified value n. /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task <IPage <VideoEntity> > ListAsync(this IVideosOperations operations, string resourceGroupName, string accountName, int?top = default(int?), CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, accountName, top, null, cancellationToken).ConfigureAwait(false)) { return(_result.Body); } }
/// <summary> /// Retrieves all existing video resources. /// </summary> /// <remarks> /// Retrieves a list of video resources that have been created, along with /// their JSON representations. /// </remarks> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='nextPageLink'> /// The NextLink from the previous successful call to List operation. /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task <IPage <VideoEntity> > ListNextAsync(this IVideosOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { return(_result.Body); } }
/// <summary> /// Generates a streaming token which can be used for accessing content from /// video content URLs. /// </summary> /// <remarks> /// Generates a streaming token which can be used for accessing content from /// video content URLs, for a video resource with the given name. /// </remarks> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='resourceGroupName'> /// The name of the resource group. The name is case insensitive. /// </param> /// <param name='accountName'> /// The Azure Video Analyzer account name. /// </param> /// <param name='videoName'> /// The Video name. /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task <VideoContentToken> ListContentTokenAsync(this IVideosOperations operations, string resourceGroupName, string accountName, string videoName, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.ListContentTokenWithHttpMessagesAsync(resourceGroupName, accountName, videoName, null, cancellationToken).ConfigureAwait(false)) { return(_result.Body); } }
/// <summary> /// Updates individual properties of an existing video resource. /// </summary> /// <remarks> /// Updates individual properties of an existing video resource with the given /// name. /// </remarks> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='resourceGroupName'> /// The name of the resource group. The name is case insensitive. /// </param> /// <param name='accountName'> /// The Azure Video Analyzer account name. /// </param> /// <param name='videoName'> /// The Video name. /// </param> /// <param name='parameters'> /// The request parameters /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task <VideoEntity> UpdateAsync(this IVideosOperations operations, string resourceGroupName, string accountName, string videoName, VideoEntity parameters, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.UpdateWithHttpMessagesAsync(resourceGroupName, accountName, videoName, parameters, null, cancellationToken).ConfigureAwait(false)) { return(_result.Body); } }
/// <summary> /// Initializes client properties. /// </summary> private void Initialize() { Videos = new VideosOperations(this); BaseUri = "{Endpoint}/bing/v7.0"; Endpoint = "https://api.cognitive.microsoft.com"; SerializationSettings = new JsonSerializerSettings { Formatting = Newtonsoft.Json.Formatting.Indented, DateFormatHandling = Newtonsoft.Json.DateFormatHandling.IsoDateFormat, DateTimeZoneHandling = Newtonsoft.Json.DateTimeZoneHandling.Utc, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore, ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Serialize, ContractResolver = new ReadOnlyJsonContractResolver(), Converters = new List <JsonConverter> { new Iso8601TimeSpanConverter() } }; DeserializationSettings = new JsonSerializerSettings { DateFormatHandling = Newtonsoft.Json.DateFormatHandling.IsoDateFormat, DateTimeZoneHandling = Newtonsoft.Json.DateTimeZoneHandling.Utc, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore, ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Serialize, ContractResolver = new ReadOnlyJsonContractResolver(), Converters = new List <JsonConverter> { new Iso8601TimeSpanConverter() } }; SerializationSettings.Converters.Add(new PolymorphicSerializeJsonConverter <ResponseBase>("_type")); DeserializationSettings.Converters.Add(new PolymorphicDeserializeJsonConverter <ResponseBase>("_type")); CustomInitialize(); }
/// <summary> /// Retrieves an existing video resource. /// </summary> /// <remarks> /// Retrieves an existing video resource with the given name. /// </remarks> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='resourceGroupName'> /// The name of the resource group. The name is case insensitive. /// </param> /// <param name='accountName'> /// The Azure Video Analyzer account name. /// </param> /// <param name='videoName'> /// The Video name. /// </param> public static VideoEntity Get(this IVideosOperations operations, string resourceGroupName, string accountName, string videoName) { return(operations.GetAsync(resourceGroupName, accountName, videoName).GetAwaiter().GetResult()); }
/// <summary> /// Retrieves all existing video resources. /// </summary> /// <remarks> /// Retrieves a list of video resources that have been created, along with /// their JSON representations. /// </remarks> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='resourceGroupName'> /// The name of the resource group. The name is case insensitive. /// </param> /// <param name='accountName'> /// The Azure Video Analyzer account name. /// </param> /// <param name='top'> /// Specifies a non-negative integer n that limits the number of items returned /// from a collection. The service returns the number of available items up to /// but not greater than the specified value n. /// </param> public static IPage <VideoEntity> List(this IVideosOperations operations, string resourceGroupName, string accountName, int?top = default(int?)) { return(operations.ListAsync(resourceGroupName, accountName, top).GetAwaiter().GetResult()); }
/// <summary> /// Retrieves all existing video resources. /// </summary> /// <remarks> /// Retrieves a list of video resources that have been created, along with /// their JSON representations. /// </remarks> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='nextPageLink'> /// The NextLink from the previous successful call to List operation. /// </param> public static IPage <VideoEntity> ListNext(this IVideosOperations operations, string nextPageLink) { return(operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult()); }
/// <summary> /// Generates a streaming token which can be used for accessing content from /// video content URLs. /// </summary> /// <remarks> /// Generates a streaming token which can be used for accessing content from /// video content URLs, for a video resource with the given name. /// </remarks> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='resourceGroupName'> /// The name of the resource group. The name is case insensitive. /// </param> /// <param name='accountName'> /// The Azure Video Analyzer account name. /// </param> /// <param name='videoName'> /// The Video name. /// </param> public static VideoContentToken ListContentToken(this IVideosOperations operations, string resourceGroupName, string accountName, string videoName) { return(operations.ListContentTokenAsync(resourceGroupName, accountName, videoName).GetAwaiter().GetResult()); }
/// <summary> /// Updates individual properties of an existing video resource. /// </summary> /// <remarks> /// Updates individual properties of an existing video resource with the given /// name. /// </remarks> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='resourceGroupName'> /// The name of the resource group. The name is case insensitive. /// </param> /// <param name='accountName'> /// The Azure Video Analyzer account name. /// </param> /// <param name='videoName'> /// The Video name. /// </param> /// <param name='parameters'> /// The request parameters /// </param> public static VideoEntity Update(this IVideosOperations operations, string resourceGroupName, string accountName, string videoName, VideoEntity parameters) { return(operations.UpdateAsync(resourceGroupName, accountName, videoName, parameters).GetAwaiter().GetResult()); }
/// <summary> /// Deletes an existing video resource and its underlying data. /// </summary> /// <remarks> /// Deletes an existing video resource and its underlying data. This operation /// is irreversible. /// </remarks> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='resourceGroupName'> /// The name of the resource group. The name is case insensitive. /// </param> /// <param name='accountName'> /// The Azure Video Analyzer account name. /// </param> /// <param name='videoName'> /// The Video name. /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task DeleteAsync(this IVideosOperations operations, string resourceGroupName, string accountName, string videoName, CancellationToken cancellationToken = default(CancellationToken)) { (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, accountName, videoName, null, cancellationToken).ConfigureAwait(false)).Dispose(); }
/// <summary> /// Deletes an existing video resource and its underlying data. /// </summary> /// <remarks> /// Deletes an existing video resource and its underlying data. This operation /// is irreversible. /// </remarks> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='resourceGroupName'> /// The name of the resource group. The name is case insensitive. /// </param> /// <param name='accountName'> /// The Azure Video Analyzer account name. /// </param> /// <param name='videoName'> /// The Video name. /// </param> public static void Delete(this IVideosOperations operations, string resourceGroupName, string accountName, string videoName) { operations.DeleteAsync(resourceGroupName, accountName, videoName).GetAwaiter().GetResult(); }
/// <summary> /// Updates the properties of a video resource. /// </summary> /// <remarks> /// Updates individual properties of an existing video resource. /// </remarks> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='resourceGroupName'> /// The name of the resource group. The name is case insensitive. /// </param> /// <param name='accountName'> /// The Azure Video Analyzer account name. /// </param> /// <param name='videoName'> /// The name of the video to update. /// </param> /// <param name='title'> /// Optional video title provided by the user. Value can be up to 256 /// characters long. /// </param> /// <param name='description'> /// Optional video description provided by the user. Value can be up to 2048 /// characters long. /// </param> public static VideoEntity Update(this IVideosOperations operations, string resourceGroupName, string accountName, string videoName, string title = default(string), string description = default(string)) { return(operations.UpdateAsync(resourceGroupName, accountName, videoName, title, description).GetAwaiter().GetResult()); }