Esempio n. 1
0
 /// <summary>
 /// Synchronize the keys for a storage account to the Media Service.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='resourceGroupName'>
 /// Name of the resource group within the Azure subscription.
 /// </param>
 /// <param name='mediaServiceName'>
 /// Name of the Media Service.
 /// </param>
 /// <param name='syncStorageKeysInput'>
 /// Properties needed to sycnronize the keys for a storage account to the
 /// Media Service.
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <MediaService> SyncStorageKeysAsync(this IMediaServiceOperations operations, string resourceGroupName, string mediaServiceName, SyncStorageKeysInput syncStorageKeysInput, CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.SyncStorageKeysWithHttpMessagesAsync(resourceGroupName, mediaServiceName, syncStorageKeysInput, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
Esempio n. 2
0
 /// <summary>
 /// Regenerate the key for a Media Service.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='resourceGroupName'>
 /// Name of the resource group within the Azure subscription.
 /// </param>
 /// <param name='mediaServiceName'>
 /// Name of the Media Service.
 /// </param>
 /// <param name='regenerateKeyInput'>
 /// Properties needed to regenerate the Media Service key.
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <RegenerateKeyOutput> RegenerateKeyAsync(this IMediaServiceOperations operations, string resourceGroupName, string mediaServiceName, RegenerateKeyInput regenerateKeyInput, CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.RegenerateKeyWithHttpMessagesAsync(resourceGroupName, mediaServiceName, regenerateKeyInput, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
Esempio n. 3
0
 /// <summary>
 /// Initializes client properties.
 /// </summary>
 private void Initialize()
 {
     this.MediaService   = new MediaServiceOperations(this);
     this.BaseUri        = new Uri("https://management.azure.com");
     this.ApiVersion     = "2015-10-01";
     this.AcceptLanguage = "en-US";
     this.LongRunningOperationRetryTimeout = 30;
     this.GenerateClientRequestId          = true;
     SerializationSettings = new JsonSerializerSettings
     {
         Formatting            = Formatting.Indented,
         DateFormatHandling    = DateFormatHandling.IsoDateFormat,
         DateTimeZoneHandling  = DateTimeZoneHandling.Utc,
         NullValueHandling     = NullValueHandling.Ignore,
         ReferenceLoopHandling = ReferenceLoopHandling.Serialize,
         ContractResolver      = new ReadOnlyJsonContractResolver(),
         Converters            = new List <JsonConverter>
         {
             new Iso8601TimeSpanConverter()
         }
     };
     SerializationSettings.Converters.Add(new TransformationJsonConverter());
     DeserializationSettings = new JsonSerializerSettings
     {
         DateFormatHandling    = DateFormatHandling.IsoDateFormat,
         DateTimeZoneHandling  = DateTimeZoneHandling.Utc,
         NullValueHandling     = NullValueHandling.Ignore,
         ReferenceLoopHandling = ReferenceLoopHandling.Serialize,
         ContractResolver      = new ReadOnlyJsonContractResolver(),
         Converters            = new List <JsonConverter>
         {
             new Iso8601TimeSpanConverter()
         }
     };
     DeserializationSettings.Converters.Add(new TransformationJsonConverter());
     DeserializationSettings.Converters.Add(new CloudErrorJsonConverter());
 }
Esempio n. 4
0
 /// <summary>
 /// Get a Media Service.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='resourceGroupName'>
 /// Name of the resource group within the Azure subscription.
 /// </param>
 /// <param name='mediaServiceName'>
 /// Name of the Media Service.
 /// </param>
 public static MediaService Get(this IMediaServiceOperations operations, string resourceGroupName, string mediaServiceName)
 {
     return(Task.Factory.StartNew(s => ((IMediaServiceOperations)s).GetAsync(resourceGroupName, mediaServiceName), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult());
 }
Esempio n. 5
0
 /// <summary>
 /// List all of the Media Services in a resource group.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='resourceGroupName'>
 /// Name of the resource group within the Azure subscription.
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <IEnumerable <MediaService> > ListByResourceGroupAsync(this IMediaServiceOperations operations, string resourceGroupName, CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.ListByResourceGroupWithHttpMessagesAsync(resourceGroupName, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
Esempio n. 6
0
 /// <summary>
 /// Check whether the Media Service resource name is available. The name must
 /// be globally unique.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='checkNameAvailabilityInput'>
 /// Properties needed to check the availability of a name.
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <CheckNameAvailabilityOutput> CheckNameAvailabiltyAsync(this IMediaServiceOperations operations, CheckNameAvailabilityInput checkNameAvailabilityInput, CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.CheckNameAvailabiltyWithHttpMessagesAsync(checkNameAvailabilityInput, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
Esempio n. 7
0
 /// <summary>
 /// Check whether the Media Service resource name is available. The name must
 /// be globally unique.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='checkNameAvailabilityInput'>
 /// Properties needed to check the availability of a name.
 /// </param>
 public static CheckNameAvailabilityOutput CheckNameAvailabilty(this IMediaServiceOperations operations, CheckNameAvailabilityInput checkNameAvailabilityInput)
 {
     return(Task.Factory.StartNew(s => ((IMediaServiceOperations)s).CheckNameAvailabiltyAsync(checkNameAvailabilityInput), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult());
 }
Esempio n. 8
0
 /// <summary>
 /// Delete a Media Service.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='resourceGroupName'>
 /// Name of the resource group within the Azure subscription.
 /// </param>
 /// <param name='mediaServiceName'>
 /// Name of the Media Service.
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task DeleteAsync(this IMediaServiceOperations operations, string resourceGroupName, string mediaServiceName, CancellationToken cancellationToken = default(CancellationToken))
 {
     await operations.DeleteWithHttpMessagesAsync(resourceGroupName, mediaServiceName, null, cancellationToken).ConfigureAwait(false);
 }