diff --git a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/AzureMediaServicesClient.cs b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/AzureMediaServicesClient.cs index 0a177a9973d0..25a3bc0df384 100644 --- a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/AzureMediaServicesClient.cs +++ b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/AzureMediaServicesClient.cs @@ -71,6 +71,11 @@ public partial class AzureMediaServicesClient : ServiceClient public bool? GenerateClientRequestId { get; set; } + /// + /// Gets the IAccountFiltersOperations. + /// + public virtual IAccountFiltersOperations AccountFilters { get; private set; } + /// /// Gets the IOperations. /// @@ -97,9 +102,14 @@ public partial class AzureMediaServicesClient : ServiceClient - /// Gets the IAccountFiltersOperations. + /// Gets the IMediaServiceOperationStatusesOperations. /// - public virtual IAccountFiltersOperations AccountFilters { get; private set; } + public virtual IMediaServiceOperationStatusesOperations MediaServiceOperationStatuses { get; private set; } + + /// + /// Gets the IMediaServiceOperationResultsOperations. + /// + public virtual IMediaServiceOperationResultsOperations MediaServiceOperationResults { get; private set; } /// /// Gets the IAssetsOperations. @@ -111,6 +121,21 @@ public partial class AzureMediaServicesClient : ServiceClient public virtual IAssetFiltersOperations AssetFilters { get; private set; } + /// + /// Gets the ITracksOperations. + /// + public virtual ITracksOperations Tracks { get; private set; } + + /// + /// Gets the IOperationStatusesOperations. + /// + public virtual IOperationStatusesOperations OperationStatuses { get; private set; } + + /// + /// Gets the IOperationResultsOperations. + /// + public virtual IOperationResultsOperations OperationResults { get; private set; } + /// /// Gets the IContentKeyPoliciesOperations. /// @@ -392,14 +417,19 @@ public AzureMediaServicesClient(System.Uri baseUri, ServiceClientCredentials cre /// private void Initialize() { + AccountFilters = new AccountFiltersOperations(this); Operations = new Operations(this); Mediaservices = new MediaservicesOperations(this); PrivateLinkResources = new PrivateLinkResourcesOperations(this); PrivateEndpointConnections = new PrivateEndpointConnectionsOperations(this); Locations = new LocationsOperations(this); - AccountFilters = new AccountFiltersOperations(this); + MediaServiceOperationStatuses = new MediaServiceOperationStatusesOperations(this); + MediaServiceOperationResults = new MediaServiceOperationResultsOperations(this); Assets = new AssetsOperations(this); AssetFilters = new AssetFiltersOperations(this); + Tracks = new TracksOperations(this); + OperationStatuses = new OperationStatusesOperations(this); + OperationResults = new OperationResultsOperations(this); ContentKeyPolicies = new ContentKeyPoliciesOperations(this); Transforms = new TransformsOperations(this); Jobs = new JobsOperations(this); @@ -409,7 +439,7 @@ private void Initialize() LiveOutputs = new LiveOutputsOperations(this); StreamingEndpoints = new StreamingEndpointsOperations(this); BaseUri = new System.Uri("https://management.azure.com"); - ApiVersion = "2021-06-01"; + ApiVersion = "2021-11-01"; AcceptLanguage = "en-US"; LongRunningOperationRetryTimeout = 30; GenerateClientRequestId = true; @@ -439,6 +469,8 @@ private void Initialize() new Iso8601TimeSpanConverter() } }; + SerializationSettings.Converters.Add(new PolymorphicSerializeJsonConverter("@odata.type")); + DeserializationSettings.Converters.Add(new PolymorphicDeserializeJsonConverter("@odata.type")); SerializationSettings.Converters.Add(new PolymorphicSerializeJsonConverter("@odata.type")); DeserializationSettings.Converters.Add(new PolymorphicDeserializeJsonConverter("@odata.type")); SerializationSettings.Converters.Add(new PolymorphicSerializeJsonConverter("@odata.type")); @@ -451,8 +483,6 @@ private void Initialize() DeserializationSettings.Converters.Add(new PolymorphicDeserializeJsonConverter("@odata.type")); SerializationSettings.Converters.Add(new PolymorphicSerializeJsonConverter("@odata.type")); DeserializationSettings.Converters.Add(new PolymorphicDeserializeJsonConverter("@odata.type")); - SerializationSettings.Converters.Add(new PolymorphicSerializeJsonConverter("@odata.type")); - DeserializationSettings.Converters.Add(new PolymorphicDeserializeJsonConverter("@odata.type")); SerializationSettings.Converters.Add(new PolymorphicSerializeJsonConverter("@odata.type")); DeserializationSettings.Converters.Add(new PolymorphicDeserializeJsonConverter("@odata.type")); SerializationSettings.Converters.Add(new PolymorphicSerializeJsonConverter("@odata.type")); diff --git a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/IAzureMediaServicesClient.cs b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/IAzureMediaServicesClient.cs index d15d89845dac..801b956fd2cd 100644 --- a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/IAzureMediaServicesClient.cs +++ b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/IAzureMediaServicesClient.cs @@ -68,6 +68,11 @@ public partial interface IAzureMediaServicesClient : System.IDisposable bool? GenerateClientRequestId { get; set; } + /// + /// Gets the IAccountFiltersOperations. + /// + IAccountFiltersOperations AccountFilters { get; } + /// /// Gets the IOperations. /// @@ -94,9 +99,14 @@ public partial interface IAzureMediaServicesClient : System.IDisposable ILocationsOperations Locations { get; } /// - /// Gets the IAccountFiltersOperations. + /// Gets the IMediaServiceOperationStatusesOperations. /// - IAccountFiltersOperations AccountFilters { get; } + IMediaServiceOperationStatusesOperations MediaServiceOperationStatuses { get; } + + /// + /// Gets the IMediaServiceOperationResultsOperations. + /// + IMediaServiceOperationResultsOperations MediaServiceOperationResults { get; } /// /// Gets the IAssetsOperations. @@ -108,6 +118,21 @@ public partial interface IAzureMediaServicesClient : System.IDisposable /// IAssetFiltersOperations AssetFilters { get; } + /// + /// Gets the ITracksOperations. + /// + ITracksOperations Tracks { get; } + + /// + /// Gets the IOperationStatusesOperations. + /// + IOperationStatusesOperations OperationStatuses { get; } + + /// + /// Gets the IOperationResultsOperations. + /// + IOperationResultsOperations OperationResults { get; } + /// /// Gets the IContentKeyPoliciesOperations. /// diff --git a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/ILocationsOperations.cs b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/ILocationsOperations.cs index 8901a7a10cfa..a947955935fd 100644 --- a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/ILocationsOperations.cs +++ b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/ILocationsOperations.cs @@ -30,7 +30,7 @@ public partial interface ILocationsOperations /// Checks whether the Media Service resource name is available. /// /// - /// The name of the location + /// Location name. /// /// /// The account name. diff --git a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/IMediaServiceOperationResultsOperations.cs b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/IMediaServiceOperationResultsOperations.cs new file mode 100644 index 000000000000..c00d8bbe988e --- /dev/null +++ b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/IMediaServiceOperationResultsOperations.cs @@ -0,0 +1,55 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Media +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// MediaServiceOperationResultsOperations operations. + /// + public partial interface IMediaServiceOperationResultsOperations + { + /// + /// Get operation result. + /// + /// + /// Get media service operation result. + /// + /// + /// Location name. + /// + /// + /// Operation Id. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> GetWithHttpMessagesAsync(string locationName, string operationId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/IMediaServiceOperationStatusesOperations.cs b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/IMediaServiceOperationStatusesOperations.cs new file mode 100644 index 000000000000..b22e97ae9cf7 --- /dev/null +++ b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/IMediaServiceOperationStatusesOperations.cs @@ -0,0 +1,55 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Media +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// MediaServiceOperationStatusesOperations operations. + /// + public partial interface IMediaServiceOperationStatusesOperations + { + /// + /// Get operation status. + /// + /// + /// Get media service operation status. + /// + /// + /// Location name. + /// + /// + /// Operation ID. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> GetWithHttpMessagesAsync(string locationName, string operationId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/IMediaservicesOperations.cs b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/IMediaservicesOperations.cs index 28bd032bc784..4885280c61af 100644 --- a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/IMediaservicesOperations.cs +++ b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/IMediaservicesOperations.cs @@ -106,7 +106,7 @@ public partial interface IMediaservicesOperations /// /// Thrown when a required parameter is null /// - Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string accountName, MediaService parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string accountName, MediaService parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Delete a Media Services account. /// @@ -162,7 +162,7 @@ public partial interface IMediaservicesOperations /// /// Thrown when a required parameter is null /// - Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string accountName, MediaServiceUpdate parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string accountName, MediaServiceUpdate parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Synchronizes Storage Account Keys /// @@ -197,7 +197,7 @@ public partial interface IMediaservicesOperations /// account. /// /// - /// List the media edge policies associated with the Media Services + /// List all the media edge policies associated with the Media Services /// account. /// /// @@ -248,6 +248,68 @@ public partial interface IMediaservicesOperations /// Task>> ListBySubscriptionWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// + /// Create or update a Media Services account + /// + /// + /// Creates or updates a Media Services account + /// + /// + /// The name of the resource group within the Azure subscription. + /// + /// + /// The Media Services account name. + /// + /// + /// The request parameters + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string accountName, MediaService parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Update a Media Services account + /// + /// + /// Updates an existing Media Services account + /// + /// + /// The name of the resource group within the Azure subscription. + /// + /// + /// The Media Services account name. + /// + /// + /// The request parameters + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> BeginUpdateWithHttpMessagesAsync(string resourceGroupName, string accountName, MediaServiceUpdate parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// /// List Media Services accounts /// /// diff --git a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/IOperationResultsOperations.cs b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/IOperationResultsOperations.cs new file mode 100644 index 000000000000..72b4f8a73d20 --- /dev/null +++ b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/IOperationResultsOperations.cs @@ -0,0 +1,64 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Media +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// OperationResultsOperations operations. + /// + public partial interface IOperationResultsOperations + { + /// + /// Get operation result. + /// + /// + /// Get asset track operation result. + /// + /// + /// The name of the resource group within the Azure subscription. + /// + /// + /// The Media Services account name. + /// + /// + /// The Asset name. + /// + /// + /// The Asset Track name. + /// + /// + /// Operation Id. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> GetWithHttpMessagesAsync(string resourceGroupName, string accountName, string assetName, string trackName, string operationId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/IOperationStatusesOperations.cs b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/IOperationStatusesOperations.cs new file mode 100644 index 000000000000..3a4ecf5d0fbd --- /dev/null +++ b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/IOperationStatusesOperations.cs @@ -0,0 +1,64 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Media +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// OperationStatusesOperations operations. + /// + public partial interface IOperationStatusesOperations + { + /// + /// Get operation status. + /// + /// + /// Get asset track operation status. + /// + /// + /// The name of the resource group within the Azure subscription. + /// + /// + /// The Media Services account name. + /// + /// + /// The Asset name. + /// + /// + /// The Asset Track name. + /// + /// + /// Operation Id. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> GetWithHttpMessagesAsync(string resourceGroupName, string accountName, string assetName, string trackName, string operationId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/IPrivateEndpointConnectionsOperations.cs b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/IPrivateEndpointConnectionsOperations.cs index e2f5da63fd0e..f41ff974837b 100644 --- a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/IPrivateEndpointConnectionsOperations.cs +++ b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/IPrivateEndpointConnectionsOperations.cs @@ -24,10 +24,10 @@ namespace Microsoft.Azure.Management.Media public partial interface IPrivateEndpointConnectionsOperations { /// - /// Get all private endpoint connections. + /// List private endpoint connections. /// /// - /// Get all private endpoint connections. + /// List all private endpoint connections. /// /// /// The name of the resource group within the Azure subscription. @@ -55,7 +55,7 @@ public partial interface IPrivateEndpointConnectionsOperations /// Get private endpoint connection. /// /// - /// Get private endpoint connection. + /// Get the details of a private endpoint connection. /// /// /// The name of the resource group within the Azure subscription. @@ -82,10 +82,10 @@ public partial interface IPrivateEndpointConnectionsOperations /// Task> GetWithHttpMessagesAsync(string resourceGroupName, string accountName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Update private endpoint connection. + /// Update a private endpoint connection. /// /// - /// Update private endpoint connection. + /// Update an existing private endpoint connection. /// /// /// The name of the resource group within the Azure subscription. @@ -115,10 +115,10 @@ public partial interface IPrivateEndpointConnectionsOperations /// Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string accountName, string name, PrivateEndpointConnection parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Delete private endpoint connection. + /// Delete a private endpoint connection. /// /// - /// Delete private endpoint connection. + /// Deletes a private endpoint connection. /// /// /// The name of the resource group within the Azure subscription. diff --git a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/IPrivateLinkResourcesOperations.cs b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/IPrivateLinkResourcesOperations.cs index 517e9113979d..a7d8b742f97f 100644 --- a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/IPrivateLinkResourcesOperations.cs +++ b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/IPrivateLinkResourcesOperations.cs @@ -27,7 +27,7 @@ public partial interface IPrivateLinkResourcesOperations /// Get list of group IDs. /// /// - /// Get list of group IDs. + /// List supported group IDs. /// /// /// The name of the resource group within the Azure subscription. @@ -55,7 +55,7 @@ public partial interface IPrivateLinkResourcesOperations /// Get group ID. /// /// - /// Get group ID. + /// Get details of a group ID. /// /// /// The name of the resource group within the Azure subscription. diff --git a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/IStreamingEndpointsOperations.cs b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/IStreamingEndpointsOperations.cs index d33681c68602..3f20ecdc36a5 100644 --- a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/IStreamingEndpointsOperations.cs +++ b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/IStreamingEndpointsOperations.cs @@ -183,6 +183,37 @@ public partial interface IStreamingEndpointsOperations /// Task DeleteWithHttpMessagesAsync(string resourceGroupName, string accountName, string streamingEndpointName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// + /// List StreamingEndpoint skus + /// + /// + /// List streaming endpoint supported skus. + /// + /// + /// The name of the resource group within the Azure subscription. + /// + /// + /// The Media Services account name. + /// + /// + /// The name of the streaming endpoint, maximum length is 24. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> SkusWithHttpMessagesAsync(string resourceGroupName, string accountName, string streamingEndpointName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// /// Start StreamingEndpoint /// /// diff --git a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/ITracksOperations.cs b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/ITracksOperations.cs new file mode 100644 index 000000000000..95adf634f679 --- /dev/null +++ b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/ITracksOperations.cs @@ -0,0 +1,376 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Media +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// TracksOperations operations. + /// + public partial interface ITracksOperations + { + /// + /// List Tracks in the Asset + /// + /// + /// Lists the Tracks in the asset + /// + /// + /// The name of the resource group within the Azure subscription. + /// + /// + /// The Media Services account name. + /// + /// + /// The Asset name. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> ListWithHttpMessagesAsync(string resourceGroupName, string accountName, string assetName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Get a Track + /// + /// + /// Get the details of a Track in the Asset + /// + /// + /// The name of the resource group within the Azure subscription. + /// + /// + /// The Media Services account name. + /// + /// + /// The Asset name. + /// + /// + /// The Asset Track name. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> GetWithHttpMessagesAsync(string resourceGroupName, string accountName, string assetName, string trackName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Create or update a Track + /// + /// + /// Create or update a Track in the asset + /// + /// + /// The name of the resource group within the Azure subscription. + /// + /// + /// The Media Services account name. + /// + /// + /// The Asset name. + /// + /// + /// The Asset Track name. + /// + /// + /// Detailed information about a track in the asset. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string accountName, string assetName, string trackName, TrackBase track = default(TrackBase), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Delete a Track + /// + /// + /// Deletes a Track in the asset + /// + /// + /// The name of the resource group within the Azure subscription. + /// + /// + /// The Media Services account name. + /// + /// + /// The Asset name. + /// + /// + /// The Asset Track name. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task> DeleteWithHttpMessagesAsync(string resourceGroupName, string accountName, string assetName, string trackName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Update an Track + /// + /// + /// Updates an existing Track in the asset + /// + /// + /// The name of the resource group within the Azure subscription. + /// + /// + /// The Media Services account name. + /// + /// + /// The Asset name. + /// + /// + /// The Asset Track name. + /// + /// + /// Detailed information about a track in the asset. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string accountName, string assetName, string trackName, TrackBase track = default(TrackBase), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Update the track data + /// + /// + /// Update the track data. Call this API after any changes are made to + /// the track data stored in the asset container. For example, you have + /// modified the WebVTT captions file in the Azure blob storage + /// container for the asset, viewers will not see the new version of + /// the captions unless this API is called. Note, the changes may not + /// be reflected immediately. CDN cache may also need to be purged if + /// applicable. + /// + /// + /// The name of the resource group within the Azure subscription. + /// + /// + /// The Media Services account name. + /// + /// + /// The Asset name. + /// + /// + /// The Asset Track name. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task> UpdateTrackDataWithHttpMessagesAsync(string resourceGroupName, string accountName, string assetName, string trackName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Create or update a Track + /// + /// + /// Create or update a Track in the asset + /// + /// + /// The name of the resource group within the Azure subscription. + /// + /// + /// The Media Services account name. + /// + /// + /// The Asset name. + /// + /// + /// The Asset Track name. + /// + /// + /// Detailed information about a track in the asset. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string accountName, string assetName, string trackName, TrackBase track = default(TrackBase), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Delete a Track + /// + /// + /// Deletes a Track in the asset + /// + /// + /// The name of the resource group within the Azure subscription. + /// + /// + /// The Media Services account name. + /// + /// + /// The Asset name. + /// + /// + /// The Asset Track name. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task> BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string accountName, string assetName, string trackName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Update an Track + /// + /// + /// Updates an existing Track in the asset + /// + /// + /// The name of the resource group within the Azure subscription. + /// + /// + /// The Media Services account name. + /// + /// + /// The Asset name. + /// + /// + /// The Asset Track name. + /// + /// + /// Detailed information about a track in the asset. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> BeginUpdateWithHttpMessagesAsync(string resourceGroupName, string accountName, string assetName, string trackName, TrackBase track = default(TrackBase), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Update the track data + /// + /// + /// Update the track data. Call this API after any changes are made to + /// the track data stored in the asset container. For example, you have + /// modified the WebVTT captions file in the Azure blob storage + /// container for the asset, viewers will not see the new version of + /// the captions unless this API is called. Note, the changes may not + /// be reflected immediately. CDN cache may also need to be purged if + /// applicable. + /// + /// + /// The name of the resource group within the Azure subscription. + /// + /// + /// The Media Services account name. + /// + /// + /// The Asset name. + /// + /// + /// The Asset Track name. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task> BeginUpdateTrackDataWithHttpMessagesAsync(string resourceGroupName, string accountName, string assetName, string trackName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/LocationsOperations.cs b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/LocationsOperations.cs index a769429f7f06..edf048a5e1fe 100644 --- a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/LocationsOperations.cs +++ b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/LocationsOperations.cs @@ -57,7 +57,7 @@ internal LocationsOperations(AzureMediaServicesClient client) /// Checks whether the Media Service resource name is available. /// /// - /// The name of the location + /// Location name. /// /// /// The account name. diff --git a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/LocationsOperationsExtensions.cs b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/LocationsOperationsExtensions.cs index 93109997b296..8783230abd55 100644 --- a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/LocationsOperationsExtensions.cs +++ b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/LocationsOperationsExtensions.cs @@ -31,7 +31,7 @@ public static partial class LocationsOperationsExtensions /// The operations group for this extension method. /// /// - /// The name of the location + /// Location name. /// /// /// The account name. @@ -55,7 +55,7 @@ public static partial class LocationsOperationsExtensions /// The operations group for this extension method. /// /// - /// The name of the location + /// Location name. /// /// /// The account name. diff --git a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/MediaServiceOperationResultsOperations.cs b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/MediaServiceOperationResultsOperations.cs new file mode 100644 index 000000000000..489fcaccabc4 --- /dev/null +++ b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/MediaServiceOperationResultsOperations.cs @@ -0,0 +1,261 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Media +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + using System.Net; + using System.Net.Http; + using System.Threading; + using System.Threading.Tasks; + + /// + /// MediaServiceOperationResultsOperations operations. + /// + internal partial class MediaServiceOperationResultsOperations : IServiceOperations, IMediaServiceOperationResultsOperations + { + /// + /// Initializes a new instance of the MediaServiceOperationResultsOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal MediaServiceOperationResultsOperations(AzureMediaServicesClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the AzureMediaServicesClient + /// + public AzureMediaServicesClient Client { get; private set; } + + /// + /// Get operation result. + /// + /// + /// Get media service operation result. + /// + /// + /// Location name. + /// + /// + /// Operation Id. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> GetWithHttpMessagesAsync(string locationName, string operationId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (locationName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "locationName"); + } + if (operationId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "operationId"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("locationName", locationName); + tracingParameters.Add("operationId", operationId); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Media/locations/{locationName}/mediaServiceOperationResults/{operationId}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{locationName}", System.Uri.EscapeDataString(locationName)); + _url = _url.Replace("{operationId}", System.Uri.EscapeDataString(operationId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202) + { + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + try + { + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(JsonSerializer.Create(Client.DeserializationSettings)); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + } +} diff --git a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/MediaServiceOperationResultsOperationsExtensions.cs b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/MediaServiceOperationResultsOperationsExtensions.cs new file mode 100644 index 000000000000..c04855eec02e --- /dev/null +++ b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/MediaServiceOperationResultsOperationsExtensions.cs @@ -0,0 +1,71 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Media +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for MediaServiceOperationResultsOperations. + /// + public static partial class MediaServiceOperationResultsOperationsExtensions + { + /// + /// Get operation result. + /// + /// + /// Get media service operation result. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Location name. + /// + /// + /// Operation Id. + /// + public static MediaService Get(this IMediaServiceOperationResultsOperations operations, string locationName, string operationId) + { + return operations.GetAsync(locationName, operationId).GetAwaiter().GetResult(); + } + + /// + /// Get operation result. + /// + /// + /// Get media service operation result. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Location name. + /// + /// + /// Operation Id. + /// + /// + /// The cancellation token. + /// + public static async Task GetAsync(this IMediaServiceOperationResultsOperations operations, string locationName, string operationId, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(locationName, operationId, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +} diff --git a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/MediaServiceOperationStatusesOperations.cs b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/MediaServiceOperationStatusesOperations.cs new file mode 100644 index 000000000000..c8152ac10294 --- /dev/null +++ b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/MediaServiceOperationStatusesOperations.cs @@ -0,0 +1,248 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Media +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + using System.Net; + using System.Net.Http; + using System.Threading; + using System.Threading.Tasks; + + /// + /// MediaServiceOperationStatusesOperations operations. + /// + internal partial class MediaServiceOperationStatusesOperations : IServiceOperations, IMediaServiceOperationStatusesOperations + { + /// + /// Initializes a new instance of the MediaServiceOperationStatusesOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal MediaServiceOperationStatusesOperations(AzureMediaServicesClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the AzureMediaServicesClient + /// + public AzureMediaServicesClient Client { get; private set; } + + /// + /// Get operation status. + /// + /// + /// Get media service operation status. + /// + /// + /// Location name. + /// + /// + /// Operation ID. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> GetWithHttpMessagesAsync(string locationName, string operationId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (locationName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "locationName"); + } + if (operationId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "operationId"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("locationName", locationName); + tracingParameters.Add("operationId", operationId); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Media/locations/{locationName}/mediaServiceOperationStatuses/{operationId}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{locationName}", System.Uri.EscapeDataString(locationName)); + _url = _url.Replace("{operationId}", System.Uri.EscapeDataString(operationId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + } +} diff --git a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/MediaServiceOperationStatusesOperationsExtensions.cs b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/MediaServiceOperationStatusesOperationsExtensions.cs new file mode 100644 index 000000000000..e331ae0591ac --- /dev/null +++ b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/MediaServiceOperationStatusesOperationsExtensions.cs @@ -0,0 +1,71 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Media +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for MediaServiceOperationStatusesOperations. + /// + public static partial class MediaServiceOperationStatusesOperationsExtensions + { + /// + /// Get operation status. + /// + /// + /// Get media service operation status. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Location name. + /// + /// + /// Operation ID. + /// + public static MediaServiceOperationStatus Get(this IMediaServiceOperationStatusesOperations operations, string locationName, string operationId) + { + return operations.GetAsync(locationName, operationId).GetAwaiter().GetResult(); + } + + /// + /// Get operation status. + /// + /// + /// Get media service operation status. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Location name. + /// + /// + /// Operation ID. + /// + /// + /// The cancellation token. + /// + public static async Task GetAsync(this IMediaServiceOperationStatusesOperations operations, string locationName, string operationId, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(locationName, operationId, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +} diff --git a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/MediaservicesOperations.cs b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/MediaservicesOperations.cs index 1f1ddcb43c9c..fae607327562 100644 --- a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/MediaservicesOperations.cs +++ b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/MediaservicesOperations.cs @@ -445,6 +445,31 @@ internal MediaservicesOperations(AzureMediaServicesClient client) /// The request parameters /// /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string accountName, MediaService parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send Request + AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, accountName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Delete a Media Services account. + /// + /// + /// Deletes a Media Services account + /// + /// + /// The name of the resource group within the Azure subscription. + /// + /// + /// The Media Services account name. + /// + /// /// Headers that will be added to request. /// /// @@ -453,9 +478,6 @@ internal MediaservicesOperations(AzureMediaServicesClient client) /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// @@ -465,7 +487,7 @@ internal MediaservicesOperations(AzureMediaServicesClient client) /// /// A response object containing the response body and response headers. /// - public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string accountName, MediaService parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string accountName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (Client.SubscriptionId == null) { @@ -479,14 +501,6 @@ internal MediaservicesOperations(AzureMediaServicesClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "accountName"); } - if (parameters == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); - } - if (parameters != null) - { - parameters.Validate(); - } if (Client.ApiVersion == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); @@ -500,9 +514,8 @@ internal MediaservicesOperations(AzureMediaServicesClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); - tracingParameters.Add("parameters", parameters); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdate", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "Delete", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; @@ -522,7 +535,7 @@ internal MediaservicesOperations(AzureMediaServicesClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.Method = new HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -553,12 +566,6 @@ internal MediaservicesOperations(AzureMediaServicesClient client) // Serialize Request string _requestContent = null; - if(parameters != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials if (Client.Credentials != null) { @@ -579,7 +586,7 @@ internal MediaservicesOperations(AzureMediaServicesClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 201) + if ((int)_statusCode != 200 && (int)_statusCode != 204) { var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -609,49 +616,13 @@ internal MediaservicesOperations(AzureMediaServicesClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - // Deserialize Response - if ((int)_statusCode == 201) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -660,10 +631,10 @@ internal MediaservicesOperations(AzureMediaServicesClient client) } /// - /// Delete a Media Services account. + /// Update a Media Services account /// /// - /// Deletes a Media Services account + /// Updates an existing Media Services account /// /// /// The name of the resource group within the Azure subscription. @@ -671,6 +642,38 @@ internal MediaservicesOperations(AzureMediaServicesClient client) /// /// The Media Services account name. /// + /// + /// The request parameters + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string accountName, MediaServiceUpdate parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send Request + AzureOperationResponse _response = await BeginUpdateWithHttpMessagesAsync(resourceGroupName, accountName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Synchronizes Storage Account Keys + /// + /// + /// Synchronizes storage account keys for a storage account associated with the + /// Media Service account. + /// + /// + /// The name of the resource group within the Azure subscription. + /// + /// + /// The Media Services account name. + /// + /// + /// The ID of the storage account resource. + /// /// /// Headers that will be added to request. /// @@ -689,7 +692,7 @@ internal MediaservicesOperations(AzureMediaServicesClient client) /// /// A response object containing the response body and response headers. /// - public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string accountName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task SyncStorageKeysWithHttpMessagesAsync(string resourceGroupName, string accountName, string id = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (Client.SubscriptionId == null) { @@ -707,6 +710,11 @@ internal MediaservicesOperations(AzureMediaServicesClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } + SyncStorageKeysInput parameters = new SyncStorageKeysInput(); + if (id != null) + { + parameters.Id = id; + } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -716,12 +724,13 @@ internal MediaservicesOperations(AzureMediaServicesClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); + tracingParameters.Add("parameters", parameters); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Delete", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "SyncStorageKeys", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaservices/{accountName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaservices/{accountName}/syncStorageKeys").ToString(); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); @@ -737,7 +746,7 @@ internal MediaservicesOperations(AzureMediaServicesClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); + _httpRequest.Method = new HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -768,6 +777,12 @@ internal MediaservicesOperations(AzureMediaServicesClient client) // Serialize Request string _requestContent = null; + if(parameters != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } // Set Credentials if (Client.Credentials != null) { @@ -788,7 +803,7 @@ internal MediaservicesOperations(AzureMediaServicesClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 204) + if ((int)_statusCode != 200) { var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -833,10 +848,11 @@ internal MediaservicesOperations(AzureMediaServicesClient client) } /// - /// Update a Media Services account + /// List the media edge policies associated with the Media Services account. /// /// - /// Updates an existing Media Services account + /// List all the media edge policies associated with the Media Services + /// account. /// /// /// The name of the resource group within the Azure subscription. @@ -844,8 +860,8 @@ internal MediaservicesOperations(AzureMediaServicesClient client) /// /// The Media Services account name. /// - /// - /// The request parameters + /// + /// Unique identifier of the edge device. /// /// /// Headers that will be added to request. @@ -868,7 +884,7 @@ internal MediaservicesOperations(AzureMediaServicesClient client) /// /// A response object containing the response body and response headers. /// - public async Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string accountName, MediaServiceUpdate parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> ListEdgePoliciesWithHttpMessagesAsync(string resourceGroupName, string accountName, string deviceId = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (Client.SubscriptionId == null) { @@ -882,14 +898,15 @@ internal MediaservicesOperations(AzureMediaServicesClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "accountName"); } - if (parameters == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); - } if (Client.ApiVersion == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } + ListEdgePoliciesInput parameters = new ListEdgePoliciesInput(); + if (deviceId != null) + { + parameters.DeviceId = deviceId; + } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -901,11 +918,11 @@ internal MediaservicesOperations(AzureMediaServicesClient client) tracingParameters.Add("accountName", accountName); tracingParameters.Add("parameters", parameters); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Update", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListEdgePolicies", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaservices/{accountName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaservices/{accountName}/listEdgePolicies").ToString(); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); @@ -921,7 +938,7 @@ internal MediaservicesOperations(AzureMediaServicesClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PATCH"); + _httpRequest.Method = new HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -1008,7 +1025,7 @@ internal MediaservicesOperations(AzureMediaServicesClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -1021,7 +1038,7 @@ internal MediaservicesOperations(AzureMediaServicesClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -1041,21 +1058,11 @@ internal MediaservicesOperations(AzureMediaServicesClient client) } /// - /// Synchronizes Storage Account Keys + /// List Media Services accounts /// /// - /// Synchronizes storage account keys for a storage account associated with the - /// Media Service account. + /// List Media Services accounts in the subscription. /// - /// - /// The name of the resource group within the Azure subscription. - /// - /// - /// The Media Services account name. - /// - /// - /// The ID of the storage account resource. - /// /// /// Headers that will be added to request. /// @@ -1065,6 +1072,9 @@ internal MediaservicesOperations(AzureMediaServicesClient client) /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// @@ -1074,29 +1084,16 @@ internal MediaservicesOperations(AzureMediaServicesClient client) /// /// A response object containing the response body and response headers. /// - public async Task SyncStorageKeysWithHttpMessagesAsync(string resourceGroupName, string accountName, string id = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListBySubscriptionWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - if (resourceGroupName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); - } - if (accountName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "accountName"); - } if (Client.ApiVersion == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - SyncStorageKeysInput parameters = new SyncStorageKeysInput(); - if (id != null) - { - parameters.Id = id; - } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1104,18 +1101,13 @@ internal MediaservicesOperations(AzureMediaServicesClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("accountName", accountName); - tracingParameters.Add("parameters", parameters); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "SyncStorageKeys", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListBySubscription", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaservices/{accountName}/syncStorageKeys").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Media/mediaservices").ToString(); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); List _queryParameters = new List(); if (Client.ApiVersion != null) { @@ -1128,7 +1120,7 @@ internal MediaservicesOperations(AzureMediaServicesClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -1159,12 +1151,6 @@ internal MediaservicesOperations(AzureMediaServicesClient client) // Serialize Request string _requestContent = null; - if(parameters != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials if (Client.Credentials != null) { @@ -1215,13 +1201,31 @@ internal MediaservicesOperations(AzureMediaServicesClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -1230,10 +1234,10 @@ internal MediaservicesOperations(AzureMediaServicesClient client) } /// - /// List the media edge policies associated with the Media Services account. + /// Create or update a Media Services account /// /// - /// List the media edge policies associated with the Media Services account. + /// Creates or updates a Media Services account /// /// /// The name of the resource group within the Azure subscription. @@ -1241,8 +1245,8 @@ internal MediaservicesOperations(AzureMediaServicesClient client) /// /// The Media Services account name. /// - /// - /// Unique identifier of the edge device. + /// + /// The request parameters /// /// /// Headers that will be added to request. @@ -1265,7 +1269,7 @@ internal MediaservicesOperations(AzureMediaServicesClient client) /// /// A response object containing the response body and response headers. /// - public async Task> ListEdgePoliciesWithHttpMessagesAsync(string resourceGroupName, string accountName, string deviceId = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string accountName, MediaService parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (Client.SubscriptionId == null) { @@ -1279,14 +1283,17 @@ internal MediaservicesOperations(AzureMediaServicesClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "accountName"); } - if (Client.ApiVersion == null) + if (parameters == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); } - ListEdgePoliciesInput parameters = new ListEdgePoliciesInput(); - if (deviceId != null) + if (parameters != null) { - parameters.DeviceId = deviceId; + parameters.Validate(); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; @@ -1299,11 +1306,11 @@ internal MediaservicesOperations(AzureMediaServicesClient client) tracingParameters.Add("accountName", accountName); tracingParameters.Add("parameters", parameters); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListEdgePolicies", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaservices/{accountName}/listEdgePolicies").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaservices/{accountName}").ToString(); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); @@ -1319,7 +1326,7 @@ internal MediaservicesOperations(AzureMediaServicesClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.Method = new HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -1376,7 +1383,7 @@ internal MediaservicesOperations(AzureMediaServicesClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 201) { var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -1406,7 +1413,7 @@ internal MediaservicesOperations(AzureMediaServicesClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -1419,7 +1426,25 @@ internal MediaservicesOperations(AzureMediaServicesClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + // Deserialize Response + if ((int)_statusCode == 201) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -1431,6 +1456,19 @@ internal MediaservicesOperations(AzureMediaServicesClient client) throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); } } + try + { + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(JsonSerializer.Create(Client.DeserializationSettings)); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -1439,11 +1477,20 @@ internal MediaservicesOperations(AzureMediaServicesClient client) } /// - /// List Media Services accounts + /// Update a Media Services account /// /// - /// List Media Services accounts in the subscription. + /// Updates an existing Media Services account /// + /// + /// The name of the resource group within the Azure subscription. + /// + /// + /// The Media Services account name. + /// + /// + /// The request parameters + /// /// /// Headers that will be added to request. /// @@ -1465,12 +1512,24 @@ internal MediaservicesOperations(AzureMediaServicesClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListBySubscriptionWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> BeginUpdateWithHttpMessagesAsync(string resourceGroupName, string accountName, MediaServiceUpdate parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (accountName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "accountName"); + } + if (parameters == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + } if (Client.ApiVersion == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); @@ -1482,13 +1541,18 @@ internal MediaservicesOperations(AzureMediaServicesClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("accountName", accountName); + tracingParameters.Add("parameters", parameters); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListBySubscription", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "BeginUpdate", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Media/mediaservices").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaservices/{accountName}").ToString(); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); List _queryParameters = new List(); if (Client.ApiVersion != null) { @@ -1501,7 +1565,7 @@ internal MediaservicesOperations(AzureMediaServicesClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("PATCH"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -1532,6 +1596,12 @@ internal MediaservicesOperations(AzureMediaServicesClient client) // Serialize Request string _requestContent = null; + if(parameters != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } // Set Credentials if (Client.Credentials != null) { @@ -1552,7 +1622,7 @@ internal MediaservicesOperations(AzureMediaServicesClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 202) { var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -1582,7 +1652,7 @@ internal MediaservicesOperations(AzureMediaServicesClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -1590,12 +1660,12 @@ internal MediaservicesOperations(AzureMediaServicesClient client) _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } // Deserialize Response - if ((int)_statusCode == 200) + if ((int)_statusCode == 202) { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -1607,6 +1677,19 @@ internal MediaservicesOperations(AzureMediaServicesClient client) throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); } } + try + { + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(JsonSerializer.Create(Client.DeserializationSettings)); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); diff --git a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/MediaservicesOperationsExtensions.cs b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/MediaservicesOperationsExtensions.cs index cd21d97b0fae..66b63fa24d98 100644 --- a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/MediaservicesOperationsExtensions.cs +++ b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/MediaservicesOperationsExtensions.cs @@ -309,7 +309,8 @@ public static MediaService Update(this IMediaservicesOperations operations, stri /// List the media edge policies associated with the Media Services account. /// /// - /// List the media edge policies associated with the Media Services account. + /// List all the media edge policies associated with the Media Services + /// account. /// /// /// The operations group for this extension method. @@ -332,7 +333,8 @@ public static MediaService Update(this IMediaservicesOperations operations, stri /// List the media edge policies associated with the Media Services account. /// /// - /// List the media edge policies associated with the Media Services account. + /// List all the media edge policies associated with the Media Services + /// account. /// /// /// The operations group for this extension method. @@ -391,6 +393,110 @@ public static IPage ListBySubscription(this IMediaservicesOperatio } } + /// + /// Create or update a Media Services account + /// + /// + /// Creates or updates a Media Services account + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group within the Azure subscription. + /// + /// + /// The Media Services account name. + /// + /// + /// The request parameters + /// + public static MediaService BeginCreateOrUpdate(this IMediaservicesOperations operations, string resourceGroupName, string accountName, MediaService parameters) + { + return operations.BeginCreateOrUpdateAsync(resourceGroupName, accountName, parameters).GetAwaiter().GetResult(); + } + + /// + /// Create or update a Media Services account + /// + /// + /// Creates or updates a Media Services account + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group within the Azure subscription. + /// + /// + /// The Media Services account name. + /// + /// + /// The request parameters + /// + /// + /// The cancellation token. + /// + public static async Task BeginCreateOrUpdateAsync(this IMediaservicesOperations operations, string resourceGroupName, string accountName, MediaService parameters, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, accountName, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Update a Media Services account + /// + /// + /// Updates an existing Media Services account + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group within the Azure subscription. + /// + /// + /// The Media Services account name. + /// + /// + /// The request parameters + /// + public static MediaService BeginUpdate(this IMediaservicesOperations operations, string resourceGroupName, string accountName, MediaServiceUpdate parameters) + { + return operations.BeginUpdateAsync(resourceGroupName, accountName, parameters).GetAwaiter().GetResult(); + } + + /// + /// Update a Media Services account + /// + /// + /// Updates an existing Media Services account + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group within the Azure subscription. + /// + /// + /// The Media Services account name. + /// + /// + /// The request parameters + /// + /// + /// The cancellation token. + /// + public static async Task BeginUpdateAsync(this IMediaservicesOperations operations, string resourceGroupName, string accountName, MediaServiceUpdate parameters, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.BeginUpdateWithHttpMessagesAsync(resourceGroupName, accountName, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// /// List Media Services accounts /// diff --git a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/ArmStreamingEndpointCapacity.cs b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/ArmStreamingEndpointCapacity.cs new file mode 100644 index 000000000000..f720e10ddcbb --- /dev/null +++ b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/ArmStreamingEndpointCapacity.cs @@ -0,0 +1,78 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Media.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// The streaming endpoint sku capacity. + /// + public partial class ArmStreamingEndpointCapacity + { + /// + /// Initializes a new instance of the ArmStreamingEndpointCapacity + /// class. + /// + public ArmStreamingEndpointCapacity() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ArmStreamingEndpointCapacity + /// class. + /// + /// The streaming endpoint default + /// capacity. + /// The streaming endpoint minimum + /// capacity. + /// The streaming endpoint maximum + /// capacity. + public ArmStreamingEndpointCapacity(string scaleType = default(string), int? defaultProperty = default(int?), int? minimum = default(int?), int? maximum = default(int?)) + { + ScaleType = scaleType; + DefaultProperty = defaultProperty; + Minimum = minimum; + Maximum = maximum; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// + [JsonProperty(PropertyName = "scaleType")] + public string ScaleType { get; private set; } + + /// + /// Gets or sets the streaming endpoint default capacity. + /// + [JsonProperty(PropertyName = "default")] + public int? DefaultProperty { get; set; } + + /// + /// Gets or sets the streaming endpoint minimum capacity. + /// + [JsonProperty(PropertyName = "minimum")] + public int? Minimum { get; set; } + + /// + /// Gets or sets the streaming endpoint maximum capacity. + /// + [JsonProperty(PropertyName = "maximum")] + public int? Maximum { get; set; } + + } +} diff --git a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/ArmStreamingEndpointCurrentSku.cs b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/ArmStreamingEndpointCurrentSku.cs new file mode 100644 index 000000000000..7d8aa9519b38 --- /dev/null +++ b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/ArmStreamingEndpointCurrentSku.cs @@ -0,0 +1,61 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Media.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// The streaming endpoint current sku. + /// + public partial class ArmStreamingEndpointCurrentSku + { + /// + /// Initializes a new instance of the ArmStreamingEndpointCurrentSku + /// class. + /// + public ArmStreamingEndpointCurrentSku() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ArmStreamingEndpointCurrentSku + /// class. + /// + /// The streaming endpoint sku name. + /// The streaming endpoint sku capacity. + public ArmStreamingEndpointCurrentSku(string name = default(string), int? capacity = default(int?)) + { + Name = name; + Capacity = capacity; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets the streaming endpoint sku name. + /// + [JsonProperty(PropertyName = "name")] + public string Name { get; private set; } + + /// + /// Gets or sets the streaming endpoint sku capacity. + /// + [JsonProperty(PropertyName = "capacity")] + public int? Capacity { get; set; } + + } +} diff --git a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/ArmStreamingEndpointSku.cs b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/ArmStreamingEndpointSku.cs new file mode 100644 index 000000000000..796b458e84de --- /dev/null +++ b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/ArmStreamingEndpointSku.cs @@ -0,0 +1,51 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Media.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// The streaming endpoint sku. + /// + public partial class ArmStreamingEndpointSku + { + /// + /// Initializes a new instance of the ArmStreamingEndpointSku class. + /// + public ArmStreamingEndpointSku() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ArmStreamingEndpointSku class. + /// + /// The streaming endpoint sku name. + public ArmStreamingEndpointSku(string name = default(string)) + { + Name = name; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets the streaming endpoint sku name. + /// + [JsonProperty(PropertyName = "name")] + public string Name { get; private set; } + + } +} diff --git a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/ArmStreamingEndpointSkuInfo.cs b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/ArmStreamingEndpointSkuInfo.cs new file mode 100644 index 000000000000..9f57c3c29eb3 --- /dev/null +++ b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/ArmStreamingEndpointSkuInfo.cs @@ -0,0 +1,60 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Media.Models +{ + using Newtonsoft.Json; + using System.Linq; + + public partial class ArmStreamingEndpointSkuInfo + { + /// + /// Initializes a new instance of the ArmStreamingEndpointSkuInfo + /// class. + /// + public ArmStreamingEndpointSkuInfo() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ArmStreamingEndpointSkuInfo + /// class. + /// + public ArmStreamingEndpointSkuInfo(string resourceType = default(string), ArmStreamingEndpointCapacity capacity = default(ArmStreamingEndpointCapacity), ArmStreamingEndpointSku sku = default(ArmStreamingEndpointSku)) + { + ResourceType = resourceType; + Capacity = capacity; + Sku = sku; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// + [JsonProperty(PropertyName = "resourceType")] + public string ResourceType { get; set; } + + /// + /// + [JsonProperty(PropertyName = "capacity")] + public ArmStreamingEndpointCapacity Capacity { get; set; } + + /// + /// + [JsonProperty(PropertyName = "sku")] + public ArmStreamingEndpointSku Sku { get; set; } + + } +} diff --git a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/AssetTrack.cs b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/AssetTrack.cs new file mode 100644 index 000000000000..28006f45d0ea --- /dev/null +++ b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/AssetTrack.cs @@ -0,0 +1,73 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Media.Models +{ + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Linq; + + /// + /// An Asset Track resource. + /// + [Rest.Serialization.JsonTransformation] + public partial class AssetTrack : ProxyResource + { + /// + /// Initializes a new instance of the AssetTrack class. + /// + public AssetTrack() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the AssetTrack class. + /// + /// Fully qualified resource ID for the resource. Ex - + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + /// The name of the resource + /// The type of the resource. E.g. + /// "Microsoft.Compute/virtualMachines" or + /// "Microsoft.Storage/storageAccounts" + /// Detailed information about a track in the + /// asset. + /// Provisioning state of the asset + /// track. Possible values include: 'Failed', 'InProgress', + /// 'Succeeded' + public AssetTrack(string id = default(string), string name = default(string), string type = default(string), TrackBase track = default(TrackBase), ProvisioningState provisioningState = default(ProvisioningState)) + : base(id, name, type) + { + Track = track; + ProvisioningState = provisioningState; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets detailed information about a track in the asset. + /// + [JsonProperty(PropertyName = "properties.track")] + public TrackBase Track { get; set; } + + /// + /// Gets provisioning state of the asset track. Possible values + /// include: 'Failed', 'InProgress', 'Succeeded' + /// + [JsonProperty(PropertyName = "properties.provisioningState")] + public ProvisioningState ProvisioningState { get; private set; } + + } +} diff --git a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/AssetTrackOperationStatus.cs b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/AssetTrackOperationStatus.cs new file mode 100644 index 000000000000..38134b3a294a --- /dev/null +++ b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/AssetTrackOperationStatus.cs @@ -0,0 +1,107 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Media.Models +{ + using Microsoft.Rest; + using Newtonsoft.Json; + using System.Linq; + + /// + /// Status of asset track operation. + /// + public partial class AssetTrackOperationStatus + { + /// + /// Initializes a new instance of the AssetTrackOperationStatus class. + /// + public AssetTrackOperationStatus() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the AssetTrackOperationStatus class. + /// + /// Operation identifier. + /// Operation status. + /// Operation resource ID. + /// Operation start time. + /// Operation end time. + public AssetTrackOperationStatus(string name, string status, string id = default(string), System.DateTime? startTime = default(System.DateTime?), System.DateTime? endTime = default(System.DateTime?), ErrorDetail error = default(ErrorDetail)) + { + Name = name; + Id = id; + StartTime = startTime; + EndTime = endTime; + Status = status; + Error = error; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets operation identifier. + /// + [JsonProperty(PropertyName = "name")] + public string Name { get; set; } + + /// + /// Gets or sets operation resource ID. + /// + [JsonProperty(PropertyName = "id")] + public string Id { get; set; } + + /// + /// Gets or sets operation start time. + /// + [JsonProperty(PropertyName = "startTime")] + public System.DateTime? StartTime { get; set; } + + /// + /// Gets or sets operation end time. + /// + [JsonProperty(PropertyName = "endTime")] + public System.DateTime? EndTime { get; set; } + + /// + /// Gets or sets operation status. + /// + [JsonProperty(PropertyName = "status")] + public string Status { get; set; } + + /// + /// + [JsonProperty(PropertyName = "error")] + public ErrorDetail Error { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (Name == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Name"); + } + if (Status == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Status"); + } + } + } +} diff --git a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/AudioTrack.cs b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/AudioTrack.cs new file mode 100644 index 000000000000..7adaee337ece --- /dev/null +++ b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/AudioTrack.cs @@ -0,0 +1,37 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Media.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Represents an audio track in the asset. + /// + [Newtonsoft.Json.JsonObject("#Microsoft.Media.AudioTrack")] + public partial class AudioTrack : TrackBase + { + /// + /// Initializes a new instance of the AudioTrack class. + /// + public AudioTrack() + { + CustomInit(); + } + + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + } +} diff --git a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/BuiltInStandardEncoderPreset.cs b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/BuiltInStandardEncoderPreset.cs index 8e21d8cf02b9..3eb86d6db5b0 100644 --- a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/BuiltInStandardEncoderPreset.cs +++ b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/BuiltInStandardEncoderPreset.cs @@ -43,10 +43,9 @@ public BuiltInStandardEncoderPreset() /// 'H265ContentAwareEncoding', 'H265AdaptiveStreaming', /// 'H265SingleBitrate720p', 'H265SingleBitrate1080p', /// 'H265SingleBitrate4K' - /// PresetConfigurations are only - /// supported for the ContentAwareEncoding and H265ContentAwareEncoding - /// built-in presets. These settings will not affect other built-in or - /// custom defined presets. + /// Optional configuration settings for + /// encoder. Configurations is only supported for ContentAwareEncoding + /// and H265ContentAwareEncoding BuiltInStandardEncoderPreset. public BuiltInStandardEncoderPreset(EncoderNamedPreset presetName, PresetConfigurations configurations = default(PresetConfigurations)) { Configurations = configurations; @@ -60,10 +59,9 @@ public BuiltInStandardEncoderPreset() partial void CustomInit(); /// - /// Gets or sets presetConfigurations are only supported for the - /// ContentAwareEncoding and H265ContentAwareEncoding built-in presets. - /// These settings will not affect other built-in or custom defined - /// presets. + /// Gets or sets optional configuration settings for encoder. + /// Configurations is only supported for ContentAwareEncoding and + /// H265ContentAwareEncoding BuiltInStandardEncoderPreset. /// [JsonProperty(PropertyName = "configurations")] public PresetConfigurations Configurations { get; set; } diff --git a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/H264Layer.cs b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/H264Layer.cs index 543d4976bd0e..84a7302a85e4 100644 --- a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/H264Layer.cs +++ b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/H264Layer.cs @@ -17,7 +17,6 @@ namespace Microsoft.Azure.Management.Media.Models /// Describes the settings to be used when encoding the input video into a /// desired output bitrate layer with the H.264 video codec. /// - [Newtonsoft.Json.JsonObject("#Microsoft.Media.H264Layer")] public partial class H264Layer : VideoLayer { /// @@ -75,6 +74,13 @@ public H264Layer() /// should be in ISO 8601 format. The value should be in the range /// [0.1-100] seconds. The default is 5 seconds (for example, /// PT5S). + /// The value of CRF to be used when encoding this + /// layer. This setting takes effect when RateControlMode of video + /// codec is set at CRF mode. The range of CRF value is between 0 and + /// 51, where lower values would result in better quality, at the + /// expense of higher file sizes. Higher values mean more compression, + /// but at some point quality degradation will be noticed. Default + /// value is 23. /// The number of reference frames to be /// used when encoding this layer. If not specified, the encoder /// determines an appropriate number based on the encoder complexity @@ -83,12 +89,13 @@ public H264Layer() /// layer. If not specified, the encoder chooses the mode that is /// appropriate for the profile and level. Possible values include: /// 'Cabac', 'Cavlc' - public H264Layer(int bitrate, string width = default(string), string height = default(string), string label = default(string), int? maxBitrate = default(int?), int? bFrames = default(int?), string frameRate = default(string), int? slices = default(int?), bool? adaptiveBFrame = default(bool?), H264VideoProfile? profile = default(H264VideoProfile?), string level = default(string), System.TimeSpan? bufferWindow = default(System.TimeSpan?), int? referenceFrames = default(int?), EntropyMode? entropyMode = default(EntropyMode?)) + public H264Layer(int bitrate, string width = default(string), string height = default(string), string label = default(string), int? maxBitrate = default(int?), int? bFrames = default(int?), string frameRate = default(string), int? slices = default(int?), bool? adaptiveBFrame = default(bool?), H264VideoProfile? profile = default(H264VideoProfile?), string level = default(string), System.TimeSpan? bufferWindow = default(System.TimeSpan?), double? crf = default(double?), int? referenceFrames = default(int?), EntropyMode? entropyMode = default(EntropyMode?)) : base(bitrate, width, height, label, maxBitrate, bFrames, frameRate, slices, adaptiveBFrame) { Profile = profile; Level = level; BufferWindow = bufferWindow; + Crf = crf; ReferenceFrames = referenceFrames; EntropyMode = entropyMode; CustomInit(); @@ -124,6 +131,17 @@ public H264Layer() [JsonProperty(PropertyName = "bufferWindow")] public System.TimeSpan? BufferWindow { get; set; } + /// + /// Gets or sets the value of CRF to be used when encoding this layer. + /// This setting takes effect when RateControlMode of video codec is + /// set at CRF mode. The range of CRF value is between 0 and 51, where + /// lower values would result in better quality, at the expense of + /// higher file sizes. Higher values mean more compression, but at some + /// point quality degradation will be noticed. Default value is 23. + /// + [JsonProperty(PropertyName = "crf")] + public double? Crf { get; set; } + /// /// Gets or sets the number of reference frames to be used when /// encoding this layer. If not specified, the encoder determines an diff --git a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/H264RateControlMode.cs b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/H264RateControlMode.cs new file mode 100644 index 000000000000..c0abd0bcef19 --- /dev/null +++ b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/H264RateControlMode.cs @@ -0,0 +1,119 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Media.Models +{ + using Newtonsoft.Json; + + /// + /// Defines values for H264RateControlMode. + /// + /// + /// Determine base value for a given allowed value if exists, else return + /// the value itself + /// + [JsonConverter(typeof(H264RateControlModeConverter))] + public struct H264RateControlMode : System.IEquatable + { + private H264RateControlMode(string underlyingValue) + { + UnderlyingValue=underlyingValue; + } + + /// + /// Average Bitrate (ABR) mode that hits the target bitrate: Default + /// mode. + /// + public static readonly H264RateControlMode ABR = "ABR"; + + /// + /// Constant Bitrate (CBR) mode that tightens bitrate variations around + /// target bitrate. + /// + public static readonly H264RateControlMode CBR = "CBR"; + + /// + /// Constant Rate Factor (CRF) mode that targets at constant subjective + /// quality. + /// + public static readonly H264RateControlMode CRF = "CRF"; + + + /// + /// Underlying value of enum H264RateControlMode + /// + private readonly string UnderlyingValue; + + /// + /// Returns string representation for H264RateControlMode + /// + public override string ToString() + { + return UnderlyingValue == null ? null : UnderlyingValue.ToString(); + } + + /// + /// Compares enums of type H264RateControlMode + /// + public bool Equals(H264RateControlMode e) + { + return UnderlyingValue.Equals(e.UnderlyingValue); + } + + /// + /// Implicit operator to convert string to H264RateControlMode + /// + public static implicit operator H264RateControlMode(string value) + { + return new H264RateControlMode(value); + } + + /// + /// Implicit operator to convert H264RateControlMode to string + /// + public static implicit operator string(H264RateControlMode e) + { + return e.UnderlyingValue; + } + + /// + /// Overriding == operator for enum H264RateControlMode + /// + public static bool operator == (H264RateControlMode e1, H264RateControlMode e2) + { + return e2.Equals(e1); + } + + /// + /// Overriding != operator for enum H264RateControlMode + /// + public static bool operator != (H264RateControlMode e1, H264RateControlMode e2) + { + return !e2.Equals(e1); + } + + /// + /// Overrides Equals operator for H264RateControlMode + /// + public override bool Equals(object obj) + { + return obj is H264RateControlMode && Equals((H264RateControlMode)obj); + } + + /// + /// Returns for hashCode H264RateControlMode + /// + public override int GetHashCode() + { + return UnderlyingValue.GetHashCode(); + } + + } +} diff --git a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/H264RateControlModeConverter.cs b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/H264RateControlModeConverter.cs new file mode 100644 index 000000000000..dbd810c58b64 --- /dev/null +++ b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/H264RateControlModeConverter.cs @@ -0,0 +1,53 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Media.Models +{ + using Newtonsoft.Json; + + using System.Reflection; + + /// + /// Defines values for H264RateControlMode. + /// + public sealed class H264RateControlModeConverter : JsonConverter + { + + /// + /// Returns if objectType can be converted to H264RateControlMode by + /// the converter. + /// + public override bool CanConvert(System.Type objectType) + { + return typeof(H264RateControlMode).GetTypeInfo().IsAssignableFrom(objectType.GetTypeInfo()); + } + + /// + /// Overrides ReadJson and converts token to H264RateControlMode. + /// + public override object ReadJson(JsonReader reader, System.Type objectType, object existingValue, JsonSerializer serializer) + { + if (reader.TokenType == Newtonsoft.Json.JsonToken.Null) + { + return null; + } + return (H264RateControlMode)serializer.Deserialize(reader); + } + + /// + /// Overriding WriteJson for H264RateControlMode for serialization. + /// + public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer) + { + writer.WriteValue(value.ToString()); + } + + } +} diff --git a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/H264Video.cs b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/H264Video.cs index b841e52c2b8e..922839c9a0de 100644 --- a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/H264Video.cs +++ b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/H264Video.cs @@ -46,22 +46,25 @@ public H264Video() /// 'AutoFit' /// The Video Sync Mode. Possible values /// include: 'Auto', 'Passthrough', 'Cfr', 'Vfr' - /// Whether or not the encoder - /// should insert key frames at scene changes. If not specified, the - /// default is false. This flag should be set to true only when the - /// encoder is being configured to produce a single output - /// video. /// Tells the encoder how to choose its /// encoding settings. The default value is Balanced. Possible values /// include: 'Speed', 'Balanced', 'Quality' /// The collection of output H.264 layers to be /// produced by the encoder. - public H264Video(string label = default(string), System.TimeSpan? keyFrameInterval = default(System.TimeSpan?), StretchMode? stretchMode = default(StretchMode?), VideoSyncMode? syncMode = default(VideoSyncMode?), bool? sceneChangeDetection = default(bool?), H264Complexity? complexity = default(H264Complexity?), IList layers = default(IList)) + /// The video rate control mode. Possible + /// values include: 'ABR', 'CBR', 'CRF' + /// Whether or not the encoder + /// should insert key frames at scene changes. If not specified, the + /// default is false. This flag should be set to true only when the + /// encoder is being configured to produce a single output + /// video. + public H264Video(string label = default(string), System.TimeSpan? keyFrameInterval = default(System.TimeSpan?), StretchMode? stretchMode = default(StretchMode?), VideoSyncMode? syncMode = default(VideoSyncMode?), H264Complexity? complexity = default(H264Complexity?), IList layers = default(IList), H264RateControlMode? rateControlMode = default(H264RateControlMode?), bool? sceneChangeDetection = default(bool?)) : base(label, keyFrameInterval, stretchMode, syncMode) { - SceneChangeDetection = sceneChangeDetection; Complexity = complexity; Layers = layers; + RateControlMode = rateControlMode; + SceneChangeDetection = sceneChangeDetection; CustomInit(); } @@ -70,15 +73,6 @@ public H264Video() /// partial void CustomInit(); - /// - /// Gets or sets whether or not the encoder should insert key frames at - /// scene changes. If not specified, the default is false. This flag - /// should be set to true only when the encoder is being configured to - /// produce a single output video. - /// - [JsonProperty(PropertyName = "sceneChangeDetection")] - public bool? SceneChangeDetection { get; set; } - /// /// Gets or sets tells the encoder how to choose its encoding settings. /// The default value is Balanced. Possible values include: 'Speed', @@ -94,5 +88,21 @@ public H264Video() [JsonProperty(PropertyName = "layers")] public IList Layers { get; set; } + /// + /// Gets or sets the video rate control mode. Possible values include: + /// 'ABR', 'CBR', 'CRF' + /// + [JsonProperty(PropertyName = "rateControlMode")] + public H264RateControlMode? RateControlMode { get; set; } + + /// + /// Gets or sets whether or not the encoder should insert key frames at + /// scene changes. If not specified, the default is false. This flag + /// should be set to true only when the encoder is being configured to + /// produce a single output video. + /// + [JsonProperty(PropertyName = "sceneChangeDetection")] + public bool? SceneChangeDetection { get; set; } + } } diff --git a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/H265Layer.cs b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/H265Layer.cs index 4e7d15544a60..786d04e54cdf 100644 --- a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/H265Layer.cs +++ b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/H265Layer.cs @@ -17,7 +17,6 @@ namespace Microsoft.Azure.Management.Media.Models /// Describes the settings to be used when encoding the input video into a /// desired output bitrate layer with the H.265 video codec. /// - [Newtonsoft.Json.JsonObject("#Microsoft.Media.H265Layer")] public partial class H265Layer : H265VideoLayer { /// @@ -67,7 +66,7 @@ public H265Layer() /// the encoder will turn it on whenever the video profile permits its /// use. /// We currently support Main. Default is Auto. - /// Possible values include: 'Auto', 'Main' + /// Possible values include: 'Auto', 'Main', 'Main10' /// We currently support Level up to 6.2. The value /// can be Auto, or a number that matches the H.265 profile. If not /// specified, the default is Auto, which lets the encoder choose the @@ -76,16 +75,24 @@ public H265Layer() /// should be in ISO 8601 format. The value should be in the range /// [0.1-100] seconds. The default is 5 seconds (for example, /// PT5S). + /// The value of CRF to be used when encoding this + /// layer. This setting takes effect when RateControlMode of video + /// codec is set at CRF mode. The range of CRF value is between 0 and + /// 51, where lower values would result in better quality, at the + /// expense of higher file sizes. Higher values mean more compression, + /// but at some point quality degradation will be noticed. Default + /// value is 28. /// The number of reference frames to be /// used when encoding this layer. If not specified, the encoder /// determines an appropriate number based on the encoder complexity /// setting. - public H265Layer(int bitrate, string width = default(string), string height = default(string), string label = default(string), int? maxBitrate = default(int?), int? bFrames = default(int?), string frameRate = default(string), int? slices = default(int?), bool? adaptiveBFrame = default(bool?), H265VideoProfile? profile = default(H265VideoProfile?), string level = default(string), System.TimeSpan? bufferWindow = default(System.TimeSpan?), int? referenceFrames = default(int?)) + public H265Layer(int bitrate, string width = default(string), string height = default(string), string label = default(string), int? maxBitrate = default(int?), int? bFrames = default(int?), string frameRate = default(string), int? slices = default(int?), bool? adaptiveBFrame = default(bool?), H265VideoProfile? profile = default(H265VideoProfile?), string level = default(string), System.TimeSpan? bufferWindow = default(System.TimeSpan?), double? crf = default(double?), int? referenceFrames = default(int?)) : base(bitrate, width, height, label, maxBitrate, bFrames, frameRate, slices, adaptiveBFrame) { Profile = profile; Level = level; BufferWindow = bufferWindow; + Crf = crf; ReferenceFrames = referenceFrames; CustomInit(); } @@ -97,7 +104,7 @@ public H265Layer() /// /// Gets or sets we currently support Main. Default is Auto. Possible - /// values include: 'Auto', 'Main' + /// values include: 'Auto', 'Main', 'Main10' /// [JsonProperty(PropertyName = "profile")] public H265VideoProfile? Profile { get; set; } @@ -119,6 +126,17 @@ public H265Layer() [JsonProperty(PropertyName = "bufferWindow")] public System.TimeSpan? BufferWindow { get; set; } + /// + /// Gets or sets the value of CRF to be used when encoding this layer. + /// This setting takes effect when RateControlMode of video codec is + /// set at CRF mode. The range of CRF value is between 0 and 51, where + /// lower values would result in better quality, at the expense of + /// higher file sizes. Higher values mean more compression, but at some + /// point quality degradation will be noticed. Default value is 28. + /// + [JsonProperty(PropertyName = "crf")] + public double? Crf { get; set; } + /// /// Gets or sets the number of reference frames to be used when /// encoding this layer. If not specified, the encoder determines an diff --git a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/H265VideoLayer.cs b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/H265VideoLayer.cs index 94c841abb045..61cdac110500 100644 --- a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/H265VideoLayer.cs +++ b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/H265VideoLayer.cs @@ -17,7 +17,6 @@ namespace Microsoft.Azure.Management.Media.Models /// Describes the settings to be used when encoding the input video into a /// desired output bitrate layer. /// - [Newtonsoft.Json.JsonObject("#Microsoft.Media.H265VideoLayer")] public partial class H265VideoLayer : Layer { /// diff --git a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/H265VideoProfile.cs b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/H265VideoProfile.cs index 92e7173f66aa..04cf1bdd85f3 100644 --- a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/H265VideoProfile.cs +++ b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/H265VideoProfile.cs @@ -39,6 +39,12 @@ private H265VideoProfile(string underlyingValue) /// public static readonly H265VideoProfile Main = "Main"; + /// + /// Main 10 profile + /// (https://en.wikipedia.org/wiki/High_Efficiency_Video_Coding#Main_10) + /// + public static readonly H265VideoProfile Main10 = "Main10"; + /// /// Underlying value of enum H265VideoProfile diff --git a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/HlsSettings.cs b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/HlsSettings.cs new file mode 100644 index 000000000000..0691977144ae --- /dev/null +++ b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/HlsSettings.cs @@ -0,0 +1,69 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Media.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// The HLS setting for a text track. + /// + public partial class HlsSettings + { + /// + /// Initializes a new instance of the HlsSettings class. + /// + public HlsSettings() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the HlsSettings class. + /// + /// The default for the HLS + /// setting. + /// The forced for the HLS setting. + /// The characteristics for the HLS + /// setting. + public HlsSettings(bool? defaultProperty = default(bool?), bool? forced = default(bool?), string characteristics = default(string)) + { + DefaultProperty = defaultProperty; + Forced = forced; + Characteristics = characteristics; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the default for the HLS setting. + /// + [JsonProperty(PropertyName = "default")] + public bool? DefaultProperty { get; set; } + + /// + /// Gets or sets the forced for the HLS setting. + /// + [JsonProperty(PropertyName = "forced")] + public bool? Forced { get; set; } + + /// + /// Gets or sets the characteristics for the HLS setting. + /// + [JsonProperty(PropertyName = "characteristics")] + public string Characteristics { get; set; } + + } +} diff --git a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/JpgLayer.cs b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/JpgLayer.cs index 9991a1c4abba..d33cbcd467e8 100644 --- a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/JpgLayer.cs +++ b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/JpgLayer.cs @@ -16,7 +16,6 @@ namespace Microsoft.Azure.Management.Media.Models /// /// Describes the settings to produce a JPEG image from the input video. /// - [Newtonsoft.Json.JsonObject("#Microsoft.Media.JpgLayer")] public partial class JpgLayer : Layer { /// diff --git a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/MediaService.cs b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/MediaService.cs index 672ae61e62cd..d2c978697f7f 100644 --- a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/MediaService.cs +++ b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/MediaService.cs @@ -54,11 +54,16 @@ public MediaService() /// Whether or not public network /// access is allowed for resources under the Media Services account. /// Possible values include: 'Enabled', 'Disabled' - /// The Managed Identity for the Media Services - /// account. + /// Provisioning state of the Media + /// Services account. Possible values include: 'Failed', 'InProgress', + /// 'Succeeded' + /// The Private Endpoint + /// Connections created for the Media Service account. /// The system metadata relating to this /// resource. - public MediaService(string location, string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), System.Guid mediaServiceId = default(System.Guid), IList storageAccounts = default(IList), StorageAuthentication? storageAuthentication = default(StorageAuthentication?), AccountEncryption encryption = default(AccountEncryption), KeyDelivery keyDelivery = default(KeyDelivery), PublicNetworkAccess? publicNetworkAccess = default(PublicNetworkAccess?), MediaServiceIdentity identity = default(MediaServiceIdentity), SystemData systemData = default(SystemData)) + /// The Managed Identity for the Media Services + /// account. + public MediaService(string location, string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), System.Guid mediaServiceId = default(System.Guid), IList storageAccounts = default(IList), StorageAuthentication? storageAuthentication = default(StorageAuthentication?), AccountEncryption encryption = default(AccountEncryption), KeyDelivery keyDelivery = default(KeyDelivery), PublicNetworkAccess? publicNetworkAccess = default(PublicNetworkAccess?), ProvisioningState provisioningState = default(ProvisioningState), object privateEndpointConnections = default(object), SystemData systemData = default(SystemData), MediaServiceIdentity identity = default(MediaServiceIdentity)) : base(location, id, name, type, tags) { MediaServiceId = mediaServiceId; @@ -67,8 +72,10 @@ public MediaService() Encryption = encryption; KeyDelivery = keyDelivery; PublicNetworkAccess = publicNetworkAccess; - Identity = identity; + ProvisioningState = provisioningState; + PrivateEndpointConnections = privateEndpointConnections; SystemData = systemData; + Identity = identity; CustomInit(); } @@ -117,10 +124,18 @@ public MediaService() public PublicNetworkAccess? PublicNetworkAccess { get; set; } /// - /// Gets or sets the Managed Identity for the Media Services account. + /// Gets provisioning state of the Media Services account. Possible + /// values include: 'Failed', 'InProgress', 'Succeeded' /// - [JsonProperty(PropertyName = "identity")] - public MediaServiceIdentity Identity { get; set; } + [JsonProperty(PropertyName = "properties.provisioningState")] + public ProvisioningState ProvisioningState { get; private set; } + + /// + /// Gets the Private Endpoint Connections created for the Media Service + /// account. + /// + [JsonProperty(PropertyName = "properties.privateEndpointConnections")] + public object PrivateEndpointConnections { get; private set; } /// /// Gets the system metadata relating to this resource. @@ -128,6 +143,12 @@ public MediaService() [JsonProperty(PropertyName = "systemData")] public SystemData SystemData { get; private set; } + /// + /// Gets or sets the Managed Identity for the Media Services account. + /// + [JsonProperty(PropertyName = "identity")] + public MediaServiceIdentity Identity { get; set; } + /// /// Validate the object. /// diff --git a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/MediaServiceOperationResultsGetHeaders.cs b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/MediaServiceOperationResultsGetHeaders.cs new file mode 100644 index 000000000000..b42174762095 --- /dev/null +++ b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/MediaServiceOperationResultsGetHeaders.cs @@ -0,0 +1,73 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Media.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Defines headers for Get operation. + /// + public partial class MediaServiceOperationResultsGetHeaders + { + /// + /// Initializes a new instance of the + /// MediaServiceOperationResultsGetHeaders class. + /// + public MediaServiceOperationResultsGetHeaders() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// MediaServiceOperationResultsGetHeaders class. + /// + /// The recommended number of seconds to wait + /// before calling the URI specified in Azure-AsyncOperation. + /// The URI to poll for completion + /// status. + /// The URI to poll for completion + /// status. + public MediaServiceOperationResultsGetHeaders(int? retryAfter = default(int?), string location = default(string), string azureAsyncOperation = default(string)) + { + RetryAfter = retryAfter; + Location = location; + AzureAsyncOperation = azureAsyncOperation; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the recommended number of seconds to wait before + /// calling the URI specified in Azure-AsyncOperation. + /// + [JsonProperty(PropertyName = "Retry-After")] + public int? RetryAfter { get; set; } + + /// + /// Gets or sets the URI to poll for completion status. + /// + [JsonProperty(PropertyName = "Location")] + public string Location { get; set; } + + /// + /// Gets or sets the URI to poll for completion status. + /// + [JsonProperty(PropertyName = "Azure-AsyncOperation")] + public string AzureAsyncOperation { get; set; } + + } +} diff --git a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/MediaServiceOperationStatus.cs b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/MediaServiceOperationStatus.cs new file mode 100644 index 000000000000..5f91ef355aaf --- /dev/null +++ b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/MediaServiceOperationStatus.cs @@ -0,0 +1,109 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Media.Models +{ + using Microsoft.Rest; + using Newtonsoft.Json; + using System.Linq; + + /// + /// Status of media service operation. + /// + public partial class MediaServiceOperationStatus + { + /// + /// Initializes a new instance of the MediaServiceOperationStatus + /// class. + /// + public MediaServiceOperationStatus() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the MediaServiceOperationStatus + /// class. + /// + /// Operation identifier. + /// Operation status. + /// Operation resource ID. + /// Operation start time. + /// Operation end time. + public MediaServiceOperationStatus(string name, string status, string id = default(string), System.DateTime? startTime = default(System.DateTime?), System.DateTime? endTime = default(System.DateTime?), ErrorDetail error = default(ErrorDetail)) + { + Name = name; + Id = id; + StartTime = startTime; + EndTime = endTime; + Status = status; + Error = error; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets operation identifier. + /// + [JsonProperty(PropertyName = "name")] + public string Name { get; set; } + + /// + /// Gets or sets operation resource ID. + /// + [JsonProperty(PropertyName = "id")] + public string Id { get; set; } + + /// + /// Gets or sets operation start time. + /// + [JsonProperty(PropertyName = "startTime")] + public System.DateTime? StartTime { get; set; } + + /// + /// Gets or sets operation end time. + /// + [JsonProperty(PropertyName = "endTime")] + public System.DateTime? EndTime { get; set; } + + /// + /// Gets or sets operation status. + /// + [JsonProperty(PropertyName = "status")] + public string Status { get; set; } + + /// + /// + [JsonProperty(PropertyName = "error")] + public ErrorDetail Error { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (Name == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Name"); + } + if (Status == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Status"); + } + } + } +} diff --git a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/MediaServiceUpdate.cs b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/MediaServiceUpdate.cs index 0b065c3b3213..802744974fbb 100644 --- a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/MediaServiceUpdate.cs +++ b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/MediaServiceUpdate.cs @@ -46,9 +46,14 @@ public MediaServiceUpdate() /// Whether or not public network /// access is allowed for resources under the Media Services account. /// Possible values include: 'Enabled', 'Disabled' + /// Provisioning state of the Media + /// Services account. Possible values include: 'Failed', 'InProgress', + /// 'Succeeded' + /// The Private Endpoint + /// Connections created for the Media Service account. /// The Managed Identity for the Media Services /// account. - public MediaServiceUpdate(IDictionary tags = default(IDictionary), System.Guid mediaServiceId = default(System.Guid), IList storageAccounts = default(IList), StorageAuthentication? storageAuthentication = default(StorageAuthentication?), AccountEncryption encryption = default(AccountEncryption), KeyDelivery keyDelivery = default(KeyDelivery), PublicNetworkAccess? publicNetworkAccess = default(PublicNetworkAccess?), MediaServiceIdentity identity = default(MediaServiceIdentity)) + public MediaServiceUpdate(IDictionary tags = default(IDictionary), System.Guid mediaServiceId = default(System.Guid), IList storageAccounts = default(IList), StorageAuthentication? storageAuthentication = default(StorageAuthentication?), AccountEncryption encryption = default(AccountEncryption), KeyDelivery keyDelivery = default(KeyDelivery), PublicNetworkAccess? publicNetworkAccess = default(PublicNetworkAccess?), ProvisioningState provisioningState = default(ProvisioningState), object privateEndpointConnections = default(object), MediaServiceIdentity identity = default(MediaServiceIdentity)) { Tags = tags; MediaServiceId = mediaServiceId; @@ -57,6 +62,8 @@ public MediaServiceUpdate() Encryption = encryption; KeyDelivery = keyDelivery; PublicNetworkAccess = publicNetworkAccess; + ProvisioningState = provisioningState; + PrivateEndpointConnections = privateEndpointConnections; Identity = identity; CustomInit(); } @@ -111,6 +118,20 @@ public MediaServiceUpdate() [JsonProperty(PropertyName = "properties.publicNetworkAccess")] public PublicNetworkAccess? PublicNetworkAccess { get; set; } + /// + /// Gets provisioning state of the Media Services account. Possible + /// values include: 'Failed', 'InProgress', 'Succeeded' + /// + [JsonProperty(PropertyName = "properties.provisioningState")] + public ProvisioningState ProvisioningState { get; private set; } + + /// + /// Gets the Private Endpoint Connections created for the Media Service + /// account. + /// + [JsonProperty(PropertyName = "properties.privateEndpointConnections")] + public object PrivateEndpointConnections { get; private set; } + /// /// Gets or sets the Managed Identity for the Media Services account. /// diff --git a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/MediaservicesCreateOrUpdateHeaders.cs b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/MediaservicesCreateOrUpdateHeaders.cs new file mode 100644 index 000000000000..02992264a3f3 --- /dev/null +++ b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/MediaservicesCreateOrUpdateHeaders.cs @@ -0,0 +1,73 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Media.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Defines headers for CreateOrUpdate operation. + /// + public partial class MediaservicesCreateOrUpdateHeaders + { + /// + /// Initializes a new instance of the + /// MediaservicesCreateOrUpdateHeaders class. + /// + public MediaservicesCreateOrUpdateHeaders() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// MediaservicesCreateOrUpdateHeaders class. + /// + /// The recommended number of seconds to wait + /// before calling the URI specified in Azure-AsyncOperation. + /// The URI to poll for completion + /// status. + /// The URI to poll for completion + /// status. + public MediaservicesCreateOrUpdateHeaders(int? retryAfter = default(int?), string location = default(string), string azureAsyncOperation = default(string)) + { + RetryAfter = retryAfter; + Location = location; + AzureAsyncOperation = azureAsyncOperation; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the recommended number of seconds to wait before + /// calling the URI specified in Azure-AsyncOperation. + /// + [JsonProperty(PropertyName = "Retry-After")] + public int? RetryAfter { get; set; } + + /// + /// Gets or sets the URI to poll for completion status. + /// + [JsonProperty(PropertyName = "Location")] + public string Location { get; set; } + + /// + /// Gets or sets the URI to poll for completion status. + /// + [JsonProperty(PropertyName = "Azure-AsyncOperation")] + public string AzureAsyncOperation { get; set; } + + } +} diff --git a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/MediaservicesUpdateHeaders.cs b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/MediaservicesUpdateHeaders.cs new file mode 100644 index 000000000000..de302f54b818 --- /dev/null +++ b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/MediaservicesUpdateHeaders.cs @@ -0,0 +1,71 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Media.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Defines headers for Update operation. + /// + public partial class MediaservicesUpdateHeaders + { + /// + /// Initializes a new instance of the MediaservicesUpdateHeaders class. + /// + public MediaservicesUpdateHeaders() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the MediaservicesUpdateHeaders class. + /// + /// The recommended number of seconds to wait + /// before calling the URI specified in Azure-AsyncOperation. + /// The URI to poll for completion + /// status. + /// The URI to poll for completion + /// status. + public MediaservicesUpdateHeaders(int? retryAfter = default(int?), string location = default(string), string azureAsyncOperation = default(string)) + { + RetryAfter = retryAfter; + Location = location; + AzureAsyncOperation = azureAsyncOperation; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the recommended number of seconds to wait before + /// calling the URI specified in Azure-AsyncOperation. + /// + [JsonProperty(PropertyName = "Retry-After")] + public int? RetryAfter { get; set; } + + /// + /// Gets or sets the URI to poll for completion status. + /// + [JsonProperty(PropertyName = "Location")] + public string Location { get; set; } + + /// + /// Gets or sets the URI to poll for completion status. + /// + [JsonProperty(PropertyName = "Azure-AsyncOperation")] + public string AzureAsyncOperation { get; set; } + + } +} diff --git a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/OperationResultsGetHeaders.cs b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/OperationResultsGetHeaders.cs new file mode 100644 index 000000000000..d553ab431235 --- /dev/null +++ b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/OperationResultsGetHeaders.cs @@ -0,0 +1,71 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Media.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Defines headers for Get operation. + /// + public partial class OperationResultsGetHeaders + { + /// + /// Initializes a new instance of the OperationResultsGetHeaders class. + /// + public OperationResultsGetHeaders() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the OperationResultsGetHeaders class. + /// + /// The recommended number of seconds to wait + /// before calling the URI specified in Azure-AsyncOperation. + /// The URI to poll for completion + /// status. + /// The URI to poll for completion + /// status. + public OperationResultsGetHeaders(int? retryAfter = default(int?), string location = default(string), string azureAsyncOperation = default(string)) + { + RetryAfter = retryAfter; + Location = location; + AzureAsyncOperation = azureAsyncOperation; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the recommended number of seconds to wait before + /// calling the URI specified in Azure-AsyncOperation. + /// + [JsonProperty(PropertyName = "Retry-After")] + public int? RetryAfter { get; set; } + + /// + /// Gets or sets the URI to poll for completion status. + /// + [JsonProperty(PropertyName = "Location")] + public string Location { get; set; } + + /// + /// Gets or sets the URI to poll for completion status. + /// + [JsonProperty(PropertyName = "Azure-AsyncOperation")] + public string AzureAsyncOperation { get; set; } + + } +} diff --git a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/Page1.cs b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/Page1.cs new file mode 100644 index 000000000000..0186bb8d97ab --- /dev/null +++ b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/Page1.cs @@ -0,0 +1,53 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Media.Models +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + + /// + /// Defines a page in Azure responses. + /// + /// Type of the page content items + [JsonObject] + public class Page1 : IPage + { + /// + /// Gets the link to the next page. + /// + [JsonProperty("")] + public string NextPageLink { get; private set; } + + [JsonProperty("value")] + private IList Items{ get; set; } + + /// + /// Returns an enumerator that iterates through the collection. + /// + /// A an enumerator that can be used to iterate through the collection. + public IEnumerator GetEnumerator() + { + return Items == null ? System.Linq.Enumerable.Empty().GetEnumerator() : Items.GetEnumerator(); + } + + /// + /// Returns an enumerator that iterates through the collection. + /// + /// A an enumerator that can be used to iterate through the collection. + IEnumerator IEnumerable.GetEnumerator() + { + return GetEnumerator(); + } + } +} diff --git a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/PngLayer.cs b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/PngLayer.cs index 1f76b59e4085..5131acd1c6b0 100644 --- a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/PngLayer.cs +++ b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/PngLayer.cs @@ -10,13 +10,11 @@ namespace Microsoft.Azure.Management.Media.Models { - using Newtonsoft.Json; using System.Linq; /// /// Describes the settings to produce a PNG image from the input video. /// - [Newtonsoft.Json.JsonObject("#Microsoft.Media.PngLayer")] public partial class PngLayer : Layer { /// diff --git a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/ProvisioningState.cs b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/ProvisioningState.cs new file mode 100644 index 000000000000..acfa7785d598 --- /dev/null +++ b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/ProvisioningState.cs @@ -0,0 +1,116 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Media.Models +{ + using Newtonsoft.Json; + + /// + /// Defines values for ProvisioningState. + /// + /// + /// Determine base value for a given allowed value if exists, else return + /// the value itself + /// + [JsonConverter(typeof(ProvisioningStateConverter))] + public struct ProvisioningState : System.IEquatable + { + private ProvisioningState(string underlyingValue) + { + UnderlyingValue=underlyingValue; + } + + /// + /// Provisioning state failed. + /// + public static readonly ProvisioningState Failed = "Failed"; + + /// + /// Provisioning state in progress. + /// + public static readonly ProvisioningState InProgress = "InProgress"; + + /// + /// Provisioning state succeeded. + /// + public static readonly ProvisioningState Succeeded = "Succeeded"; + + + /// + /// Underlying value of enum ProvisioningState + /// + private readonly string UnderlyingValue; + + /// + /// Returns string representation for ProvisioningState + /// + public override string ToString() + { + return UnderlyingValue == null ? null : UnderlyingValue.ToString(); + } + + /// + /// Compares enums of type ProvisioningState + /// + public bool Equals(ProvisioningState e) + { + return UnderlyingValue.Equals(e.UnderlyingValue); + } + + /// + /// Implicit operator to convert string to ProvisioningState + /// + public static implicit operator ProvisioningState(string value) + { + return new ProvisioningState(value); + } + + /// + /// Implicit operator to convert ProvisioningState to string + /// + public static implicit operator string(ProvisioningState e) + { + return e.UnderlyingValue; + } + + /// + /// Overriding == operator for enum ProvisioningState + /// + public static bool operator == (ProvisioningState e1, ProvisioningState e2) + { + return e2.Equals(e1); + } + + /// + /// Overriding != operator for enum ProvisioningState + /// + public static bool operator != (ProvisioningState e1, ProvisioningState e2) + { + return !e2.Equals(e1); + } + + /// + /// Overrides Equals operator for ProvisioningState + /// + public override bool Equals(object obj) + { + return obj is ProvisioningState && Equals((ProvisioningState)obj); + } + + /// + /// Returns for hashCode ProvisioningState + /// + public override int GetHashCode() + { + return UnderlyingValue.GetHashCode(); + } + + } +} diff --git a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/ProvisioningStateConverter.cs b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/ProvisioningStateConverter.cs new file mode 100644 index 000000000000..a52c4a89848f --- /dev/null +++ b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/ProvisioningStateConverter.cs @@ -0,0 +1,53 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Media.Models +{ + using Newtonsoft.Json; + + using System.Reflection; + + /// + /// Defines values for ProvisioningState. + /// + public sealed class ProvisioningStateConverter : JsonConverter + { + + /// + /// Returns if objectType can be converted to ProvisioningState by the + /// converter. + /// + public override bool CanConvert(System.Type objectType) + { + return typeof(ProvisioningState).GetTypeInfo().IsAssignableFrom(objectType.GetTypeInfo()); + } + + /// + /// Overrides ReadJson and converts token to ProvisioningState. + /// + public override object ReadJson(JsonReader reader, System.Type objectType, object existingValue, JsonSerializer serializer) + { + if (reader.TokenType == Newtonsoft.Json.JsonToken.Null) + { + return null; + } + return (ProvisioningState)serializer.Deserialize(reader); + } + + /// + /// Overriding WriteJson for ProvisioningState for serialization. + /// + public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer) + { + writer.WriteValue(value.ToString()); + } + + } +} diff --git a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/StreamOptionsFlag.cs b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/StreamOptionsFlag.cs index 7eecc3a36a95..8f66d45c8e66 100644 --- a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/StreamOptionsFlag.cs +++ b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/StreamOptionsFlag.cs @@ -34,11 +34,19 @@ private StreamOptionsFlag(string underlyingValue) /// /// The live event provides lower end to end latency by reducing its - /// internal buffers. This could result in more client buffering during - /// playback if network bandwidth is low. + /// internal buffers. /// public static readonly StreamOptionsFlag LowLatency = "LowLatency"; + /// + /// The live event is optimized for end to end latency. This option is + /// only available for encoding live events with RTMP input. The + /// outputs can be streamed using HLS or DASH formats. The outputs' + /// archive or DVR rewind length is limited to 6 hours. Use + /// "LowLatency" stream option for all other scenarios. + /// + public static readonly StreamOptionsFlag LowLatencyV2 = "LowLatencyV2"; + /// /// Underlying value of enum StreamOptionsFlag diff --git a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/StreamingEndpoint.cs b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/StreamingEndpoint.cs index 618d0b96397f..823c850576b0 100644 --- a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/StreamingEndpoint.cs +++ b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/StreamingEndpoint.cs @@ -73,7 +73,8 @@ public StreamingEndpoint() /// was last modified. /// The system metadata relating to this /// resource. - public StreamingEndpoint(string location, int scaleUnits, string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), string description = default(string), string availabilitySetName = default(string), StreamingEndpointAccessControl accessControl = default(StreamingEndpointAccessControl), long? maxCacheAge = default(long?), IList customHostNames = default(IList), string hostName = default(string), bool? cdnEnabled = default(bool?), string cdnProvider = default(string), string cdnProfile = default(string), string provisioningState = default(string), StreamingEndpointResourceState? resourceState = default(StreamingEndpointResourceState?), CrossSiteAccessPolicies crossSiteAccessPolicies = default(CrossSiteAccessPolicies), System.DateTime? freeTrialEndTime = default(System.DateTime?), System.DateTime? created = default(System.DateTime?), System.DateTime? lastModified = default(System.DateTime?), SystemData systemData = default(SystemData)) + /// The streaming endpoint sku. + public StreamingEndpoint(string location, int scaleUnits, string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), string description = default(string), string availabilitySetName = default(string), StreamingEndpointAccessControl accessControl = default(StreamingEndpointAccessControl), long? maxCacheAge = default(long?), IList customHostNames = default(IList), string hostName = default(string), bool? cdnEnabled = default(bool?), string cdnProvider = default(string), string cdnProfile = default(string), string provisioningState = default(string), StreamingEndpointResourceState? resourceState = default(StreamingEndpointResourceState?), CrossSiteAccessPolicies crossSiteAccessPolicies = default(CrossSiteAccessPolicies), System.DateTime? freeTrialEndTime = default(System.DateTime?), System.DateTime? created = default(System.DateTime?), System.DateTime? lastModified = default(System.DateTime?), SystemData systemData = default(SystemData), ArmStreamingEndpointCurrentSku sku = default(ArmStreamingEndpointCurrentSku)) : base(location, id, name, type, tags) { Description = description; @@ -93,6 +94,7 @@ public StreamingEndpoint() Created = created; LastModified = lastModified; SystemData = systemData; + Sku = sku; CustomInit(); } @@ -208,6 +210,12 @@ public StreamingEndpoint() [JsonProperty(PropertyName = "systemData")] public SystemData SystemData { get; private set; } + /// + /// Gets or sets the streaming endpoint sku. + /// + [JsonProperty(PropertyName = "sku")] + public ArmStreamingEndpointCurrentSku Sku { get; set; } + /// /// Validate the object. /// diff --git a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/StreamingEndpointSkuInfoListResult.cs b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/StreamingEndpointSkuInfoListResult.cs new file mode 100644 index 000000000000..207765ce9f28 --- /dev/null +++ b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/StreamingEndpointSkuInfoListResult.cs @@ -0,0 +1,53 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Media.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + public partial class StreamingEndpointSkuInfoListResult + { + /// + /// Initializes a new instance of the + /// StreamingEndpointSkuInfoListResult class. + /// + public StreamingEndpointSkuInfoListResult() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// StreamingEndpointSkuInfoListResult class. + /// + /// The result of the List StreamingEndpoint + /// skus. + public StreamingEndpointSkuInfoListResult(IList value = default(IList)) + { + Value = value; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the result of the List StreamingEndpoint skus. + /// + [JsonProperty(PropertyName = "value")] + public IList Value { get; set; } + + } +} diff --git a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/TextTrack.cs b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/TextTrack.cs new file mode 100644 index 000000000000..230c4e4af654 --- /dev/null +++ b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/TextTrack.cs @@ -0,0 +1,101 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Media.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Represents a text track in an asset. A text track is usually used for + /// sparse data related to the audio or video tracks. + /// + [Newtonsoft.Json.JsonObject("#Microsoft.Media.TextTrack")] + public partial class TextTrack : TrackBase + { + /// + /// Initializes a new instance of the TextTrack class. + /// + public TextTrack() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the TextTrack class. + /// + /// The file name to the source file. This file + /// is located in the storage container of the asset. + /// The display name of the text track on a + /// video player. In HLS, this maps to the NAME attribute of + /// EXT-X-MEDIA. + /// The RFC5646 language code for the text + /// track. + /// When PlayerVisibility is set to + /// "Visible", the text track will be present in the DASH manifest or + /// HLS playlist when requested by a client. When the PlayerVisibility + /// is set to "Hidden", the text will not be available to the client. + /// The default value is "Visible". Possible values include: 'Hidden', + /// 'Visible' + /// The HLS specific setting for the text + /// track. + public TextTrack(string fileName = default(string), string displayName = default(string), string languageCode = default(string), Visibility? playerVisibility = default(Visibility?), HlsSettings hlsSettings = default(HlsSettings)) + { + FileName = fileName; + DisplayName = displayName; + LanguageCode = languageCode; + PlayerVisibility = playerVisibility; + HlsSettings = hlsSettings; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the file name to the source file. This file is located + /// in the storage container of the asset. + /// + [JsonProperty(PropertyName = "fileName")] + public string FileName { get; set; } + + /// + /// Gets or sets the display name of the text track on a video player. + /// In HLS, this maps to the NAME attribute of EXT-X-MEDIA. + /// + [JsonProperty(PropertyName = "displayName")] + public string DisplayName { get; set; } + + /// + /// Gets the RFC5646 language code for the text track. + /// + [JsonProperty(PropertyName = "languageCode")] + public string LanguageCode { get; private set; } + + /// + /// Gets or sets when PlayerVisibility is set to "Visible", the text + /// track will be present in the DASH manifest or HLS playlist when + /// requested by a client. When the PlayerVisibility is set to + /// "Hidden", the text will not be available to the client. The default + /// value is "Visible". Possible values include: 'Hidden', 'Visible' + /// + [JsonProperty(PropertyName = "playerVisibility")] + public Visibility? PlayerVisibility { get; set; } + + /// + /// Gets or sets the HLS specific setting for the text track. + /// + [JsonProperty(PropertyName = "hlsSettings")] + public HlsSettings HlsSettings { get; set; } + + } +} diff --git a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/TrackBase.cs b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/TrackBase.cs new file mode 100644 index 000000000000..ca63e482e208 --- /dev/null +++ b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/TrackBase.cs @@ -0,0 +1,36 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Media.Models +{ + using System.Linq; + + /// + /// Base type for concrete track types. A derived type must be used to + /// represent the Track. + /// + public partial class TrackBase + { + /// + /// Initializes a new instance of the TrackBase class. + /// + public TrackBase() + { + CustomInit(); + } + + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + } +} diff --git a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/TracksCreateOrUpdateHeaders.cs b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/TracksCreateOrUpdateHeaders.cs new file mode 100644 index 000000000000..e83b0d881755 --- /dev/null +++ b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/TracksCreateOrUpdateHeaders.cs @@ -0,0 +1,73 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Media.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Defines headers for CreateOrUpdate operation. + /// + public partial class TracksCreateOrUpdateHeaders + { + /// + /// Initializes a new instance of the TracksCreateOrUpdateHeaders + /// class. + /// + public TracksCreateOrUpdateHeaders() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the TracksCreateOrUpdateHeaders + /// class. + /// + /// The recommended number of seconds to wait + /// before calling the URI specified in Azure-AsyncOperation. + /// The URI to poll for completion + /// status. + /// The URI to poll for completion + /// status. + public TracksCreateOrUpdateHeaders(int? retryAfter = default(int?), string location = default(string), string azureAsyncOperation = default(string)) + { + RetryAfter = retryAfter; + Location = location; + AzureAsyncOperation = azureAsyncOperation; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the recommended number of seconds to wait before + /// calling the URI specified in Azure-AsyncOperation. + /// + [JsonProperty(PropertyName = "Retry-After")] + public int? RetryAfter { get; set; } + + /// + /// Gets or sets the URI to poll for completion status. + /// + [JsonProperty(PropertyName = "Location")] + public string Location { get; set; } + + /// + /// Gets or sets the URI to poll for completion status. + /// + [JsonProperty(PropertyName = "Azure-AsyncOperation")] + public string AzureAsyncOperation { get; set; } + + } +} diff --git a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/TracksDeleteHeaders.cs b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/TracksDeleteHeaders.cs new file mode 100644 index 000000000000..e80ff7c961ba --- /dev/null +++ b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/TracksDeleteHeaders.cs @@ -0,0 +1,71 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Media.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Defines headers for Delete operation. + /// + public partial class TracksDeleteHeaders + { + /// + /// Initializes a new instance of the TracksDeleteHeaders class. + /// + public TracksDeleteHeaders() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the TracksDeleteHeaders class. + /// + /// The recommended number of seconds to wait + /// before calling the URI specified in Azure-AsyncOperation. + /// The URI to poll for completion + /// status. + /// The URI to poll for completion + /// status. + public TracksDeleteHeaders(int? retryAfter = default(int?), string location = default(string), string azureAsyncOperation = default(string)) + { + RetryAfter = retryAfter; + Location = location; + AzureAsyncOperation = azureAsyncOperation; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the recommended number of seconds to wait before + /// calling the URI specified in Azure-AsyncOperation. + /// + [JsonProperty(PropertyName = "Retry-After")] + public int? RetryAfter { get; set; } + + /// + /// Gets or sets the URI to poll for completion status. + /// + [JsonProperty(PropertyName = "Location")] + public string Location { get; set; } + + /// + /// Gets or sets the URI to poll for completion status. + /// + [JsonProperty(PropertyName = "Azure-AsyncOperation")] + public string AzureAsyncOperation { get; set; } + + } +} diff --git a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/TracksUpdateHeaders.cs b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/TracksUpdateHeaders.cs new file mode 100644 index 000000000000..265905ff6d34 --- /dev/null +++ b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/TracksUpdateHeaders.cs @@ -0,0 +1,71 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Media.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Defines headers for Update operation. + /// + public partial class TracksUpdateHeaders + { + /// + /// Initializes a new instance of the TracksUpdateHeaders class. + /// + public TracksUpdateHeaders() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the TracksUpdateHeaders class. + /// + /// The recommended number of seconds to wait + /// before calling the URI specified in Azure-AsyncOperation. + /// The URI to poll for completion + /// status. + /// The URI to poll for completion + /// status. + public TracksUpdateHeaders(int? retryAfter = default(int?), string location = default(string), string azureAsyncOperation = default(string)) + { + RetryAfter = retryAfter; + Location = location; + AzureAsyncOperation = azureAsyncOperation; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the recommended number of seconds to wait before + /// calling the URI specified in Azure-AsyncOperation. + /// + [JsonProperty(PropertyName = "Retry-After")] + public int? RetryAfter { get; set; } + + /// + /// Gets or sets the URI to poll for completion status. + /// + [JsonProperty(PropertyName = "Location")] + public string Location { get; set; } + + /// + /// Gets or sets the URI to poll for completion status. + /// + [JsonProperty(PropertyName = "Azure-AsyncOperation")] + public string AzureAsyncOperation { get; set; } + + } +} diff --git a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/TracksUpdateTrackDataHeaders.cs b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/TracksUpdateTrackDataHeaders.cs new file mode 100644 index 000000000000..cbd8082a9c50 --- /dev/null +++ b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/TracksUpdateTrackDataHeaders.cs @@ -0,0 +1,73 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Media.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Defines headers for UpdateTrackData operation. + /// + public partial class TracksUpdateTrackDataHeaders + { + /// + /// Initializes a new instance of the TracksUpdateTrackDataHeaders + /// class. + /// + public TracksUpdateTrackDataHeaders() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the TracksUpdateTrackDataHeaders + /// class. + /// + /// The recommended number of seconds to wait + /// before calling the URI specified in Azure-AsyncOperation. + /// The URI to poll for completion + /// status. + /// The URI to poll for completion + /// status. + public TracksUpdateTrackDataHeaders(int? retryAfter = default(int?), string location = default(string), string azureAsyncOperation = default(string)) + { + RetryAfter = retryAfter; + Location = location; + AzureAsyncOperation = azureAsyncOperation; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the recommended number of seconds to wait before + /// calling the URI specified in Azure-AsyncOperation. + /// + [JsonProperty(PropertyName = "Retry-After")] + public int? RetryAfter { get; set; } + + /// + /// Gets or sets the URI to poll for completion status. + /// + [JsonProperty(PropertyName = "Location")] + public string Location { get; set; } + + /// + /// Gets or sets the URI to poll for completion status. + /// + [JsonProperty(PropertyName = "Azure-AsyncOperation")] + public string AzureAsyncOperation { get; set; } + + } +} diff --git a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/VideoLayer.cs b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/VideoLayer.cs index 74c5c4082b7c..58bdd630dcd1 100644 --- a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/VideoLayer.cs +++ b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/VideoLayer.cs @@ -17,7 +17,6 @@ namespace Microsoft.Azure.Management.Media.Models /// Describes the settings to be used when encoding the input video into a /// desired output bitrate layer. /// - [Newtonsoft.Json.JsonObject("#Microsoft.Media.VideoLayer")] public partial class VideoLayer : Layer { /// diff --git a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/VideoTrack.cs b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/VideoTrack.cs new file mode 100644 index 000000000000..0299dedb0dd0 --- /dev/null +++ b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/VideoTrack.cs @@ -0,0 +1,37 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Media.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Represents a video track in the asset. + /// + [Newtonsoft.Json.JsonObject("#Microsoft.Media.VideoTrack")] + public partial class VideoTrack : TrackBase + { + /// + /// Initializes a new instance of the VideoTrack class. + /// + public VideoTrack() + { + CustomInit(); + } + + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + } +} diff --git a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/Visibility.cs b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/Visibility.cs new file mode 100644 index 000000000000..353e67d31e3f --- /dev/null +++ b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/Visibility.cs @@ -0,0 +1,111 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Media.Models +{ + using Newtonsoft.Json; + + /// + /// Defines values for Visibility. + /// + /// + /// Determine base value for a given allowed value if exists, else return + /// the value itself + /// + [JsonConverter(typeof(VisibilityConverter))] + public struct Visibility : System.IEquatable + { + private Visibility(string underlyingValue) + { + UnderlyingValue=underlyingValue; + } + + /// + /// The track is hidden to video player. + /// + public static readonly Visibility Hidden = "Hidden"; + + /// + /// The track is visible to video player. + /// + public static readonly Visibility Visible = "Visible"; + + + /// + /// Underlying value of enum Visibility + /// + private readonly string UnderlyingValue; + + /// + /// Returns string representation for Visibility + /// + public override string ToString() + { + return UnderlyingValue == null ? null : UnderlyingValue.ToString(); + } + + /// + /// Compares enums of type Visibility + /// + public bool Equals(Visibility e) + { + return UnderlyingValue.Equals(e.UnderlyingValue); + } + + /// + /// Implicit operator to convert string to Visibility + /// + public static implicit operator Visibility(string value) + { + return new Visibility(value); + } + + /// + /// Implicit operator to convert Visibility to string + /// + public static implicit operator string(Visibility e) + { + return e.UnderlyingValue; + } + + /// + /// Overriding == operator for enum Visibility + /// + public static bool operator == (Visibility e1, Visibility e2) + { + return e2.Equals(e1); + } + + /// + /// Overriding != operator for enum Visibility + /// + public static bool operator != (Visibility e1, Visibility e2) + { + return !e2.Equals(e1); + } + + /// + /// Overrides Equals operator for Visibility + /// + public override bool Equals(object obj) + { + return obj is Visibility && Equals((Visibility)obj); + } + + /// + /// Returns for hashCode Visibility + /// + public override int GetHashCode() + { + return UnderlyingValue.GetHashCode(); + } + + } +} diff --git a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/VisibilityConverter.cs b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/VisibilityConverter.cs new file mode 100644 index 000000000000..16fb7b7f83f7 --- /dev/null +++ b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/VisibilityConverter.cs @@ -0,0 +1,53 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Media.Models +{ + using Newtonsoft.Json; + + using System.Reflection; + + /// + /// Defines values for Visibility. + /// + public sealed class VisibilityConverter : JsonConverter + { + + /// + /// Returns if objectType can be converted to Visibility by the + /// converter. + /// + public override bool CanConvert(System.Type objectType) + { + return typeof(Visibility).GetTypeInfo().IsAssignableFrom(objectType.GetTypeInfo()); + } + + /// + /// Overrides ReadJson and converts token to Visibility. + /// + public override object ReadJson(JsonReader reader, System.Type objectType, object existingValue, JsonSerializer serializer) + { + if (reader.TokenType == Newtonsoft.Json.JsonToken.Null) + { + return null; + } + return (Visibility)serializer.Deserialize(reader); + } + + /// + /// Overriding WriteJson for Visibility for serialization. + /// + public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer) + { + writer.WriteValue(value.ToString()); + } + + } +} diff --git a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/OperationResultsOperations.cs b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/OperationResultsOperations.cs new file mode 100644 index 000000000000..e411043d08bf --- /dev/null +++ b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/OperationResultsOperations.cs @@ -0,0 +1,288 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Media +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + using System.Net; + using System.Net.Http; + using System.Threading; + using System.Threading.Tasks; + + /// + /// OperationResultsOperations operations. + /// + internal partial class OperationResultsOperations : IServiceOperations, IOperationResultsOperations + { + /// + /// Initializes a new instance of the OperationResultsOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal OperationResultsOperations(AzureMediaServicesClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the AzureMediaServicesClient + /// + public AzureMediaServicesClient Client { get; private set; } + + /// + /// Get operation result. + /// + /// + /// Get asset track operation result. + /// + /// + /// The name of the resource group within the Azure subscription. + /// + /// + /// The Media Services account name. + /// + /// + /// The Asset name. + /// + /// + /// The Asset Track name. + /// + /// + /// Operation Id. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string accountName, string assetName, string trackName, string operationId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (accountName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "accountName"); + } + if (assetName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "assetName"); + } + if (trackName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "trackName"); + } + if (operationId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "operationId"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("accountName", accountName); + tracingParameters.Add("assetName", assetName); + tracingParameters.Add("trackName", trackName); + tracingParameters.Add("operationId", operationId); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaServices/{accountName}/assets/{assetName}/tracks/{trackName}/operationResults/{operationId}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); + _url = _url.Replace("{assetName}", System.Uri.EscapeDataString(assetName)); + _url = _url.Replace("{trackName}", System.Uri.EscapeDataString(trackName)); + _url = _url.Replace("{operationId}", System.Uri.EscapeDataString(operationId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 204) + { + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + try + { + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(JsonSerializer.Create(Client.DeserializationSettings)); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + } +} diff --git a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/OperationResultsOperationsExtensions.cs b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/OperationResultsOperationsExtensions.cs new file mode 100644 index 000000000000..7aa150ae272b --- /dev/null +++ b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/OperationResultsOperationsExtensions.cs @@ -0,0 +1,89 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Media +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for OperationResultsOperations. + /// + public static partial class OperationResultsOperationsExtensions + { + /// + /// Get operation result. + /// + /// + /// Get asset track operation result. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group within the Azure subscription. + /// + /// + /// The Media Services account name. + /// + /// + /// The Asset name. + /// + /// + /// The Asset Track name. + /// + /// + /// Operation Id. + /// + public static AssetTrack Get(this IOperationResultsOperations operations, string resourceGroupName, string accountName, string assetName, string trackName, string operationId) + { + return operations.GetAsync(resourceGroupName, accountName, assetName, trackName, operationId).GetAwaiter().GetResult(); + } + + /// + /// Get operation result. + /// + /// + /// Get asset track operation result. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group within the Azure subscription. + /// + /// + /// The Media Services account name. + /// + /// + /// The Asset name. + /// + /// + /// The Asset Track name. + /// + /// + /// Operation Id. + /// + /// + /// The cancellation token. + /// + public static async Task GetAsync(this IOperationResultsOperations operations, string resourceGroupName, string accountName, string assetName, string trackName, string operationId, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, accountName, assetName, trackName, operationId, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +} diff --git a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/OperationStatusesOperations.cs b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/OperationStatusesOperations.cs new file mode 100644 index 000000000000..e2c97bb898a1 --- /dev/null +++ b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/OperationStatusesOperations.cs @@ -0,0 +1,275 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Media +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + using System.Net; + using System.Net.Http; + using System.Threading; + using System.Threading.Tasks; + + /// + /// OperationStatusesOperations operations. + /// + internal partial class OperationStatusesOperations : IServiceOperations, IOperationStatusesOperations + { + /// + /// Initializes a new instance of the OperationStatusesOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal OperationStatusesOperations(AzureMediaServicesClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the AzureMediaServicesClient + /// + public AzureMediaServicesClient Client { get; private set; } + + /// + /// Get operation status. + /// + /// + /// Get asset track operation status. + /// + /// + /// The name of the resource group within the Azure subscription. + /// + /// + /// The Media Services account name. + /// + /// + /// The Asset name. + /// + /// + /// The Asset Track name. + /// + /// + /// Operation Id. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string accountName, string assetName, string trackName, string operationId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (accountName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "accountName"); + } + if (assetName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "assetName"); + } + if (trackName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "trackName"); + } + if (operationId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "operationId"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("accountName", accountName); + tracingParameters.Add("assetName", assetName); + tracingParameters.Add("trackName", trackName); + tracingParameters.Add("operationId", operationId); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaServices/{accountName}/assets/{assetName}/tracks/{trackName}/operationStatuses/{operationId}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); + _url = _url.Replace("{assetName}", System.Uri.EscapeDataString(assetName)); + _url = _url.Replace("{trackName}", System.Uri.EscapeDataString(trackName)); + _url = _url.Replace("{operationId}", System.Uri.EscapeDataString(operationId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + } +} diff --git a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/OperationStatusesOperationsExtensions.cs b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/OperationStatusesOperationsExtensions.cs new file mode 100644 index 000000000000..c52abc6287f1 --- /dev/null +++ b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/OperationStatusesOperationsExtensions.cs @@ -0,0 +1,89 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Media +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for OperationStatusesOperations. + /// + public static partial class OperationStatusesOperationsExtensions + { + /// + /// Get operation status. + /// + /// + /// Get asset track operation status. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group within the Azure subscription. + /// + /// + /// The Media Services account name. + /// + /// + /// The Asset name. + /// + /// + /// The Asset Track name. + /// + /// + /// Operation Id. + /// + public static AssetTrackOperationStatus Get(this IOperationStatusesOperations operations, string resourceGroupName, string accountName, string assetName, string trackName, string operationId) + { + return operations.GetAsync(resourceGroupName, accountName, assetName, trackName, operationId).GetAwaiter().GetResult(); + } + + /// + /// Get operation status. + /// + /// + /// Get asset track operation status. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group within the Azure subscription. + /// + /// + /// The Media Services account name. + /// + /// + /// The Asset name. + /// + /// + /// The Asset Track name. + /// + /// + /// Operation Id. + /// + /// + /// The cancellation token. + /// + public static async Task GetAsync(this IOperationStatusesOperations operations, string resourceGroupName, string accountName, string assetName, string trackName, string operationId, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, accountName, assetName, trackName, operationId, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +} diff --git a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/PrivateEndpointConnectionsOperations.cs b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/PrivateEndpointConnectionsOperations.cs index 030e96742075..84aaab371ef3 100644 --- a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/PrivateEndpointConnectionsOperations.cs +++ b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/PrivateEndpointConnectionsOperations.cs @@ -51,10 +51,10 @@ internal PrivateEndpointConnectionsOperations(AzureMediaServicesClient client) public AzureMediaServicesClient Client { get; private set; } /// - /// Get all private endpoint connections. + /// List private endpoint connections. /// /// - /// Get all private endpoint connections. + /// List all private endpoint connections. /// /// /// The name of the resource group within the Azure subscription. @@ -248,7 +248,7 @@ internal PrivateEndpointConnectionsOperations(AzureMediaServicesClient client) /// Get private endpoint connection. /// /// - /// Get private endpoint connection. + /// Get the details of a private endpoint connection. /// /// /// The name of the resource group within the Azure subscription. @@ -447,10 +447,10 @@ internal PrivateEndpointConnectionsOperations(AzureMediaServicesClient client) } /// - /// Update private endpoint connection. + /// Update a private endpoint connection. /// /// - /// Update private endpoint connection. + /// Update an existing private endpoint connection. /// /// /// The name of the resource group within the Azure subscription. @@ -667,10 +667,10 @@ internal PrivateEndpointConnectionsOperations(AzureMediaServicesClient client) } /// - /// Delete private endpoint connection. + /// Delete a private endpoint connection. /// /// - /// Delete private endpoint connection. + /// Deletes a private endpoint connection. /// /// /// The name of the resource group within the Azure subscription. diff --git a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/PrivateEndpointConnectionsOperationsExtensions.cs b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/PrivateEndpointConnectionsOperationsExtensions.cs index 146c0c6271d2..6a57111e922c 100644 --- a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/PrivateEndpointConnectionsOperationsExtensions.cs +++ b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/PrivateEndpointConnectionsOperationsExtensions.cs @@ -22,10 +22,10 @@ namespace Microsoft.Azure.Management.Media public static partial class PrivateEndpointConnectionsOperationsExtensions { /// - /// Get all private endpoint connections. + /// List private endpoint connections. /// /// - /// Get all private endpoint connections. + /// List all private endpoint connections. /// /// /// The operations group for this extension method. @@ -42,10 +42,10 @@ public static PrivateEndpointConnectionListResult List(this IPrivateEndpointConn } /// - /// Get all private endpoint connections. + /// List private endpoint connections. /// /// - /// Get all private endpoint connections. + /// List all private endpoint connections. /// /// /// The operations group for this extension method. @@ -71,7 +71,7 @@ public static PrivateEndpointConnectionListResult List(this IPrivateEndpointConn /// Get private endpoint connection. /// /// - /// Get private endpoint connection. + /// Get the details of a private endpoint connection. /// /// /// The operations group for this extension method. @@ -93,7 +93,7 @@ public static PrivateEndpointConnection Get(this IPrivateEndpointConnectionsOper /// Get private endpoint connection. /// /// - /// Get private endpoint connection. + /// Get the details of a private endpoint connection. /// /// /// The operations group for this extension method. @@ -118,10 +118,10 @@ public static PrivateEndpointConnection Get(this IPrivateEndpointConnectionsOper } /// - /// Update private endpoint connection. + /// Update a private endpoint connection. /// /// - /// Update private endpoint connection. + /// Update an existing private endpoint connection. /// /// /// The operations group for this extension method. @@ -143,10 +143,10 @@ public static PrivateEndpointConnection CreateOrUpdate(this IPrivateEndpointConn } /// - /// Update private endpoint connection. + /// Update a private endpoint connection. /// /// - /// Update private endpoint connection. + /// Update an existing private endpoint connection. /// /// /// The operations group for this extension method. @@ -174,10 +174,10 @@ public static PrivateEndpointConnection CreateOrUpdate(this IPrivateEndpointConn } /// - /// Delete private endpoint connection. + /// Delete a private endpoint connection. /// /// - /// Delete private endpoint connection. + /// Deletes a private endpoint connection. /// /// /// The operations group for this extension method. @@ -196,10 +196,10 @@ public static void Delete(this IPrivateEndpointConnectionsOperations operations, } /// - /// Delete private endpoint connection. + /// Delete a private endpoint connection. /// /// - /// Delete private endpoint connection. + /// Deletes a private endpoint connection. /// /// /// The operations group for this extension method. diff --git a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/PrivateLinkResourcesOperations.cs b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/PrivateLinkResourcesOperations.cs index 9367cddb4e6a..aa0d9f44721d 100644 --- a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/PrivateLinkResourcesOperations.cs +++ b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/PrivateLinkResourcesOperations.cs @@ -54,7 +54,7 @@ internal PrivateLinkResourcesOperations(AzureMediaServicesClient client) /// Get list of group IDs. /// /// - /// Get list of group IDs. + /// List supported group IDs. /// /// /// The name of the resource group within the Azure subscription. @@ -248,7 +248,7 @@ internal PrivateLinkResourcesOperations(AzureMediaServicesClient client) /// Get group ID. /// /// - /// Get group ID. + /// Get details of a group ID. /// /// /// The name of the resource group within the Azure subscription. diff --git a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/PrivateLinkResourcesOperationsExtensions.cs b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/PrivateLinkResourcesOperationsExtensions.cs index c96dc86af35e..64a9542b516e 100644 --- a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/PrivateLinkResourcesOperationsExtensions.cs +++ b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/PrivateLinkResourcesOperationsExtensions.cs @@ -25,7 +25,7 @@ public static partial class PrivateLinkResourcesOperationsExtensions /// Get list of group IDs. /// /// - /// Get list of group IDs. + /// List supported group IDs. /// /// /// The operations group for this extension method. @@ -45,7 +45,7 @@ public static PrivateLinkResourceListResult List(this IPrivateLinkResourcesOpera /// Get list of group IDs. /// /// - /// Get list of group IDs. + /// List supported group IDs. /// /// /// The operations group for this extension method. @@ -71,7 +71,7 @@ public static PrivateLinkResourceListResult List(this IPrivateLinkResourcesOpera /// Get group ID. /// /// - /// Get group ID. + /// Get details of a group ID. /// /// /// The operations group for this extension method. @@ -93,7 +93,7 @@ public static PrivateLinkResource Get(this IPrivateLinkResourcesOperations opera /// Get group ID. /// /// - /// Get group ID. + /// Get details of a group ID. /// /// /// The operations group for this extension method. diff --git a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/SdkInfo_AzureMediaServices.cs b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/SdkInfo_AzureMediaServices.cs index b83a855a1ed5..b16df5ed9e87 100644 --- a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/SdkInfo_AzureMediaServices.cs +++ b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/SdkInfo_AzureMediaServices.cs @@ -19,35 +19,29 @@ public static IEnumerable> ApiInfo_AzureMediaServi { return new Tuple[] { - new Tuple("Media", "AccountFilters", "2021-06-01"), - new Tuple("Media", "AssetFilters", "2021-06-01"), - new Tuple("Media", "Assets", "2021-06-01"), - new Tuple("Media", "ContentKeyPolicies", "2021-06-01"), - new Tuple("Media", "Jobs", "2021-06-01"), - new Tuple("Media", "LiveEvents", "2021-06-01"), - new Tuple("Media", "LiveOutputs", "2021-06-01"), - new Tuple("Media", "Locations", "2021-06-01"), - new Tuple("Media", "Mediaservices", "2021-06-01"), - new Tuple("Media", "Operations", "2021-06-01"), - new Tuple("Media", "PrivateEndpointConnections", "2021-06-01"), - new Tuple("Media", "PrivateLinkResources", "2021-06-01"), - new Tuple("Media", "StreamingEndpoints", "2021-06-01"), - new Tuple("Media", "StreamingLocators", "2021-06-01"), - new Tuple("Media", "StreamingPolicies", "2021-06-01"), - new Tuple("Media", "Transforms", "2021-06-01"), + new Tuple("Media", "AccountFilters", "2021-11-01"), + new Tuple("Media", "AssetFilters", "2021-11-01"), + new Tuple("Media", "Assets", "2021-11-01"), + new Tuple("Media", "ContentKeyPolicies", "2021-11-01"), + new Tuple("Media", "Jobs", "2021-11-01"), + new Tuple("Media", "LiveEvents", "2021-11-01"), + new Tuple("Media", "LiveOutputs", "2021-11-01"), + new Tuple("Media", "Locations", "2021-11-01"), + new Tuple("Media", "MediaServiceOperationResults", "2021-11-01"), + new Tuple("Media", "MediaServiceOperationStatuses", "2021-11-01"), + new Tuple("Media", "Mediaservices", "2021-11-01"), + new Tuple("Media", "OperationResults", "2021-11-01"), + new Tuple("Media", "OperationStatuses", "2021-11-01"), + new Tuple("Media", "Operations", "2021-11-01"), + new Tuple("Media", "PrivateEndpointConnections", "2021-11-01"), + new Tuple("Media", "PrivateLinkResources", "2021-11-01"), + new Tuple("Media", "StreamingEndpoints", "2021-11-01"), + new Tuple("Media", "StreamingLocators", "2021-11-01"), + new Tuple("Media", "StreamingPolicies", "2021-11-01"), + new Tuple("Media", "Tracks", "2021-11-01"), + new Tuple("Media", "Transforms", "2021-11-01"), }.AsEnumerable(); } } - // BEGIN: Code Generation Metadata Section - public static readonly String AutoRestVersion = "v2"; - public static readonly String AutoRestBootStrapperVersion = "autorest@1.9.1"; - public static readonly String AutoRestCmdExecuted = "cmd.exe /c autorest.cmd https://github.com/Azure/azure-rest-api-specs/blob/master/specification/mediaservices/resource-manager/readme.md --csharp --version=v2 --reflect-api-versions --opt-in-extensible-enums --tag=package-2021-06 --csharp-sdks-folder=D:\\GitHub\\Azure\\azure-sdk-for-net\\sdk"; - public static readonly String GithubForkName = "Azure"; - public static readonly String GithubBranchName = "master"; - public static readonly String GithubCommidId = "c2ec03e5faa411e9a6785c15c3ddbd812e67ba7b"; - public static readonly String CodeGenerationErrors = ""; - public static readonly String GithubRepoName = "azure-rest-api-specs"; - // END: Code Generation Metadata Section } } - diff --git a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/StreamingEndpointsOperations.cs b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/StreamingEndpointsOperations.cs index c31aa3fe594a..42dbf6fcba6d 100644 --- a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/StreamingEndpointsOperations.cs +++ b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/StreamingEndpointsOperations.cs @@ -556,6 +556,224 @@ internal StreamingEndpointsOperations(AzureMediaServicesClient client) return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } + /// + /// List StreamingEndpoint skus + /// + /// + /// List streaming endpoint supported skus. + /// + /// + /// The name of the resource group within the Azure subscription. + /// + /// + /// The Media Services account name. + /// + /// + /// The name of the streaming endpoint, maximum length is 24. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> SkusWithHttpMessagesAsync(string resourceGroupName, string accountName, string streamingEndpointName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (accountName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "accountName"); + } + if (streamingEndpointName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "streamingEndpointName"); + } + if (streamingEndpointName != null) + { + if (streamingEndpointName.Length > 24) + { + throw new ValidationException(ValidationRules.MaxLength, "streamingEndpointName", 24); + } + if (streamingEndpointName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "streamingEndpointName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(streamingEndpointName, "^[a-zA-Z0-9]+(-*[a-zA-Z0-9])*$")) + { + throw new ValidationException(ValidationRules.Pattern, "streamingEndpointName", "^[a-zA-Z0-9]+(-*[a-zA-Z0-9])*$"); + } + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("accountName", accountName); + tracingParameters.Add("streamingEndpointName", streamingEndpointName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "Skus", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaservices/{accountName}/streamingEndpoints/{streamingEndpointName}/skus").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); + _url = _url.Replace("{streamingEndpointName}", System.Uri.EscapeDataString(streamingEndpointName)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + /// /// Start StreamingEndpoint /// diff --git a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/StreamingEndpointsOperationsExtensions.cs b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/StreamingEndpointsOperationsExtensions.cs index 07846cdc16aa..4dd6db53d7f1 100644 --- a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/StreamingEndpointsOperationsExtensions.cs +++ b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/StreamingEndpointsOperationsExtensions.cs @@ -292,6 +292,58 @@ public static void Delete(this IStreamingEndpointsOperations operations, string (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, accountName, streamingEndpointName, null, cancellationToken).ConfigureAwait(false)).Dispose(); } + /// + /// List StreamingEndpoint skus + /// + /// + /// List streaming endpoint supported skus. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group within the Azure subscription. + /// + /// + /// The Media Services account name. + /// + /// + /// The name of the streaming endpoint, maximum length is 24. + /// + public static StreamingEndpointSkuInfoListResult Skus(this IStreamingEndpointsOperations operations, string resourceGroupName, string accountName, string streamingEndpointName) + { + return operations.SkusAsync(resourceGroupName, accountName, streamingEndpointName).GetAwaiter().GetResult(); + } + + /// + /// List StreamingEndpoint skus + /// + /// + /// List streaming endpoint supported skus. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group within the Azure subscription. + /// + /// + /// The Media Services account name. + /// + /// + /// The name of the streaming endpoint, maximum length is 24. + /// + /// + /// The cancellation token. + /// + public static async Task SkusAsync(this IStreamingEndpointsOperations operations, string resourceGroupName, string accountName, string streamingEndpointName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.SkusWithHttpMessagesAsync(resourceGroupName, accountName, streamingEndpointName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// /// Start StreamingEndpoint /// diff --git a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/TracksOperations.cs b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/TracksOperations.cs new file mode 100644 index 000000000000..36299b7f11fd --- /dev/null +++ b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/TracksOperations.cs @@ -0,0 +1,1515 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Media +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + using System.Net; + using System.Net.Http; + using System.Threading; + using System.Threading.Tasks; + + /// + /// TracksOperations operations. + /// + internal partial class TracksOperations : IServiceOperations, ITracksOperations + { + /// + /// Initializes a new instance of the TracksOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal TracksOperations(AzureMediaServicesClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the AzureMediaServicesClient + /// + public AzureMediaServicesClient Client { get; private set; } + + /// + /// List Tracks in the Asset + /// + /// + /// Lists the Tracks in the asset + /// + /// + /// The name of the resource group within the Azure subscription. + /// + /// + /// The Media Services account name. + /// + /// + /// The Asset name. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task>> ListWithHttpMessagesAsync(string resourceGroupName, string accountName, string assetName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (accountName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "accountName"); + } + if (assetName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "assetName"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("accountName", accountName); + tracingParameters.Add("assetName", assetName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaServices/{accountName}/assets/{assetName}/tracks").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); + _url = _url.Replace("{assetName}", System.Uri.EscapeDataString(assetName)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Get a Track + /// + /// + /// Get the details of a Track in the Asset + /// + /// + /// The name of the resource group within the Azure subscription. + /// + /// + /// The Media Services account name. + /// + /// + /// The Asset name. + /// + /// + /// The Asset Track name. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string accountName, string assetName, string trackName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (accountName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "accountName"); + } + if (assetName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "assetName"); + } + if (trackName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "trackName"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("accountName", accountName); + tracingParameters.Add("assetName", assetName); + tracingParameters.Add("trackName", trackName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaServices/{accountName}/assets/{assetName}/tracks/{trackName}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); + _url = _url.Replace("{assetName}", System.Uri.EscapeDataString(assetName)); + _url = _url.Replace("{trackName}", System.Uri.EscapeDataString(trackName)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Create or update a Track + /// + /// + /// Create or update a Track in the asset + /// + /// + /// The name of the resource group within the Azure subscription. + /// + /// + /// The Media Services account name. + /// + /// + /// The Asset name. + /// + /// + /// The Asset Track name. + /// + /// + /// Detailed information about a track in the asset. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string accountName, string assetName, string trackName, TrackBase track = default(TrackBase), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send Request + AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, accountName, assetName, trackName, track, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Delete a Track + /// + /// + /// Deletes a Track in the asset + /// + /// + /// The name of the resource group within the Azure subscription. + /// + /// + /// The Media Services account name. + /// + /// + /// The Asset name. + /// + /// + /// The Asset Track name. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task> DeleteWithHttpMessagesAsync(string resourceGroupName, string accountName, string assetName, string trackName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationHeaderResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, accountName, assetName, trackName, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Update an Track + /// + /// + /// Updates an existing Track in the asset + /// + /// + /// The name of the resource group within the Azure subscription. + /// + /// + /// The Media Services account name. + /// + /// + /// The Asset name. + /// + /// + /// The Asset Track name. + /// + /// + /// Detailed information about a track in the asset. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string accountName, string assetName, string trackName, TrackBase track = default(TrackBase), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send Request + AzureOperationResponse _response = await BeginUpdateWithHttpMessagesAsync(resourceGroupName, accountName, assetName, trackName, track, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Update the track data + /// + /// + /// Update the track data. Call this API after any changes are made to the + /// track data stored in the asset container. For example, you have modified + /// the WebVTT captions file in the Azure blob storage container for the asset, + /// viewers will not see the new version of the captions unless this API is + /// called. Note, the changes may not be reflected immediately. CDN cache may + /// also need to be purged if applicable. + /// + /// + /// The name of the resource group within the Azure subscription. + /// + /// + /// The Media Services account name. + /// + /// + /// The Asset name. + /// + /// + /// The Asset Track name. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task> UpdateTrackDataWithHttpMessagesAsync(string resourceGroupName, string accountName, string assetName, string trackName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationHeaderResponse _response = await BeginUpdateTrackDataWithHttpMessagesAsync(resourceGroupName, accountName, assetName, trackName, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Create or update a Track + /// + /// + /// Create or update a Track in the asset + /// + /// + /// The name of the resource group within the Azure subscription. + /// + /// + /// The Media Services account name. + /// + /// + /// The Asset name. + /// + /// + /// The Asset Track name. + /// + /// + /// Detailed information about a track in the asset. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string accountName, string assetName, string trackName, TrackBase track = default(TrackBase), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (accountName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "accountName"); + } + if (assetName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "assetName"); + } + if (trackName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "trackName"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + AssetTrack parameters = new AssetTrack(); + if (track != null) + { + parameters.Track = track; + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("accountName", accountName); + tracingParameters.Add("assetName", assetName); + tracingParameters.Add("trackName", trackName); + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaServices/{accountName}/assets/{assetName}/tracks/{trackName}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); + _url = _url.Replace("{assetName}", System.Uri.EscapeDataString(assetName)); + _url = _url.Replace("{trackName}", System.Uri.EscapeDataString(trackName)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + if(parameters != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 201) + { + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + // Deserialize Response + if ((int)_statusCode == 201) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + try + { + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(JsonSerializer.Create(Client.DeserializationSettings)); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Delete a Track + /// + /// + /// Deletes a Track in the asset + /// + /// + /// The name of the resource group within the Azure subscription. + /// + /// + /// The Media Services account name. + /// + /// + /// The Asset name. + /// + /// + /// The Asset Track name. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string accountName, string assetName, string trackName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (accountName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "accountName"); + } + if (assetName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "assetName"); + } + if (trackName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "trackName"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("accountName", accountName); + tracingParameters.Add("assetName", assetName); + tracingParameters.Add("trackName", trackName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaServices/{accountName}/assets/{assetName}/tracks/{trackName}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); + _url = _url.Replace("{assetName}", System.Uri.EscapeDataString(assetName)); + _url = _url.Replace("{trackName}", System.Uri.EscapeDataString(trackName)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("DELETE"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 202 && (int)_statusCode != 204) + { + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationHeaderResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + try + { + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(JsonSerializer.Create(Client.DeserializationSettings)); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Update an Track + /// + /// + /// Updates an existing Track in the asset + /// + /// + /// The name of the resource group within the Azure subscription. + /// + /// + /// The Media Services account name. + /// + /// + /// The Asset name. + /// + /// + /// The Asset Track name. + /// + /// + /// Detailed information about a track in the asset. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> BeginUpdateWithHttpMessagesAsync(string resourceGroupName, string accountName, string assetName, string trackName, TrackBase track = default(TrackBase), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (accountName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "accountName"); + } + if (assetName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "assetName"); + } + if (trackName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "trackName"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + AssetTrack parameters = new AssetTrack(); + if (track != null) + { + parameters.Track = track; + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("accountName", accountName); + tracingParameters.Add("assetName", assetName); + tracingParameters.Add("trackName", trackName); + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "BeginUpdate", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaServices/{accountName}/assets/{assetName}/tracks/{trackName}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); + _url = _url.Replace("{assetName}", System.Uri.EscapeDataString(assetName)); + _url = _url.Replace("{trackName}", System.Uri.EscapeDataString(trackName)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("PATCH"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + if(parameters != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 202) + { + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 202) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + try + { + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(JsonSerializer.Create(Client.DeserializationSettings)); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Update the track data + /// + /// + /// Update the track data. Call this API after any changes are made to the + /// track data stored in the asset container. For example, you have modified + /// the WebVTT captions file in the Azure blob storage container for the asset, + /// viewers will not see the new version of the captions unless this API is + /// called. Note, the changes may not be reflected immediately. CDN cache may + /// also need to be purged if applicable. + /// + /// + /// The name of the resource group within the Azure subscription. + /// + /// + /// The Media Services account name. + /// + /// + /// The Asset name. + /// + /// + /// The Asset Track name. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> BeginUpdateTrackDataWithHttpMessagesAsync(string resourceGroupName, string accountName, string assetName, string trackName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (accountName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "accountName"); + } + if (assetName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "assetName"); + } + if (trackName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "trackName"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("accountName", accountName); + tracingParameters.Add("assetName", assetName); + tracingParameters.Add("trackName", trackName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "BeginUpdateTrackData", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaServices/{accountName}/assets/{assetName}/tracks/{trackName}/updateTrackData").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); + _url = _url.Replace("{assetName}", System.Uri.EscapeDataString(assetName)); + _url = _url.Replace("{trackName}", System.Uri.EscapeDataString(trackName)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 202) + { + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationHeaderResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + try + { + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(JsonSerializer.Create(Client.DeserializationSettings)); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + } +} diff --git a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/TracksOperationsExtensions.cs b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/TracksOperationsExtensions.cs new file mode 100644 index 000000000000..06091006f7ca --- /dev/null +++ b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/TracksOperationsExtensions.cs @@ -0,0 +1,645 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Media +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for TracksOperations. + /// + public static partial class TracksOperationsExtensions + { + /// + /// List Tracks in the Asset + /// + /// + /// Lists the Tracks in the asset + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group within the Azure subscription. + /// + /// + /// The Media Services account name. + /// + /// + /// The Asset name. + /// + public static IEnumerable List(this ITracksOperations operations, string resourceGroupName, string accountName, string assetName) + { + return operations.ListAsync(resourceGroupName, accountName, assetName).GetAwaiter().GetResult(); + } + + /// + /// List Tracks in the Asset + /// + /// + /// Lists the Tracks in the asset + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group within the Azure subscription. + /// + /// + /// The Media Services account name. + /// + /// + /// The Asset name. + /// + /// + /// The cancellation token. + /// + public static async Task> ListAsync(this ITracksOperations operations, string resourceGroupName, string accountName, string assetName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, accountName, assetName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Get a Track + /// + /// + /// Get the details of a Track in the Asset + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group within the Azure subscription. + /// + /// + /// The Media Services account name. + /// + /// + /// The Asset name. + /// + /// + /// The Asset Track name. + /// + public static AssetTrack Get(this ITracksOperations operations, string resourceGroupName, string accountName, string assetName, string trackName) + { + return operations.GetAsync(resourceGroupName, accountName, assetName, trackName).GetAwaiter().GetResult(); + } + + /// + /// Get a Track + /// + /// + /// Get the details of a Track in the Asset + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group within the Azure subscription. + /// + /// + /// The Media Services account name. + /// + /// + /// The Asset name. + /// + /// + /// The Asset Track name. + /// + /// + /// The cancellation token. + /// + public static async Task GetAsync(this ITracksOperations operations, string resourceGroupName, string accountName, string assetName, string trackName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, accountName, assetName, trackName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Create or update a Track + /// + /// + /// Create or update a Track in the asset + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group within the Azure subscription. + /// + /// + /// The Media Services account name. + /// + /// + /// The Asset name. + /// + /// + /// The Asset Track name. + /// + /// + /// Detailed information about a track in the asset. + /// + public static AssetTrack CreateOrUpdate(this ITracksOperations operations, string resourceGroupName, string accountName, string assetName, string trackName, TrackBase track = default(TrackBase)) + { + return operations.CreateOrUpdateAsync(resourceGroupName, accountName, assetName, trackName, track).GetAwaiter().GetResult(); + } + + /// + /// Create or update a Track + /// + /// + /// Create or update a Track in the asset + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group within the Azure subscription. + /// + /// + /// The Media Services account name. + /// + /// + /// The Asset name. + /// + /// + /// The Asset Track name. + /// + /// + /// Detailed information about a track in the asset. + /// + /// + /// The cancellation token. + /// + public static async Task CreateOrUpdateAsync(this ITracksOperations operations, string resourceGroupName, string accountName, string assetName, string trackName, TrackBase track = default(TrackBase), CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, accountName, assetName, trackName, track, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Delete a Track + /// + /// + /// Deletes a Track in the asset + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group within the Azure subscription. + /// + /// + /// The Media Services account name. + /// + /// + /// The Asset name. + /// + /// + /// The Asset Track name. + /// + public static TracksDeleteHeaders Delete(this ITracksOperations operations, string resourceGroupName, string accountName, string assetName, string trackName) + { + return operations.DeleteAsync(resourceGroupName, accountName, assetName, trackName).GetAwaiter().GetResult(); + } + + /// + /// Delete a Track + /// + /// + /// Deletes a Track in the asset + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group within the Azure subscription. + /// + /// + /// The Media Services account name. + /// + /// + /// The Asset name. + /// + /// + /// The Asset Track name. + /// + /// + /// The cancellation token. + /// + public static async Task DeleteAsync(this ITracksOperations operations, string resourceGroupName, string accountName, string assetName, string trackName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.DeleteWithHttpMessagesAsync(resourceGroupName, accountName, assetName, trackName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Headers; + } + } + + /// + /// Update an Track + /// + /// + /// Updates an existing Track in the asset + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group within the Azure subscription. + /// + /// + /// The Media Services account name. + /// + /// + /// The Asset name. + /// + /// + /// The Asset Track name. + /// + /// + /// Detailed information about a track in the asset. + /// + public static AssetTrack Update(this ITracksOperations operations, string resourceGroupName, string accountName, string assetName, string trackName, TrackBase track = default(TrackBase)) + { + return operations.UpdateAsync(resourceGroupName, accountName, assetName, trackName, track).GetAwaiter().GetResult(); + } + + /// + /// Update an Track + /// + /// + /// Updates an existing Track in the asset + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group within the Azure subscription. + /// + /// + /// The Media Services account name. + /// + /// + /// The Asset name. + /// + /// + /// The Asset Track name. + /// + /// + /// Detailed information about a track in the asset. + /// + /// + /// The cancellation token. + /// + public static async Task UpdateAsync(this ITracksOperations operations, string resourceGroupName, string accountName, string assetName, string trackName, TrackBase track = default(TrackBase), CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.UpdateWithHttpMessagesAsync(resourceGroupName, accountName, assetName, trackName, track, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Update the track data + /// + /// + /// Update the track data. Call this API after any changes are made to the + /// track data stored in the asset container. For example, you have modified + /// the WebVTT captions file in the Azure blob storage container for the asset, + /// viewers will not see the new version of the captions unless this API is + /// called. Note, the changes may not be reflected immediately. CDN cache may + /// also need to be purged if applicable. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group within the Azure subscription. + /// + /// + /// The Media Services account name. + /// + /// + /// The Asset name. + /// + /// + /// The Asset Track name. + /// + public static TracksUpdateTrackDataHeaders UpdateTrackData(this ITracksOperations operations, string resourceGroupName, string accountName, string assetName, string trackName) + { + return operations.UpdateTrackDataAsync(resourceGroupName, accountName, assetName, trackName).GetAwaiter().GetResult(); + } + + /// + /// Update the track data + /// + /// + /// Update the track data. Call this API after any changes are made to the + /// track data stored in the asset container. For example, you have modified + /// the WebVTT captions file in the Azure blob storage container for the asset, + /// viewers will not see the new version of the captions unless this API is + /// called. Note, the changes may not be reflected immediately. CDN cache may + /// also need to be purged if applicable. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group within the Azure subscription. + /// + /// + /// The Media Services account name. + /// + /// + /// The Asset name. + /// + /// + /// The Asset Track name. + /// + /// + /// The cancellation token. + /// + public static async Task UpdateTrackDataAsync(this ITracksOperations operations, string resourceGroupName, string accountName, string assetName, string trackName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.UpdateTrackDataWithHttpMessagesAsync(resourceGroupName, accountName, assetName, trackName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Headers; + } + } + + /// + /// Create or update a Track + /// + /// + /// Create or update a Track in the asset + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group within the Azure subscription. + /// + /// + /// The Media Services account name. + /// + /// + /// The Asset name. + /// + /// + /// The Asset Track name. + /// + /// + /// Detailed information about a track in the asset. + /// + public static AssetTrack BeginCreateOrUpdate(this ITracksOperations operations, string resourceGroupName, string accountName, string assetName, string trackName, TrackBase track = default(TrackBase)) + { + return operations.BeginCreateOrUpdateAsync(resourceGroupName, accountName, assetName, trackName, track).GetAwaiter().GetResult(); + } + + /// + /// Create or update a Track + /// + /// + /// Create or update a Track in the asset + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group within the Azure subscription. + /// + /// + /// The Media Services account name. + /// + /// + /// The Asset name. + /// + /// + /// The Asset Track name. + /// + /// + /// Detailed information about a track in the asset. + /// + /// + /// The cancellation token. + /// + public static async Task BeginCreateOrUpdateAsync(this ITracksOperations operations, string resourceGroupName, string accountName, string assetName, string trackName, TrackBase track = default(TrackBase), CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, accountName, assetName, trackName, track, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Delete a Track + /// + /// + /// Deletes a Track in the asset + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group within the Azure subscription. + /// + /// + /// The Media Services account name. + /// + /// + /// The Asset name. + /// + /// + /// The Asset Track name. + /// + public static TracksDeleteHeaders BeginDelete(this ITracksOperations operations, string resourceGroupName, string accountName, string assetName, string trackName) + { + return operations.BeginDeleteAsync(resourceGroupName, accountName, assetName, trackName).GetAwaiter().GetResult(); + } + + /// + /// Delete a Track + /// + /// + /// Deletes a Track in the asset + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group within the Azure subscription. + /// + /// + /// The Media Services account name. + /// + /// + /// The Asset name. + /// + /// + /// The Asset Track name. + /// + /// + /// The cancellation token. + /// + public static async Task BeginDeleteAsync(this ITracksOperations operations, string resourceGroupName, string accountName, string assetName, string trackName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, accountName, assetName, trackName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Headers; + } + } + + /// + /// Update an Track + /// + /// + /// Updates an existing Track in the asset + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group within the Azure subscription. + /// + /// + /// The Media Services account name. + /// + /// + /// The Asset name. + /// + /// + /// The Asset Track name. + /// + /// + /// Detailed information about a track in the asset. + /// + public static AssetTrack BeginUpdate(this ITracksOperations operations, string resourceGroupName, string accountName, string assetName, string trackName, TrackBase track = default(TrackBase)) + { + return operations.BeginUpdateAsync(resourceGroupName, accountName, assetName, trackName, track).GetAwaiter().GetResult(); + } + + /// + /// Update an Track + /// + /// + /// Updates an existing Track in the asset + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group within the Azure subscription. + /// + /// + /// The Media Services account name. + /// + /// + /// The Asset name. + /// + /// + /// The Asset Track name. + /// + /// + /// Detailed information about a track in the asset. + /// + /// + /// The cancellation token. + /// + public static async Task BeginUpdateAsync(this ITracksOperations operations, string resourceGroupName, string accountName, string assetName, string trackName, TrackBase track = default(TrackBase), CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.BeginUpdateWithHttpMessagesAsync(resourceGroupName, accountName, assetName, trackName, track, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Update the track data + /// + /// + /// Update the track data. Call this API after any changes are made to the + /// track data stored in the asset container. For example, you have modified + /// the WebVTT captions file in the Azure blob storage container for the asset, + /// viewers will not see the new version of the captions unless this API is + /// called. Note, the changes may not be reflected immediately. CDN cache may + /// also need to be purged if applicable. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group within the Azure subscription. + /// + /// + /// The Media Services account name. + /// + /// + /// The Asset name. + /// + /// + /// The Asset Track name. + /// + public static TracksUpdateTrackDataHeaders BeginUpdateTrackData(this ITracksOperations operations, string resourceGroupName, string accountName, string assetName, string trackName) + { + return operations.BeginUpdateTrackDataAsync(resourceGroupName, accountName, assetName, trackName).GetAwaiter().GetResult(); + } + + /// + /// Update the track data + /// + /// + /// Update the track data. Call this API after any changes are made to the + /// track data stored in the asset container. For example, you have modified + /// the WebVTT captions file in the Azure blob storage container for the asset, + /// viewers will not see the new version of the captions unless this API is + /// called. Note, the changes may not be reflected immediately. CDN cache may + /// also need to be purged if applicable. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group within the Azure subscription. + /// + /// + /// The Media Services account name. + /// + /// + /// The Asset name. + /// + /// + /// The Asset Track name. + /// + /// + /// The cancellation token. + /// + public static async Task BeginUpdateTrackDataAsync(this ITracksOperations operations, string resourceGroupName, string accountName, string assetName, string trackName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.BeginUpdateTrackDataWithHttpMessagesAsync(resourceGroupName, accountName, assetName, trackName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Headers; + } + } + + } +}