From 368588c1746a976c29277869ae031403a90a2a05 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Mon, 7 Mar 2022 19:44:59 +0000 Subject: [PATCH] CodeGen from PR 17540 in Azure/azure-rest-api-specs Merge 601a5e381d31bcc5fcd97707a57e48e65d4468b7 into b21e8f95fc45a65a0cedfe801fc13f4242510967 --- .../src/Generated/AccountFiltersOperations.cs | 50 +- .../src/Generated/AssetFiltersOperations.cs | 50 +- .../src/Generated/AssetsOperations.cs | 80 +- .../src/Generated/AzureMediaServicesClient.cs | 40 +- .../Generated/ContentKeyPoliciesOperations.cs | 60 +- .../Generated/IAzureMediaServicesClient.cs | 30 +- .../Generated/IOperationResultsOperations.cs | 64 + .../Generated/IOperationStatusesOperations.cs | 64 + .../IStreamingEndpointsOperations.cs | 31 + .../src/Generated/ITracksOperations.cs | 376 +++++ .../src/Generated/JobsOperations.cs | 60 +- .../src/Generated/LiveEventsOperations.cs | 90 +- .../src/Generated/LiveOutputsOperations.cs | 40 +- .../src/Generated/LocationsOperations.cs | 10 +- .../src/Generated/MediaservicesOperations.cs | 80 +- .../Models/ArmStreamingEndpointCapacity.cs | 78 + .../Models/ArmStreamingEndpointCurrentSku.cs | 61 + .../Models/ArmStreamingEndpointSku.cs | 51 + .../Models/ArmStreamingEndpointSkuInfo.cs | 60 + .../src/Generated/Models/AssetTrack.cs | 73 + .../Models/AssetTrackOperationStatus.cs | 107 ++ .../src/Generated/Models/AudioTrack.cs | 37 + .../Models/BuiltInStandardEncoderPreset.cs | 14 +- .../src/Generated/Models/H264Layer.cs | 22 +- .../Generated/Models/H264RateControlMode.cs | 119 ++ .../Models/H264RateControlModeConverter.cs | 53 + .../src/Generated/Models/H264Video.cs | 42 +- .../src/Generated/Models/H265Layer.cs | 26 +- .../src/Generated/Models/H265VideoLayer.cs | 1 - .../src/Generated/Models/H265VideoProfile.cs | 6 + .../src/Generated/Models/HlsSettings.cs | 69 + .../src/Generated/Models/JpgLayer.cs | 1 - .../Models/OperationResultsGetHeaders.cs | 71 + .../src/Generated/Models/Page1.cs | 53 + .../src/Generated/Models/PngLayer.cs | 2 - .../src/Generated/Models/ProvisioningState.cs | 116 ++ .../Models/ProvisioningStateConverter.cs | 53 + .../src/Generated/Models/StreamOptionsFlag.cs | 12 +- .../src/Generated/Models/StreamingEndpoint.cs | 10 +- .../StreamingEndpointSkuInfoListResult.cs | 53 + .../src/Generated/Models/TextTrack.cs | 101 ++ .../src/Generated/Models/TrackBase.cs | 36 + .../Models/TracksCreateOrUpdateHeaders.cs | 73 + .../Generated/Models/TracksDeleteHeaders.cs | 71 + .../Generated/Models/TracksUpdateHeaders.cs | 71 + .../Models/TracksUpdateTrackDataHeaders.cs | 73 + .../src/Generated/Models/VideoLayer.cs | 1 - .../src/Generated/Models/VideoTrack.cs | 37 + .../src/Generated/Models/Visibility.cs | 111 ++ .../Generated/Models/VisibilityConverter.cs | 53 + .../Generated/OperationResultsOperations.cs | 286 ++++ .../OperationResultsOperationsExtensions.cs | 89 + .../Generated/OperationStatusesOperations.cs | 273 +++ .../OperationStatusesOperationsExtensions.cs | 89 + .../src/Generated/Operations.cs | 16 +- .../PrivateEndpointConnectionsOperations.cs | 40 +- .../PrivateLinkResourcesOperations.cs | 20 +- .../Generated/SdkInfo_AzureMediaServices.cs | 36 +- .../Generated/StreamingEndpointsOperations.cs | 296 +++- .../StreamingEndpointsOperationsExtensions.cs | 52 + .../Generated/StreamingLocatorsOperations.cs | 60 +- .../Generated/StreamingPoliciesOperations.cs | 40 +- .../src/Generated/TracksOperations.cs | 1503 +++++++++++++++++ .../Generated/TracksOperationsExtensions.cs | 645 +++++++ .../src/Generated/TransformsOperations.cs | 50 +- 65 files changed, 5855 insertions(+), 582 deletions(-) create mode 100644 sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/IOperationResultsOperations.cs create mode 100644 sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/IOperationStatusesOperations.cs create mode 100644 sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/ITracksOperations.cs create mode 100644 sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/ArmStreamingEndpointCapacity.cs create mode 100644 sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/ArmStreamingEndpointCurrentSku.cs create mode 100644 sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/ArmStreamingEndpointSku.cs create mode 100644 sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/ArmStreamingEndpointSkuInfo.cs create mode 100644 sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/AssetTrack.cs create mode 100644 sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/AssetTrackOperationStatus.cs create mode 100644 sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/AudioTrack.cs create mode 100644 sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/H264RateControlMode.cs create mode 100644 sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/H264RateControlModeConverter.cs create mode 100644 sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/HlsSettings.cs create mode 100644 sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/OperationResultsGetHeaders.cs create mode 100644 sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/Page1.cs create mode 100644 sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/ProvisioningState.cs create mode 100644 sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/ProvisioningStateConverter.cs create mode 100644 sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/StreamingEndpointSkuInfoListResult.cs create mode 100644 sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/TextTrack.cs create mode 100644 sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/TrackBase.cs create mode 100644 sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/TracksCreateOrUpdateHeaders.cs create mode 100644 sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/TracksDeleteHeaders.cs create mode 100644 sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/TracksUpdateHeaders.cs create mode 100644 sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/TracksUpdateTrackDataHeaders.cs create mode 100644 sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/VideoTrack.cs create mode 100644 sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/Visibility.cs create mode 100644 sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/VisibilityConverter.cs create mode 100644 sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/OperationResultsOperations.cs create mode 100644 sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/OperationResultsOperationsExtensions.cs create mode 100644 sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/OperationStatusesOperations.cs create mode 100644 sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/OperationStatusesOperationsExtensions.cs create mode 100644 sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/TracksOperations.cs create mode 100644 sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/TracksOperationsExtensions.cs diff --git a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/AccountFiltersOperations.cs b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/AccountFiltersOperations.cs index ef9453394a367..d72e1c566d76f 100644 --- a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/AccountFiltersOperations.cs +++ b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/AccountFiltersOperations.cs @@ -97,10 +97,7 @@ internal AccountFiltersOperations(AzureMediaServicesClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "accountName"); } - if (Client.ApiVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } + string apiVersion = "2021-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -110,6 +107,7 @@ internal AccountFiltersOperations(AzureMediaServicesClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); + tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } @@ -120,9 +118,9 @@ internal AccountFiltersOperations(AzureMediaServicesClient client) _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); List _queryParameters = new List(); - if (Client.ApiVersion != null) + if (apiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); } if (_queryParameters.Count > 0) { @@ -298,10 +296,7 @@ internal AccountFiltersOperations(AzureMediaServicesClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "filterName"); } - if (Client.ApiVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } + string apiVersion = "2021-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -312,6 +307,7 @@ internal AccountFiltersOperations(AzureMediaServicesClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); tracingParameters.Add("filterName", filterName); + tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } @@ -323,9 +319,9 @@ internal AccountFiltersOperations(AzureMediaServicesClient client) _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); _url = _url.Replace("{filterName}", System.Uri.EscapeDataString(filterName)); List _queryParameters = new List(); - if (Client.ApiVersion != null) + if (apiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); } if (_queryParameters.Count > 0) { @@ -512,10 +508,7 @@ internal AccountFiltersOperations(AzureMediaServicesClient client) { parameters.Validate(); } - if (Client.ApiVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } + string apiVersion = "2021-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -527,6 +520,7 @@ internal AccountFiltersOperations(AzureMediaServicesClient client) tracingParameters.Add("accountName", accountName); tracingParameters.Add("filterName", filterName); tracingParameters.Add("parameters", parameters); + tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdate", tracingParameters); } @@ -538,9 +532,9 @@ internal AccountFiltersOperations(AzureMediaServicesClient client) _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); _url = _url.Replace("{filterName}", System.Uri.EscapeDataString(filterName)); List _queryParameters = new List(); - if (Client.ApiVersion != null) + if (apiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); } if (_queryParameters.Count > 0) { @@ -737,10 +731,7 @@ internal AccountFiltersOperations(AzureMediaServicesClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "filterName"); } - if (Client.ApiVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } + string apiVersion = "2021-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -751,6 +742,7 @@ internal AccountFiltersOperations(AzureMediaServicesClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); tracingParameters.Add("filterName", filterName); + tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "Delete", tracingParameters); } @@ -762,9 +754,9 @@ internal AccountFiltersOperations(AzureMediaServicesClient client) _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); _url = _url.Replace("{filterName}", System.Uri.EscapeDataString(filterName)); List _queryParameters = new List(); - if (Client.ApiVersion != null) + if (apiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); } if (_queryParameters.Count > 0) { @@ -929,10 +921,7 @@ internal AccountFiltersOperations(AzureMediaServicesClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); } - if (Client.ApiVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } + string apiVersion = "2021-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -944,6 +933,7 @@ internal AccountFiltersOperations(AzureMediaServicesClient client) tracingParameters.Add("accountName", accountName); tracingParameters.Add("filterName", filterName); tracingParameters.Add("parameters", parameters); + tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "Update", tracingParameters); } @@ -955,9 +945,9 @@ internal AccountFiltersOperations(AzureMediaServicesClient client) _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); _url = _url.Replace("{filterName}", System.Uri.EscapeDataString(filterName)); List _queryParameters = new List(); - if (Client.ApiVersion != null) + if (apiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); } if (_queryParameters.Count > 0) { diff --git a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/AssetFiltersOperations.cs b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/AssetFiltersOperations.cs index 7dfde3d47d607..3701212a28ff4 100644 --- a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/AssetFiltersOperations.cs +++ b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/AssetFiltersOperations.cs @@ -104,10 +104,7 @@ internal AssetFiltersOperations(AzureMediaServicesClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "assetName"); } - if (Client.ApiVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } + string apiVersion = "2021-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -118,6 +115,7 @@ internal AssetFiltersOperations(AzureMediaServicesClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); tracingParameters.Add("assetName", assetName); + tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } @@ -129,9 +127,9 @@ internal AssetFiltersOperations(AzureMediaServicesClient client) _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); _url = _url.Replace("{assetName}", System.Uri.EscapeDataString(assetName)); List _queryParameters = new List(); - if (Client.ApiVersion != null) + if (apiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); } if (_queryParameters.Count > 0) { @@ -314,10 +312,7 @@ internal AssetFiltersOperations(AzureMediaServicesClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "filterName"); } - if (Client.ApiVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } + string apiVersion = "2021-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -329,6 +324,7 @@ internal AssetFiltersOperations(AzureMediaServicesClient client) tracingParameters.Add("accountName", accountName); tracingParameters.Add("assetName", assetName); tracingParameters.Add("filterName", filterName); + tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } @@ -341,9 +337,9 @@ internal AssetFiltersOperations(AzureMediaServicesClient client) _url = _url.Replace("{assetName}", System.Uri.EscapeDataString(assetName)); _url = _url.Replace("{filterName}", System.Uri.EscapeDataString(filterName)); List _queryParameters = new List(); - if (Client.ApiVersion != null) + if (apiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); } if (_queryParameters.Count > 0) { @@ -537,10 +533,7 @@ internal AssetFiltersOperations(AzureMediaServicesClient client) { parameters.Validate(); } - if (Client.ApiVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } + string apiVersion = "2021-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -553,6 +546,7 @@ internal AssetFiltersOperations(AzureMediaServicesClient client) tracingParameters.Add("assetName", assetName); tracingParameters.Add("filterName", filterName); tracingParameters.Add("parameters", parameters); + tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdate", tracingParameters); } @@ -565,9 +559,9 @@ internal AssetFiltersOperations(AzureMediaServicesClient client) _url = _url.Replace("{assetName}", System.Uri.EscapeDataString(assetName)); _url = _url.Replace("{filterName}", System.Uri.EscapeDataString(filterName)); List _queryParameters = new List(); - if (Client.ApiVersion != null) + if (apiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); } if (_queryParameters.Count > 0) { @@ -771,10 +765,7 @@ internal AssetFiltersOperations(AzureMediaServicesClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "filterName"); } - if (Client.ApiVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } + string apiVersion = "2021-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -786,6 +777,7 @@ internal AssetFiltersOperations(AzureMediaServicesClient client) tracingParameters.Add("accountName", accountName); tracingParameters.Add("assetName", assetName); tracingParameters.Add("filterName", filterName); + tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "Delete", tracingParameters); } @@ -798,9 +790,9 @@ internal AssetFiltersOperations(AzureMediaServicesClient client) _url = _url.Replace("{assetName}", System.Uri.EscapeDataString(assetName)); _url = _url.Replace("{filterName}", System.Uri.EscapeDataString(filterName)); List _queryParameters = new List(); - if (Client.ApiVersion != null) + if (apiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); } if (_queryParameters.Count > 0) { @@ -972,10 +964,7 @@ internal AssetFiltersOperations(AzureMediaServicesClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); } - if (Client.ApiVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } + string apiVersion = "2021-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -988,6 +977,7 @@ internal AssetFiltersOperations(AzureMediaServicesClient client) tracingParameters.Add("assetName", assetName); tracingParameters.Add("filterName", filterName); tracingParameters.Add("parameters", parameters); + tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "Update", tracingParameters); } @@ -1000,9 +990,9 @@ internal AssetFiltersOperations(AzureMediaServicesClient client) _url = _url.Replace("{assetName}", System.Uri.EscapeDataString(assetName)); _url = _url.Replace("{filterName}", System.Uri.EscapeDataString(filterName)); List _queryParameters = new List(); - if (Client.ApiVersion != null) + if (apiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); } if (_queryParameters.Count > 0) { diff --git a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/AssetsOperations.cs b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/AssetsOperations.cs index 9edaf7b7a9ceb..da813b1ffee30 100644 --- a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/AssetsOperations.cs +++ b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/AssetsOperations.cs @@ -102,10 +102,7 @@ internal AssetsOperations(AzureMediaServicesClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "accountName"); } - if (Client.ApiVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } + string apiVersion = "2021-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -116,6 +113,7 @@ internal AssetsOperations(AzureMediaServicesClient client) tracingParameters.Add("odataQuery", odataQuery); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); + tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } @@ -134,9 +132,9 @@ internal AssetsOperations(AzureMediaServicesClient client) _queryParameters.Add(_odataFilter); } } - if (Client.ApiVersion != null) + if (apiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); } if (_queryParameters.Count > 0) { @@ -312,10 +310,7 @@ internal AssetsOperations(AzureMediaServicesClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "assetName"); } - if (Client.ApiVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } + string apiVersion = "2021-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -326,6 +321,7 @@ internal AssetsOperations(AzureMediaServicesClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); tracingParameters.Add("assetName", assetName); + tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } @@ -337,9 +333,9 @@ internal AssetsOperations(AzureMediaServicesClient client) _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); _url = _url.Replace("{assetName}", System.Uri.EscapeDataString(assetName)); List _queryParameters = new List(); - if (Client.ApiVersion != null) + if (apiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); } if (_queryParameters.Count > 0) { @@ -522,10 +518,7 @@ internal AssetsOperations(AzureMediaServicesClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); } - if (Client.ApiVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } + string apiVersion = "2021-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -537,6 +530,7 @@ internal AssetsOperations(AzureMediaServicesClient client) tracingParameters.Add("accountName", accountName); tracingParameters.Add("assetName", assetName); tracingParameters.Add("parameters", parameters); + tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdate", tracingParameters); } @@ -548,9 +542,9 @@ internal AssetsOperations(AzureMediaServicesClient client) _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); _url = _url.Replace("{assetName}", System.Uri.EscapeDataString(assetName)); List _queryParameters = new List(); - if (Client.ApiVersion != null) + if (apiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); } if (_queryParameters.Count > 0) { @@ -747,10 +741,7 @@ internal AssetsOperations(AzureMediaServicesClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "assetName"); } - if (Client.ApiVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } + string apiVersion = "2021-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -761,6 +752,7 @@ internal AssetsOperations(AzureMediaServicesClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); tracingParameters.Add("assetName", assetName); + tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "Delete", tracingParameters); } @@ -772,9 +764,9 @@ internal AssetsOperations(AzureMediaServicesClient client) _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); _url = _url.Replace("{assetName}", System.Uri.EscapeDataString(assetName)); List _queryParameters = new List(); - if (Client.ApiVersion != null) + if (apiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); } if (_queryParameters.Count > 0) { @@ -939,10 +931,7 @@ internal AssetsOperations(AzureMediaServicesClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); } - if (Client.ApiVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } + string apiVersion = "2021-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -954,6 +943,7 @@ internal AssetsOperations(AzureMediaServicesClient client) tracingParameters.Add("accountName", accountName); tracingParameters.Add("assetName", assetName); tracingParameters.Add("parameters", parameters); + tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "Update", tracingParameters); } @@ -965,9 +955,9 @@ internal AssetsOperations(AzureMediaServicesClient client) _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); _url = _url.Replace("{assetName}", System.Uri.EscapeDataString(assetName)); List _queryParameters = new List(); - if (Client.ApiVersion != null) + if (apiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); } if (_queryParameters.Count > 0) { @@ -1159,10 +1149,7 @@ internal AssetsOperations(AzureMediaServicesClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "assetName"); } - if (Client.ApiVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } + string apiVersion = "2021-11-01"; ListContainerSasInput parameters = new ListContainerSasInput(); if (permissions != null || expiryTime != null) { @@ -1179,6 +1166,7 @@ internal AssetsOperations(AzureMediaServicesClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); tracingParameters.Add("assetName", assetName); + tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("parameters", parameters); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "ListContainerSas", tracingParameters); @@ -1191,9 +1179,9 @@ internal AssetsOperations(AzureMediaServicesClient client) _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); _url = _url.Replace("{assetName}", System.Uri.EscapeDataString(assetName)); List _queryParameters = new List(); - if (Client.ApiVersion != null) + if (apiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); } if (_queryParameters.Count > 0) { @@ -1376,10 +1364,7 @@ internal AssetsOperations(AzureMediaServicesClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "assetName"); } - if (Client.ApiVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } + string apiVersion = "2021-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1390,6 +1375,7 @@ internal AssetsOperations(AzureMediaServicesClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); tracingParameters.Add("assetName", assetName); + tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "GetEncryptionKey", tracingParameters); } @@ -1401,9 +1387,9 @@ internal AssetsOperations(AzureMediaServicesClient client) _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); _url = _url.Replace("{assetName}", System.Uri.EscapeDataString(assetName)); List _queryParameters = new List(); - if (Client.ApiVersion != null) + if (apiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); } if (_queryParameters.Count > 0) { @@ -1579,10 +1565,7 @@ internal AssetsOperations(AzureMediaServicesClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "assetName"); } - if (Client.ApiVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } + string apiVersion = "2021-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1593,6 +1576,7 @@ internal AssetsOperations(AzureMediaServicesClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); tracingParameters.Add("assetName", assetName); + tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "ListStreamingLocators", tracingParameters); } @@ -1604,9 +1588,9 @@ internal AssetsOperations(AzureMediaServicesClient client) _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); _url = _url.Replace("{assetName}", System.Uri.EscapeDataString(assetName)); List _queryParameters = new List(); - if (Client.ApiVersion != null) + if (apiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); } if (_queryParameters.Count > 0) { 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 0a177a9973d07..3dc0e3b79ea70 100644 --- a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/AzureMediaServicesClient.cs +++ b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/AzureMediaServicesClient.cs @@ -48,11 +48,6 @@ public partial class AzureMediaServicesClient : ServiceClient public string SubscriptionId { get; set; } - /// - /// The version of the API to be used with the client request. - /// - public string ApiVersion { get; private set; } - /// /// The preferred language for the response. /// @@ -71,6 +66,11 @@ public partial class AzureMediaServicesClient : ServiceClient public bool? GenerateClientRequestId { get; set; } + /// + /// Gets the IAccountFiltersOperations. + /// + public virtual IAccountFiltersOperations AccountFilters { get; private set; } + /// /// Gets the IOperations. /// @@ -96,11 +96,6 @@ public partial class AzureMediaServicesClient : ServiceClient public virtual ILocationsOperations Locations { get; private set; } - /// - /// Gets the IAccountFiltersOperations. - /// - public virtual IAccountFiltersOperations AccountFilters { get; private set; } - /// /// Gets the IAssetsOperations. /// @@ -111,6 +106,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 +402,17 @@ 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); 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 +422,6 @@ private void Initialize() LiveOutputs = new LiveOutputsOperations(this); StreamingEndpoints = new StreamingEndpointsOperations(this); BaseUri = new System.Uri("https://management.azure.com"); - ApiVersion = "2021-06-01"; AcceptLanguage = "en-US"; LongRunningOperationRetryTimeout = 30; GenerateClientRequestId = true; @@ -439,6 +451,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 +465,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/ContentKeyPoliciesOperations.cs b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/ContentKeyPoliciesOperations.cs index aa14959a33582..20c6bf11f48ac 100644 --- a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/ContentKeyPoliciesOperations.cs +++ b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/ContentKeyPoliciesOperations.cs @@ -101,10 +101,7 @@ internal ContentKeyPoliciesOperations(AzureMediaServicesClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "accountName"); } - if (Client.ApiVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } + string apiVersion = "2021-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -115,6 +112,7 @@ internal ContentKeyPoliciesOperations(AzureMediaServicesClient client) tracingParameters.Add("odataQuery", odataQuery); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); + tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } @@ -133,9 +131,9 @@ internal ContentKeyPoliciesOperations(AzureMediaServicesClient client) _queryParameters.Add(_odataFilter); } } - if (Client.ApiVersion != null) + if (apiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); } if (_queryParameters.Count > 0) { @@ -311,10 +309,7 @@ internal ContentKeyPoliciesOperations(AzureMediaServicesClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "contentKeyPolicyName"); } - if (Client.ApiVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } + string apiVersion = "2021-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -325,6 +320,7 @@ internal ContentKeyPoliciesOperations(AzureMediaServicesClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); tracingParameters.Add("contentKeyPolicyName", contentKeyPolicyName); + tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } @@ -336,9 +332,9 @@ internal ContentKeyPoliciesOperations(AzureMediaServicesClient client) _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); _url = _url.Replace("{contentKeyPolicyName}", System.Uri.EscapeDataString(contentKeyPolicyName)); List _queryParameters = new List(); - if (Client.ApiVersion != null) + if (apiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); } if (_queryParameters.Count > 0) { @@ -520,10 +516,6 @@ internal ContentKeyPoliciesOperations(AzureMediaServicesClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "contentKeyPolicyName"); } - if (Client.ApiVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } if (options == null) { throw new ValidationException(ValidationRules.CannotBeNull, "options"); @@ -538,6 +530,7 @@ internal ContentKeyPoliciesOperations(AzureMediaServicesClient client) } } } + string apiVersion = "2021-11-01"; ContentKeyPolicy parameters = new ContentKeyPolicy(); if (description != null || options != null) { @@ -554,6 +547,7 @@ internal ContentKeyPoliciesOperations(AzureMediaServicesClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); tracingParameters.Add("contentKeyPolicyName", contentKeyPolicyName); + tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("parameters", parameters); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdate", tracingParameters); @@ -566,9 +560,9 @@ internal ContentKeyPoliciesOperations(AzureMediaServicesClient client) _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); _url = _url.Replace("{contentKeyPolicyName}", System.Uri.EscapeDataString(contentKeyPolicyName)); List _queryParameters = new List(); - if (Client.ApiVersion != null) + if (apiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); } if (_queryParameters.Count > 0) { @@ -765,10 +759,7 @@ internal ContentKeyPoliciesOperations(AzureMediaServicesClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "contentKeyPolicyName"); } - if (Client.ApiVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } + string apiVersion = "2021-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -779,6 +770,7 @@ internal ContentKeyPoliciesOperations(AzureMediaServicesClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); tracingParameters.Add("contentKeyPolicyName", contentKeyPolicyName); + tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "Delete", tracingParameters); } @@ -790,9 +782,9 @@ internal ContentKeyPoliciesOperations(AzureMediaServicesClient client) _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); _url = _url.Replace("{contentKeyPolicyName}", System.Uri.EscapeDataString(contentKeyPolicyName)); List _queryParameters = new List(); - if (Client.ApiVersion != null) + if (apiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); } if (_queryParameters.Count > 0) { @@ -956,10 +948,6 @@ internal ContentKeyPoliciesOperations(AzureMediaServicesClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "contentKeyPolicyName"); } - if (Client.ApiVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } if (options == null) { throw new ValidationException(ValidationRules.CannotBeNull, "options"); @@ -974,6 +962,7 @@ internal ContentKeyPoliciesOperations(AzureMediaServicesClient client) } } } + string apiVersion = "2021-11-01"; ContentKeyPolicy parameters = new ContentKeyPolicy(); if (description != null || options != null) { @@ -990,6 +979,7 @@ internal ContentKeyPoliciesOperations(AzureMediaServicesClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); tracingParameters.Add("contentKeyPolicyName", contentKeyPolicyName); + tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("parameters", parameters); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "Update", tracingParameters); @@ -1002,9 +992,9 @@ internal ContentKeyPoliciesOperations(AzureMediaServicesClient client) _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); _url = _url.Replace("{contentKeyPolicyName}", System.Uri.EscapeDataString(contentKeyPolicyName)); List _queryParameters = new List(); - if (Client.ApiVersion != null) + if (apiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); } if (_queryParameters.Count > 0) { @@ -1186,10 +1176,7 @@ internal ContentKeyPoliciesOperations(AzureMediaServicesClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "contentKeyPolicyName"); } - if (Client.ApiVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } + string apiVersion = "2021-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1200,6 +1187,7 @@ internal ContentKeyPoliciesOperations(AzureMediaServicesClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); tracingParameters.Add("contentKeyPolicyName", contentKeyPolicyName); + tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "GetPolicyPropertiesWithSecrets", tracingParameters); } @@ -1211,9 +1199,9 @@ internal ContentKeyPoliciesOperations(AzureMediaServicesClient client) _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); _url = _url.Replace("{contentKeyPolicyName}", System.Uri.EscapeDataString(contentKeyPolicyName)); List _queryParameters = new List(); - if (Client.ApiVersion != null) + if (apiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); } if (_queryParameters.Count > 0) { 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 d15d89845daca..2833c69ff7a29 100644 --- a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/IAzureMediaServicesClient.cs +++ b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/IAzureMediaServicesClient.cs @@ -44,11 +44,6 @@ public partial interface IAzureMediaServicesClient : System.IDisposable /// string SubscriptionId { get; set; } - /// - /// The version of the API to be used with the client request. - /// - string ApiVersion { get; } - /// /// The preferred language for the response. /// @@ -68,6 +63,11 @@ public partial interface IAzureMediaServicesClient : System.IDisposable bool? GenerateClientRequestId { get; set; } + /// + /// Gets the IAccountFiltersOperations. + /// + IAccountFiltersOperations AccountFilters { get; } + /// /// Gets the IOperations. /// @@ -93,11 +93,6 @@ public partial interface IAzureMediaServicesClient : System.IDisposable /// ILocationsOperations Locations { get; } - /// - /// Gets the IAccountFiltersOperations. - /// - IAccountFiltersOperations AccountFilters { get; } - /// /// Gets the IAssetsOperations. /// @@ -108,6 +103,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/IOperationResultsOperations.cs b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/IOperationResultsOperations.cs new file mode 100644 index 0000000000000..72b4f8a73d203 --- /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 0000000000000..3a4ecf5d0fbdf --- /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/IStreamingEndpointsOperations.cs b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/IStreamingEndpointsOperations.cs index d33681c686029..3f20ecdc36a51 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 0000000000000..95adf634f6799 --- /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/JobsOperations.cs b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/JobsOperations.cs index 84051215b26fb..c539b3c4b4af8 100644 --- a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/JobsOperations.cs +++ b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/JobsOperations.cs @@ -108,10 +108,7 @@ internal JobsOperations(AzureMediaServicesClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "transformName"); } - if (Client.ApiVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } + string apiVersion = "2021-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -123,6 +120,7 @@ internal JobsOperations(AzureMediaServicesClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); tracingParameters.Add("transformName", transformName); + tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } @@ -142,9 +140,9 @@ internal JobsOperations(AzureMediaServicesClient client) _queryParameters.Add(_odataFilter); } } - if (Client.ApiVersion != null) + if (apiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); } if (_queryParameters.Count > 0) { @@ -327,10 +325,7 @@ internal JobsOperations(AzureMediaServicesClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "jobName"); } - if (Client.ApiVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } + string apiVersion = "2021-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -342,6 +337,7 @@ internal JobsOperations(AzureMediaServicesClient client) tracingParameters.Add("accountName", accountName); tracingParameters.Add("transformName", transformName); tracingParameters.Add("jobName", jobName); + tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } @@ -354,9 +350,9 @@ internal JobsOperations(AzureMediaServicesClient client) _url = _url.Replace("{transformName}", System.Uri.EscapeDataString(transformName)); _url = _url.Replace("{jobName}", System.Uri.EscapeDataString(jobName)); List _queryParameters = new List(); - if (Client.ApiVersion != null) + if (apiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); } if (_queryParameters.Count > 0) { @@ -550,10 +546,7 @@ internal JobsOperations(AzureMediaServicesClient client) { parameters.Validate(); } - if (Client.ApiVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } + string apiVersion = "2021-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -566,6 +559,7 @@ internal JobsOperations(AzureMediaServicesClient client) tracingParameters.Add("transformName", transformName); tracingParameters.Add("jobName", jobName); tracingParameters.Add("parameters", parameters); + tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "Create", tracingParameters); } @@ -578,9 +572,9 @@ internal JobsOperations(AzureMediaServicesClient client) _url = _url.Replace("{transformName}", System.Uri.EscapeDataString(transformName)); _url = _url.Replace("{jobName}", System.Uri.EscapeDataString(jobName)); List _queryParameters = new List(); - if (Client.ApiVersion != null) + if (apiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); } if (_queryParameters.Count > 0) { @@ -766,10 +760,7 @@ internal JobsOperations(AzureMediaServicesClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "jobName"); } - if (Client.ApiVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } + string apiVersion = "2021-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -781,6 +772,7 @@ internal JobsOperations(AzureMediaServicesClient client) tracingParameters.Add("accountName", accountName); tracingParameters.Add("transformName", transformName); tracingParameters.Add("jobName", jobName); + tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "Delete", tracingParameters); } @@ -793,9 +785,9 @@ internal JobsOperations(AzureMediaServicesClient client) _url = _url.Replace("{transformName}", System.Uri.EscapeDataString(transformName)); _url = _url.Replace("{jobName}", System.Uri.EscapeDataString(jobName)); List _queryParameters = new List(); - if (Client.ApiVersion != null) + if (apiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); } if (_queryParameters.Count > 0) { @@ -969,10 +961,7 @@ internal JobsOperations(AzureMediaServicesClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); } - if (Client.ApiVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } + string apiVersion = "2021-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -985,6 +974,7 @@ internal JobsOperations(AzureMediaServicesClient client) tracingParameters.Add("transformName", transformName); tracingParameters.Add("jobName", jobName); tracingParameters.Add("parameters", parameters); + tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "Update", tracingParameters); } @@ -997,9 +987,9 @@ internal JobsOperations(AzureMediaServicesClient client) _url = _url.Replace("{transformName}", System.Uri.EscapeDataString(transformName)); _url = _url.Replace("{jobName}", System.Uri.EscapeDataString(jobName)); List _queryParameters = new List(); - if (Client.ApiVersion != null) + if (apiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); } if (_queryParameters.Count > 0) { @@ -1185,10 +1175,7 @@ internal JobsOperations(AzureMediaServicesClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "jobName"); } - if (Client.ApiVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } + string apiVersion = "2021-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1200,6 +1187,7 @@ internal JobsOperations(AzureMediaServicesClient client) tracingParameters.Add("accountName", accountName); tracingParameters.Add("transformName", transformName); tracingParameters.Add("jobName", jobName); + tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "CancelJob", tracingParameters); } @@ -1212,9 +1200,9 @@ internal JobsOperations(AzureMediaServicesClient client) _url = _url.Replace("{transformName}", System.Uri.EscapeDataString(transformName)); _url = _url.Replace("{jobName}", System.Uri.EscapeDataString(jobName)); List _queryParameters = new List(); - if (Client.ApiVersion != null) + if (apiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); } if (_queryParameters.Count > 0) { diff --git a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/LiveEventsOperations.cs b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/LiveEventsOperations.cs index 1c09dc59953db..acd74e0feaaa5 100644 --- a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/LiveEventsOperations.cs +++ b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/LiveEventsOperations.cs @@ -97,10 +97,7 @@ internal LiveEventsOperations(AzureMediaServicesClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "accountName"); } - if (Client.ApiVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } + string apiVersion = "2021-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -110,6 +107,7 @@ internal LiveEventsOperations(AzureMediaServicesClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); + tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } @@ -120,9 +118,9 @@ internal LiveEventsOperations(AzureMediaServicesClient client) _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); List _queryParameters = new List(); - if (Client.ApiVersion != null) + if (apiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); } if (_queryParameters.Count > 0) { @@ -313,10 +311,7 @@ internal LiveEventsOperations(AzureMediaServicesClient client) throw new ValidationException(ValidationRules.Pattern, "liveEventName", "^[a-zA-Z0-9]+(-*[a-zA-Z0-9])*$"); } } - if (Client.ApiVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } + string apiVersion = "2021-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -327,6 +322,7 @@ internal LiveEventsOperations(AzureMediaServicesClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); tracingParameters.Add("liveEventName", liveEventName); + tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } @@ -338,9 +334,9 @@ internal LiveEventsOperations(AzureMediaServicesClient client) _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); _url = _url.Replace("{liveEventName}", System.Uri.EscapeDataString(liveEventName)); List _queryParameters = new List(); - if (Client.ApiVersion != null) + if (apiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); } if (_queryParameters.Count > 0) { @@ -751,10 +747,6 @@ internal LiveEventsOperations(AzureMediaServicesClient client) throw new ValidationException(ValidationRules.Pattern, "liveEventName", "^[a-zA-Z0-9]+(-*[a-zA-Z0-9])*$"); } } - if (Client.ApiVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } if (parameters == null) { throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); @@ -763,6 +755,7 @@ internal LiveEventsOperations(AzureMediaServicesClient client) { parameters.Validate(); } + string apiVersion = "2021-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -773,6 +766,7 @@ internal LiveEventsOperations(AzureMediaServicesClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); tracingParameters.Add("liveEventName", liveEventName); + tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("autoStart", autoStart); tracingParameters.Add("parameters", parameters); tracingParameters.Add("cancellationToken", cancellationToken); @@ -786,9 +780,9 @@ internal LiveEventsOperations(AzureMediaServicesClient client) _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); _url = _url.Replace("{liveEventName}", System.Uri.EscapeDataString(liveEventName)); List _queryParameters = new List(); - if (Client.ApiVersion != null) + if (apiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); } if (autoStart != null) { @@ -1007,14 +1001,11 @@ internal LiveEventsOperations(AzureMediaServicesClient client) throw new ValidationException(ValidationRules.Pattern, "liveEventName", "^[a-zA-Z0-9]+(-*[a-zA-Z0-9])*$"); } } - if (Client.ApiVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } if (parameters == null) { throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); } + string apiVersion = "2021-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1025,6 +1016,7 @@ internal LiveEventsOperations(AzureMediaServicesClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); tracingParameters.Add("liveEventName", liveEventName); + tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("parameters", parameters); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "BeginUpdate", tracingParameters); @@ -1037,9 +1029,9 @@ internal LiveEventsOperations(AzureMediaServicesClient client) _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); _url = _url.Replace("{liveEventName}", System.Uri.EscapeDataString(liveEventName)); List _queryParameters = new List(); - if (Client.ApiVersion != null) + if (apiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); } if (_queryParameters.Count > 0) { @@ -1251,10 +1243,7 @@ internal LiveEventsOperations(AzureMediaServicesClient client) throw new ValidationException(ValidationRules.Pattern, "liveEventName", "^[a-zA-Z0-9]+(-*[a-zA-Z0-9])*$"); } } - if (Client.ApiVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } + string apiVersion = "2021-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1265,6 +1254,7 @@ internal LiveEventsOperations(AzureMediaServicesClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); tracingParameters.Add("liveEventName", liveEventName); + tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); } @@ -1276,9 +1266,9 @@ internal LiveEventsOperations(AzureMediaServicesClient client) _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); _url = _url.Replace("{liveEventName}", System.Uri.EscapeDataString(liveEventName)); List _queryParameters = new List(); - if (Client.ApiVersion != null) + if (apiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); } if (_queryParameters.Count > 0) { @@ -1449,10 +1439,7 @@ internal LiveEventsOperations(AzureMediaServicesClient client) throw new ValidationException(ValidationRules.Pattern, "liveEventName", "^[a-zA-Z0-9]+(-*[a-zA-Z0-9])*$"); } } - if (Client.ApiVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } + string apiVersion = "2021-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1463,6 +1450,7 @@ internal LiveEventsOperations(AzureMediaServicesClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); tracingParameters.Add("liveEventName", liveEventName); + tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "BeginAllocate", tracingParameters); } @@ -1474,9 +1462,9 @@ internal LiveEventsOperations(AzureMediaServicesClient client) _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); _url = _url.Replace("{liveEventName}", System.Uri.EscapeDataString(liveEventName)); List _queryParameters = new List(); - if (Client.ApiVersion != null) + if (apiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); } if (_queryParameters.Count > 0) { @@ -1647,10 +1635,7 @@ internal LiveEventsOperations(AzureMediaServicesClient client) throw new ValidationException(ValidationRules.Pattern, "liveEventName", "^[a-zA-Z0-9]+(-*[a-zA-Z0-9])*$"); } } - if (Client.ApiVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } + string apiVersion = "2021-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1661,6 +1646,7 @@ internal LiveEventsOperations(AzureMediaServicesClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); tracingParameters.Add("liveEventName", liveEventName); + tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "BeginStart", tracingParameters); } @@ -1672,9 +1658,9 @@ internal LiveEventsOperations(AzureMediaServicesClient client) _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); _url = _url.Replace("{liveEventName}", System.Uri.EscapeDataString(liveEventName)); List _queryParameters = new List(); - if (Client.ApiVersion != null) + if (apiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); } if (_queryParameters.Count > 0) { @@ -1849,10 +1835,7 @@ internal LiveEventsOperations(AzureMediaServicesClient client) throw new ValidationException(ValidationRules.Pattern, "liveEventName", "^[a-zA-Z0-9]+(-*[a-zA-Z0-9])*$"); } } - if (Client.ApiVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } + string apiVersion = "2021-11-01"; LiveEventActionInput parameters = new LiveEventActionInput(); if (removeOutputsOnStop != null) { @@ -1868,6 +1851,7 @@ internal LiveEventsOperations(AzureMediaServicesClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); tracingParameters.Add("liveEventName", liveEventName); + tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("parameters", parameters); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "BeginStop", tracingParameters); @@ -1880,9 +1864,9 @@ internal LiveEventsOperations(AzureMediaServicesClient client) _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); _url = _url.Replace("{liveEventName}", System.Uri.EscapeDataString(liveEventName)); List _queryParameters = new List(); - if (Client.ApiVersion != null) + if (apiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); } if (_queryParameters.Count > 0) { @@ -2061,10 +2045,7 @@ internal LiveEventsOperations(AzureMediaServicesClient client) throw new ValidationException(ValidationRules.Pattern, "liveEventName", "^[a-zA-Z0-9]+(-*[a-zA-Z0-9])*$"); } } - if (Client.ApiVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } + string apiVersion = "2021-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -2075,6 +2056,7 @@ internal LiveEventsOperations(AzureMediaServicesClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); tracingParameters.Add("liveEventName", liveEventName); + tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "BeginReset", tracingParameters); } @@ -2086,9 +2068,9 @@ internal LiveEventsOperations(AzureMediaServicesClient client) _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); _url = _url.Replace("{liveEventName}", System.Uri.EscapeDataString(liveEventName)); List _queryParameters = new List(); - if (Client.ApiVersion != null) + if (apiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); } if (_queryParameters.Count > 0) { diff --git a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/LiveOutputsOperations.cs b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/LiveOutputsOperations.cs index ce3bdb7816a34..a464d226ef412 100644 --- a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/LiveOutputsOperations.cs +++ b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/LiveOutputsOperations.cs @@ -119,10 +119,7 @@ internal LiveOutputsOperations(AzureMediaServicesClient client) throw new ValidationException(ValidationRules.Pattern, "liveEventName", "^[a-zA-Z0-9]+(-*[a-zA-Z0-9])*$"); } } - if (Client.ApiVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } + string apiVersion = "2021-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -133,6 +130,7 @@ internal LiveOutputsOperations(AzureMediaServicesClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); tracingParameters.Add("liveEventName", liveEventName); + tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } @@ -144,9 +142,9 @@ internal LiveOutputsOperations(AzureMediaServicesClient client) _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); _url = _url.Replace("{liveEventName}", System.Uri.EscapeDataString(liveEventName)); List _queryParameters = new List(); - if (Client.ApiVersion != null) + if (apiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); } if (_queryParameters.Count > 0) { @@ -359,10 +357,7 @@ internal LiveOutputsOperations(AzureMediaServicesClient client) throw new ValidationException(ValidationRules.Pattern, "liveOutputName", "^([a-zA-Z0-9])+(-*[a-zA-Z0-9])*$"); } } - if (Client.ApiVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } + string apiVersion = "2021-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -374,6 +369,7 @@ internal LiveOutputsOperations(AzureMediaServicesClient client) tracingParameters.Add("accountName", accountName); tracingParameters.Add("liveEventName", liveEventName); tracingParameters.Add("liveOutputName", liveOutputName); + tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } @@ -386,9 +382,9 @@ internal LiveOutputsOperations(AzureMediaServicesClient client) _url = _url.Replace("{liveEventName}", System.Uri.EscapeDataString(liveEventName)); _url = _url.Replace("{liveOutputName}", System.Uri.EscapeDataString(liveOutputName)); List _queryParameters = new List(); - if (Client.ApiVersion != null) + if (apiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); } if (_queryParameters.Count > 0) { @@ -670,10 +666,6 @@ internal LiveOutputsOperations(AzureMediaServicesClient client) throw new ValidationException(ValidationRules.Pattern, "liveOutputName", "^([a-zA-Z0-9])+(-*[a-zA-Z0-9])*$"); } } - if (Client.ApiVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } if (parameters == null) { throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); @@ -682,6 +674,7 @@ internal LiveOutputsOperations(AzureMediaServicesClient client) { parameters.Validate(); } + string apiVersion = "2021-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -693,6 +686,7 @@ internal LiveOutputsOperations(AzureMediaServicesClient client) tracingParameters.Add("accountName", accountName); tracingParameters.Add("liveEventName", liveEventName); tracingParameters.Add("liveOutputName", liveOutputName); + tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("parameters", parameters); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "BeginCreate", tracingParameters); @@ -706,9 +700,9 @@ internal LiveOutputsOperations(AzureMediaServicesClient client) _url = _url.Replace("{liveEventName}", System.Uri.EscapeDataString(liveEventName)); _url = _url.Replace("{liveOutputName}", System.Uri.EscapeDataString(liveOutputName)); List _queryParameters = new List(); - if (Client.ApiVersion != null) + if (apiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); } if (_queryParameters.Count > 0) { @@ -943,10 +937,7 @@ internal LiveOutputsOperations(AzureMediaServicesClient client) throw new ValidationException(ValidationRules.Pattern, "liveOutputName", "^([a-zA-Z0-9])+(-*[a-zA-Z0-9])*$"); } } - if (Client.ApiVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } + string apiVersion = "2021-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -958,6 +949,7 @@ internal LiveOutputsOperations(AzureMediaServicesClient client) tracingParameters.Add("accountName", accountName); tracingParameters.Add("liveEventName", liveEventName); tracingParameters.Add("liveOutputName", liveOutputName); + tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); } @@ -970,9 +962,9 @@ internal LiveOutputsOperations(AzureMediaServicesClient client) _url = _url.Replace("{liveEventName}", System.Uri.EscapeDataString(liveEventName)); _url = _url.Replace("{liveOutputName}", System.Uri.EscapeDataString(liveOutputName)); List _queryParameters = new List(); - if (Client.ApiVersion != null) + if (apiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); } if (_queryParameters.Count > 0) { 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 a769429f7f067..f7e95ea62aeb5 100644 --- a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/LocationsOperations.cs +++ b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/LocationsOperations.cs @@ -97,10 +97,7 @@ internal LocationsOperations(AzureMediaServicesClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "locationName"); } - if (Client.ApiVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } + string apiVersion = "2021-06-01"; CheckNameAvailabilityInput parameters = new CheckNameAvailabilityInput(); if (name != null || type != null) { @@ -115,6 +112,7 @@ internal LocationsOperations(AzureMediaServicesClient client) _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("locationName", locationName); + tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("parameters", parameters); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "CheckNameAvailability", tracingParameters); @@ -125,9 +123,9 @@ internal LocationsOperations(AzureMediaServicesClient client) _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); _url = _url.Replace("{locationName}", System.Uri.EscapeDataString(locationName)); List _queryParameters = new List(); - if (Client.ApiVersion != null) + if (apiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); } if (_queryParameters.Count > 0) { 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 1f1ddcb43c9cc..7f3ae0adfc602 100644 --- a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/MediaservicesOperations.cs +++ b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/MediaservicesOperations.cs @@ -90,10 +90,7 @@ internal MediaservicesOperations(AzureMediaServicesClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } - if (Client.ApiVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } + string apiVersion = "2021-06-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -102,6 +99,7 @@ internal MediaservicesOperations(AzureMediaServicesClient client) _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } @@ -111,9 +109,9 @@ internal MediaservicesOperations(AzureMediaServicesClient client) _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); List _queryParameters = new List(); - if (Client.ApiVersion != null) + if (apiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); } if (_queryParameters.Count > 0) { @@ -282,10 +280,7 @@ internal MediaservicesOperations(AzureMediaServicesClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "accountName"); } - if (Client.ApiVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } + string apiVersion = "2021-06-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -295,6 +290,7 @@ internal MediaservicesOperations(AzureMediaServicesClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); + tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } @@ -305,9 +301,9 @@ internal MediaservicesOperations(AzureMediaServicesClient client) _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); List _queryParameters = new List(); - if (Client.ApiVersion != null) + if (apiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); } if (_queryParameters.Count > 0) { @@ -487,10 +483,7 @@ internal MediaservicesOperations(AzureMediaServicesClient client) { parameters.Validate(); } - if (Client.ApiVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } + string apiVersion = "2021-06-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -501,6 +494,7 @@ internal MediaservicesOperations(AzureMediaServicesClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); tracingParameters.Add("parameters", parameters); + tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdate", tracingParameters); } @@ -511,9 +505,9 @@ internal MediaservicesOperations(AzureMediaServicesClient client) _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); List _queryParameters = new List(); - if (Client.ApiVersion != null) + if (apiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); } if (_queryParameters.Count > 0) { @@ -703,10 +697,7 @@ internal MediaservicesOperations(AzureMediaServicesClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "accountName"); } - if (Client.ApiVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } + string apiVersion = "2021-06-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -716,6 +707,7 @@ internal MediaservicesOperations(AzureMediaServicesClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); + tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "Delete", tracingParameters); } @@ -726,9 +718,9 @@ internal MediaservicesOperations(AzureMediaServicesClient client) _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); List _queryParameters = new List(); - if (Client.ApiVersion != null) + if (apiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); } if (_queryParameters.Count > 0) { @@ -886,10 +878,7 @@ internal MediaservicesOperations(AzureMediaServicesClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); } - if (Client.ApiVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } + string apiVersion = "2021-06-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -900,6 +889,7 @@ internal MediaservicesOperations(AzureMediaServicesClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); tracingParameters.Add("parameters", parameters); + tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "Update", tracingParameters); } @@ -910,9 +900,9 @@ internal MediaservicesOperations(AzureMediaServicesClient client) _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); List _queryParameters = new List(); - if (Client.ApiVersion != null) + if (apiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); } if (_queryParameters.Count > 0) { @@ -1088,10 +1078,7 @@ internal MediaservicesOperations(AzureMediaServicesClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "accountName"); } - if (Client.ApiVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } + string apiVersion = "2021-06-01"; SyncStorageKeysInput parameters = new SyncStorageKeysInput(); if (id != null) { @@ -1106,6 +1093,7 @@ internal MediaservicesOperations(AzureMediaServicesClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); + tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("parameters", parameters); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "SyncStorageKeys", tracingParameters); @@ -1117,9 +1105,9 @@ internal MediaservicesOperations(AzureMediaServicesClient client) _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); List _queryParameters = new List(); - if (Client.ApiVersion != null) + if (apiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); } if (_queryParameters.Count > 0) { @@ -1279,10 +1267,7 @@ internal MediaservicesOperations(AzureMediaServicesClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "accountName"); } - if (Client.ApiVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } + string apiVersion = "2021-06-01"; ListEdgePoliciesInput parameters = new ListEdgePoliciesInput(); if (deviceId != null) { @@ -1297,6 +1282,7 @@ internal MediaservicesOperations(AzureMediaServicesClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); + tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("parameters", parameters); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "ListEdgePolicies", tracingParameters); @@ -1308,9 +1294,9 @@ internal MediaservicesOperations(AzureMediaServicesClient client) _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); List _queryParameters = new List(); - if (Client.ApiVersion != null) + if (apiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); } if (_queryParameters.Count > 0) { @@ -1471,10 +1457,7 @@ internal MediaservicesOperations(AzureMediaServicesClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - if (Client.ApiVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } + string apiVersion = "2021-06-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1482,6 +1465,7 @@ internal MediaservicesOperations(AzureMediaServicesClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "ListBySubscription", tracingParameters); } @@ -1490,9 +1474,9 @@ internal MediaservicesOperations(AzureMediaServicesClient client) 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)); List _queryParameters = new List(); - if (Client.ApiVersion != null) + if (apiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); } if (_queryParameters.Count > 0) { 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 0000000000000..f720e10ddcbb1 --- /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 0000000000000..7d8aa9519b38d --- /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 0000000000000..796b458e84de0 --- /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 0000000000000..9f57c3c29eb3f --- /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 0000000000000..28006f45d0ea3 --- /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 0000000000000..38134b3a294a0 --- /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 0000000000000..7adaee337ecec --- /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 8e21d8cf02b9a..3eb86d6db5b02 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 543d4976bd0e5..84a7302a85e4c 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 0000000000000..c0abd0bcef191 --- /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 0000000000000..dbd810c58b64f --- /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 b841e52c2b8eb..922839c9a0de5 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 4e7d15544a603..786d04e54cdfc 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 94c841abb0451..61cdac1105008 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 92e7173f66aad..04cf1bdd85f3f 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 0000000000000..0691977144ae8 --- /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 9991a1c4abbaa..d33cbcd467e84 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/OperationResultsGetHeaders.cs b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/OperationResultsGetHeaders.cs new file mode 100644 index 0000000000000..d553ab4312351 --- /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 0000000000000..0186bb8d97abc --- /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 1f76b59e4085d..5131acd1c6b08 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 0000000000000..acfa7785d5982 --- /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 0000000000000..a52c4a89848f0 --- /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 7eecc3a36a95e..8f66d45c8e661 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 618d0b96397f6..823c850576b0a 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 0000000000000..207765ce9f284 --- /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 0000000000000..230c4e4af6542 --- /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 0000000000000..ca63e482e2081 --- /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 0000000000000..e83b0d881755e --- /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 0000000000000..e80ff7c961ba4 --- /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 0000000000000..265905ff6d348 --- /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 0000000000000..cbd8082a9c50d --- /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 74c5c4082b7c7..58bdd630dcd18 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 0000000000000..0299dedb0dd05 --- /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 0000000000000..353e67d31e3f1 --- /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 0000000000000..16fb7b7f83f7f --- /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 0000000000000..3edc7ed5e2a15 --- /dev/null +++ b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/OperationResultsOperations.cs @@ -0,0 +1,286 @@ +// +// 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"); + } + string apiVersion = "2021-11-01"; + // 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("apiVersion", apiVersion); + 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 (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(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 0000000000000..7aa150ae272ba --- /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 0000000000000..57d0686f290b8 --- /dev/null +++ b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/OperationStatusesOperations.cs @@ -0,0 +1,273 @@ +// +// 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"); + } + string apiVersion = "2021-11-01"; + // 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("apiVersion", apiVersion); + 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 (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(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 0000000000000..c52abc6287f1f --- /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/Operations.cs b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Operations.cs index 23327575bec4d..11115d072b806 100644 --- a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Operations.cs +++ b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Operations.cs @@ -68,21 +68,12 @@ internal Operations(AzureMediaServicesClient client) /// /// 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(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (Client.ApiVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } + string apiVersion = "2021-06-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -90,6 +81,7 @@ internal Operations(AzureMediaServicesClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } @@ -97,9 +89,9 @@ internal Operations(AzureMediaServicesClient client) var _baseUrl = Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "providers/Microsoft.Media/operations").ToString(); List _queryParameters = new List(); - if (Client.ApiVersion != null) + if (apiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); } if (_queryParameters.Count > 0) { 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 030e967420750..797b652375a07 100644 --- a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/PrivateEndpointConnectionsOperations.cs +++ b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/PrivateEndpointConnectionsOperations.cs @@ -97,10 +97,7 @@ internal PrivateEndpointConnectionsOperations(AzureMediaServicesClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "accountName"); } - if (Client.ApiVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } + string apiVersion = "2021-06-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -110,6 +107,7 @@ internal PrivateEndpointConnectionsOperations(AzureMediaServicesClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); + tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } @@ -120,9 +118,9 @@ internal PrivateEndpointConnectionsOperations(AzureMediaServicesClient client) _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); List _queryParameters = new List(); - if (Client.ApiVersion != null) + if (apiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); } if (_queryParameters.Count > 0) { @@ -297,10 +295,7 @@ internal PrivateEndpointConnectionsOperations(AzureMediaServicesClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (Client.ApiVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } + string apiVersion = "2021-06-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -311,6 +306,7 @@ internal PrivateEndpointConnectionsOperations(AzureMediaServicesClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); tracingParameters.Add("name", name); + tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } @@ -322,9 +318,9 @@ internal PrivateEndpointConnectionsOperations(AzureMediaServicesClient client) _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); List _queryParameters = new List(); - if (Client.ApiVersion != null) + if (apiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); } if (_queryParameters.Count > 0) { @@ -510,10 +506,7 @@ internal PrivateEndpointConnectionsOperations(AzureMediaServicesClient client) { parameters.Validate(); } - if (Client.ApiVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } + string apiVersion = "2021-06-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -525,6 +518,7 @@ internal PrivateEndpointConnectionsOperations(AzureMediaServicesClient client) tracingParameters.Add("accountName", accountName); tracingParameters.Add("name", name); tracingParameters.Add("parameters", parameters); + tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdate", tracingParameters); } @@ -536,9 +530,9 @@ internal PrivateEndpointConnectionsOperations(AzureMediaServicesClient client) _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); List _queryParameters = new List(); - if (Client.ApiVersion != null) + if (apiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); } if (_queryParameters.Count > 0) { @@ -716,10 +710,7 @@ internal PrivateEndpointConnectionsOperations(AzureMediaServicesClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (Client.ApiVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } + string apiVersion = "2021-06-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -730,6 +721,7 @@ internal PrivateEndpointConnectionsOperations(AzureMediaServicesClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); tracingParameters.Add("name", name); + tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "Delete", tracingParameters); } @@ -741,9 +733,9 @@ internal PrivateEndpointConnectionsOperations(AzureMediaServicesClient client) _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); List _queryParameters = new List(); - if (Client.ApiVersion != null) + if (apiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); } if (_queryParameters.Count > 0) { 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 9367cddb4e6a3..be38e03c6ae03 100644 --- a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/PrivateLinkResourcesOperations.cs +++ b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/PrivateLinkResourcesOperations.cs @@ -97,10 +97,7 @@ internal PrivateLinkResourcesOperations(AzureMediaServicesClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "accountName"); } - if (Client.ApiVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } + string apiVersion = "2021-06-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -110,6 +107,7 @@ internal PrivateLinkResourcesOperations(AzureMediaServicesClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); + tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } @@ -120,9 +118,9 @@ internal PrivateLinkResourcesOperations(AzureMediaServicesClient client) _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); List _queryParameters = new List(); - if (Client.ApiVersion != null) + if (apiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); } if (_queryParameters.Count > 0) { @@ -297,10 +295,7 @@ internal PrivateLinkResourcesOperations(AzureMediaServicesClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (Client.ApiVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } + string apiVersion = "2021-06-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -311,6 +306,7 @@ internal PrivateLinkResourcesOperations(AzureMediaServicesClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); tracingParameters.Add("name", name); + tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } @@ -322,9 +318,9 @@ internal PrivateLinkResourcesOperations(AzureMediaServicesClient client) _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); List _queryParameters = new List(); - if (Client.ApiVersion != null) + if (apiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); } if (_queryParameters.Count > 0) { 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 b83a855a1ed5a..3180246ffa765 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,27 @@ 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", "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-06-01"), new Tuple("Media", "Mediaservices", "2021-06-01"), + new Tuple("Media", "OperationResults", "2021-11-01"), + new Tuple("Media", "OperationStatuses", "2021-11-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", "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 c31aa3fe594a6..6833d765f79e1 100644 --- a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/StreamingEndpointsOperations.cs +++ b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/StreamingEndpointsOperations.cs @@ -97,10 +97,7 @@ internal StreamingEndpointsOperations(AzureMediaServicesClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "accountName"); } - if (Client.ApiVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } + string apiVersion = "2021-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -110,6 +107,7 @@ internal StreamingEndpointsOperations(AzureMediaServicesClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); + tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } @@ -120,9 +118,9 @@ internal StreamingEndpointsOperations(AzureMediaServicesClient client) _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); List _queryParameters = new List(); - if (Client.ApiVersion != null) + if (apiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); } if (_queryParameters.Count > 0) { @@ -313,10 +311,7 @@ internal StreamingEndpointsOperations(AzureMediaServicesClient client) 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"); - } + string apiVersion = "2021-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -327,6 +322,7 @@ internal StreamingEndpointsOperations(AzureMediaServicesClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); tracingParameters.Add("streamingEndpointName", streamingEndpointName); + tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } @@ -338,9 +334,9 @@ internal StreamingEndpointsOperations(AzureMediaServicesClient client) _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); _url = _url.Replace("{streamingEndpointName}", System.Uri.EscapeDataString(streamingEndpointName)); List _queryParameters = new List(); - if (Client.ApiVersion != null) + if (apiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); } if (_queryParameters.Count > 0) { @@ -556,6 +552,222 @@ 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])*$"); + } + } + string apiVersion = "2021-11-01"; + // 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("apiVersion", apiVersion); + 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 (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(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 /// @@ -719,10 +931,6 @@ internal StreamingEndpointsOperations(AzureMediaServicesClient client) 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"); - } if (parameters == null) { throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); @@ -731,6 +939,7 @@ internal StreamingEndpointsOperations(AzureMediaServicesClient client) { parameters.Validate(); } + string apiVersion = "2021-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -741,6 +950,7 @@ internal StreamingEndpointsOperations(AzureMediaServicesClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); tracingParameters.Add("streamingEndpointName", streamingEndpointName); + tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("autoStart", autoStart); tracingParameters.Add("parameters", parameters); tracingParameters.Add("cancellationToken", cancellationToken); @@ -754,9 +964,9 @@ internal StreamingEndpointsOperations(AzureMediaServicesClient client) _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); _url = _url.Replace("{streamingEndpointName}", System.Uri.EscapeDataString(streamingEndpointName)); List _queryParameters = new List(); - if (Client.ApiVersion != null) + if (apiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); } if (autoStart != null) { @@ -978,14 +1188,11 @@ internal StreamingEndpointsOperations(AzureMediaServicesClient client) 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"); - } if (parameters == null) { throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); } + string apiVersion = "2021-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -996,6 +1203,7 @@ internal StreamingEndpointsOperations(AzureMediaServicesClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); tracingParameters.Add("streamingEndpointName", streamingEndpointName); + tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("parameters", parameters); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "BeginUpdate", tracingParameters); @@ -1008,9 +1216,9 @@ internal StreamingEndpointsOperations(AzureMediaServicesClient client) _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); _url = _url.Replace("{streamingEndpointName}", System.Uri.EscapeDataString(streamingEndpointName)); List _queryParameters = new List(); - if (Client.ApiVersion != null) + if (apiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); } if (_queryParameters.Count > 0) { @@ -1222,10 +1430,7 @@ internal StreamingEndpointsOperations(AzureMediaServicesClient client) 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"); - } + string apiVersion = "2021-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1236,6 +1441,7 @@ internal StreamingEndpointsOperations(AzureMediaServicesClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); tracingParameters.Add("streamingEndpointName", streamingEndpointName); + tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); } @@ -1247,9 +1453,9 @@ internal StreamingEndpointsOperations(AzureMediaServicesClient client) _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); _url = _url.Replace("{streamingEndpointName}", System.Uri.EscapeDataString(streamingEndpointName)); List _queryParameters = new List(); - if (Client.ApiVersion != null) + if (apiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); } if (_queryParameters.Count > 0) { @@ -1419,10 +1625,7 @@ internal StreamingEndpointsOperations(AzureMediaServicesClient client) 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"); - } + string apiVersion = "2021-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1433,6 +1636,7 @@ internal StreamingEndpointsOperations(AzureMediaServicesClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); tracingParameters.Add("streamingEndpointName", streamingEndpointName); + tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "BeginStart", tracingParameters); } @@ -1444,9 +1648,9 @@ internal StreamingEndpointsOperations(AzureMediaServicesClient client) _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); _url = _url.Replace("{streamingEndpointName}", System.Uri.EscapeDataString(streamingEndpointName)); List _queryParameters = new List(); - if (Client.ApiVersion != null) + if (apiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); } if (_queryParameters.Count > 0) { @@ -1616,10 +1820,7 @@ internal StreamingEndpointsOperations(AzureMediaServicesClient client) 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"); - } + string apiVersion = "2021-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1630,6 +1831,7 @@ internal StreamingEndpointsOperations(AzureMediaServicesClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); tracingParameters.Add("streamingEndpointName", streamingEndpointName); + tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "BeginStop", tracingParameters); } @@ -1641,9 +1843,9 @@ internal StreamingEndpointsOperations(AzureMediaServicesClient client) _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); _url = _url.Replace("{streamingEndpointName}", System.Uri.EscapeDataString(streamingEndpointName)); List _queryParameters = new List(); - if (Client.ApiVersion != null) + if (apiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); } if (_queryParameters.Count > 0) { @@ -1816,10 +2018,7 @@ internal StreamingEndpointsOperations(AzureMediaServicesClient client) 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"); - } + string apiVersion = "2021-11-01"; StreamingEntityScaleUnit parameters = new StreamingEntityScaleUnit(); if (scaleUnit != null) { @@ -1835,6 +2034,7 @@ internal StreamingEndpointsOperations(AzureMediaServicesClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); tracingParameters.Add("streamingEndpointName", streamingEndpointName); + tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("parameters", parameters); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "BeginScale", tracingParameters); @@ -1847,9 +2047,9 @@ internal StreamingEndpointsOperations(AzureMediaServicesClient client) _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); _url = _url.Replace("{streamingEndpointName}", System.Uri.EscapeDataString(streamingEndpointName)); List _queryParameters = new List(); - if (Client.ApiVersion != null) + if (apiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); } if (_queryParameters.Count > 0) { 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 07846cdc16aa6..4dd6db53d7f13 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/StreamingLocatorsOperations.cs b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/StreamingLocatorsOperations.cs index ec08d495b7fb2..d2af54b0e0ab0 100644 --- a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/StreamingLocatorsOperations.cs +++ b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/StreamingLocatorsOperations.cs @@ -101,10 +101,7 @@ internal StreamingLocatorsOperations(AzureMediaServicesClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "accountName"); } - if (Client.ApiVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } + string apiVersion = "2021-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -115,6 +112,7 @@ internal StreamingLocatorsOperations(AzureMediaServicesClient client) tracingParameters.Add("odataQuery", odataQuery); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); + tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } @@ -133,9 +131,9 @@ internal StreamingLocatorsOperations(AzureMediaServicesClient client) _queryParameters.Add(_odataFilter); } } - if (Client.ApiVersion != null) + if (apiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); } if (_queryParameters.Count > 0) { @@ -311,10 +309,7 @@ internal StreamingLocatorsOperations(AzureMediaServicesClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "streamingLocatorName"); } - if (Client.ApiVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } + string apiVersion = "2021-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -325,6 +320,7 @@ internal StreamingLocatorsOperations(AzureMediaServicesClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); tracingParameters.Add("streamingLocatorName", streamingLocatorName); + tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } @@ -336,9 +332,9 @@ internal StreamingLocatorsOperations(AzureMediaServicesClient client) _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); _url = _url.Replace("{streamingLocatorName}", System.Uri.EscapeDataString(streamingLocatorName)); List _queryParameters = new List(); - if (Client.ApiVersion != null) + if (apiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); } if (_queryParameters.Count > 0) { @@ -525,10 +521,7 @@ internal StreamingLocatorsOperations(AzureMediaServicesClient client) { parameters.Validate(); } - if (Client.ApiVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } + string apiVersion = "2021-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -540,6 +533,7 @@ internal StreamingLocatorsOperations(AzureMediaServicesClient client) tracingParameters.Add("accountName", accountName); tracingParameters.Add("streamingLocatorName", streamingLocatorName); tracingParameters.Add("parameters", parameters); + tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "Create", tracingParameters); } @@ -551,9 +545,9 @@ internal StreamingLocatorsOperations(AzureMediaServicesClient client) _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); _url = _url.Replace("{streamingLocatorName}", System.Uri.EscapeDataString(streamingLocatorName)); List _queryParameters = new List(); - if (Client.ApiVersion != null) + if (apiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); } if (_queryParameters.Count > 0) { @@ -732,10 +726,7 @@ internal StreamingLocatorsOperations(AzureMediaServicesClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "streamingLocatorName"); } - if (Client.ApiVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } + string apiVersion = "2021-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -746,6 +737,7 @@ internal StreamingLocatorsOperations(AzureMediaServicesClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); tracingParameters.Add("streamingLocatorName", streamingLocatorName); + tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "Delete", tracingParameters); } @@ -757,9 +749,9 @@ internal StreamingLocatorsOperations(AzureMediaServicesClient client) _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); _url = _url.Replace("{streamingLocatorName}", System.Uri.EscapeDataString(streamingLocatorName)); List _queryParameters = new List(); - if (Client.ApiVersion != null) + if (apiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); } if (_queryParameters.Count > 0) { @@ -917,10 +909,7 @@ internal StreamingLocatorsOperations(AzureMediaServicesClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "streamingLocatorName"); } - if (Client.ApiVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } + string apiVersion = "2021-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -931,6 +920,7 @@ internal StreamingLocatorsOperations(AzureMediaServicesClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); tracingParameters.Add("streamingLocatorName", streamingLocatorName); + tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "ListContentKeys", tracingParameters); } @@ -942,9 +932,9 @@ internal StreamingLocatorsOperations(AzureMediaServicesClient client) _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); _url = _url.Replace("{streamingLocatorName}", System.Uri.EscapeDataString(streamingLocatorName)); List _queryParameters = new List(); - if (Client.ApiVersion != null) + if (apiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); } if (_queryParameters.Count > 0) { @@ -1120,10 +1110,7 @@ internal StreamingLocatorsOperations(AzureMediaServicesClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "streamingLocatorName"); } - if (Client.ApiVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } + string apiVersion = "2021-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1134,6 +1121,7 @@ internal StreamingLocatorsOperations(AzureMediaServicesClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); tracingParameters.Add("streamingLocatorName", streamingLocatorName); + tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "ListPaths", tracingParameters); } @@ -1145,9 +1133,9 @@ internal StreamingLocatorsOperations(AzureMediaServicesClient client) _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); _url = _url.Replace("{streamingLocatorName}", System.Uri.EscapeDataString(streamingLocatorName)); List _queryParameters = new List(); - if (Client.ApiVersion != null) + if (apiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); } if (_queryParameters.Count > 0) { diff --git a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/StreamingPoliciesOperations.cs b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/StreamingPoliciesOperations.cs index 99dda0480a614..4f2294e1a78e2 100644 --- a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/StreamingPoliciesOperations.cs +++ b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/StreamingPoliciesOperations.cs @@ -101,10 +101,7 @@ internal StreamingPoliciesOperations(AzureMediaServicesClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "accountName"); } - if (Client.ApiVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } + string apiVersion = "2021-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -115,6 +112,7 @@ internal StreamingPoliciesOperations(AzureMediaServicesClient client) tracingParameters.Add("odataQuery", odataQuery); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); + tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } @@ -133,9 +131,9 @@ internal StreamingPoliciesOperations(AzureMediaServicesClient client) _queryParameters.Add(_odataFilter); } } - if (Client.ApiVersion != null) + if (apiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); } if (_queryParameters.Count > 0) { @@ -311,10 +309,7 @@ internal StreamingPoliciesOperations(AzureMediaServicesClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "streamingPolicyName"); } - if (Client.ApiVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } + string apiVersion = "2021-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -325,6 +320,7 @@ internal StreamingPoliciesOperations(AzureMediaServicesClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); tracingParameters.Add("streamingPolicyName", streamingPolicyName); + tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } @@ -336,9 +332,9 @@ internal StreamingPoliciesOperations(AzureMediaServicesClient client) _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); _url = _url.Replace("{streamingPolicyName}", System.Uri.EscapeDataString(streamingPolicyName)); List _queryParameters = new List(); - if (Client.ApiVersion != null) + if (apiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); } if (_queryParameters.Count > 0) { @@ -525,10 +521,7 @@ internal StreamingPoliciesOperations(AzureMediaServicesClient client) { parameters.Validate(); } - if (Client.ApiVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } + string apiVersion = "2021-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -540,6 +533,7 @@ internal StreamingPoliciesOperations(AzureMediaServicesClient client) tracingParameters.Add("accountName", accountName); tracingParameters.Add("streamingPolicyName", streamingPolicyName); tracingParameters.Add("parameters", parameters); + tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "Create", tracingParameters); } @@ -551,9 +545,9 @@ internal StreamingPoliciesOperations(AzureMediaServicesClient client) _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); _url = _url.Replace("{streamingPolicyName}", System.Uri.EscapeDataString(streamingPolicyName)); List _queryParameters = new List(); - if (Client.ApiVersion != null) + if (apiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); } if (_queryParameters.Count > 0) { @@ -732,10 +726,7 @@ internal StreamingPoliciesOperations(AzureMediaServicesClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "streamingPolicyName"); } - if (Client.ApiVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } + string apiVersion = "2021-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -746,6 +737,7 @@ internal StreamingPoliciesOperations(AzureMediaServicesClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); tracingParameters.Add("streamingPolicyName", streamingPolicyName); + tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "Delete", tracingParameters); } @@ -757,9 +749,9 @@ internal StreamingPoliciesOperations(AzureMediaServicesClient client) _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); _url = _url.Replace("{streamingPolicyName}", System.Uri.EscapeDataString(streamingPolicyName)); List _queryParameters = new List(); - if (Client.ApiVersion != null) + if (apiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); } if (_queryParameters.Count > 0) { 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 0000000000000..639e18852b132 --- /dev/null +++ b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/TracksOperations.cs @@ -0,0 +1,1503 @@ +// +// 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"); + } + string apiVersion = "2021-11-01"; + // 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("apiVersion", apiVersion); + 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 (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(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"); + } + string apiVersion = "2021-11-01"; + // 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("apiVersion", apiVersion); + 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 (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(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"); + } + string apiVersion = "2021-11-01"; + 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("apiVersion", apiVersion); + 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 (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(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"); + } + string apiVersion = "2021-11-01"; + // 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("apiVersion", apiVersion); + 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 (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(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"); + } + string apiVersion = "2021-11-01"; + 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("apiVersion", apiVersion); + 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 (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(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"); + } + string apiVersion = "2021-11-01"; + // 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("apiVersion", apiVersion); + 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 (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(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 0000000000000..06091006f7caf --- /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; + } + } + + } +} diff --git a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/TransformsOperations.cs b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/TransformsOperations.cs index b7884438d1919..a8bbeb22e3fb5 100644 --- a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/TransformsOperations.cs +++ b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/TransformsOperations.cs @@ -101,10 +101,7 @@ internal TransformsOperations(AzureMediaServicesClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "accountName"); } - if (Client.ApiVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } + string apiVersion = "2021-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -115,6 +112,7 @@ internal TransformsOperations(AzureMediaServicesClient client) tracingParameters.Add("odataQuery", odataQuery); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); + tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } @@ -133,9 +131,9 @@ internal TransformsOperations(AzureMediaServicesClient client) _queryParameters.Add(_odataFilter); } } - if (Client.ApiVersion != null) + if (apiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); } if (_queryParameters.Count > 0) { @@ -311,10 +309,7 @@ internal TransformsOperations(AzureMediaServicesClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "transformName"); } - if (Client.ApiVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } + string apiVersion = "2021-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -325,6 +320,7 @@ internal TransformsOperations(AzureMediaServicesClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); tracingParameters.Add("transformName", transformName); + tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } @@ -336,9 +332,9 @@ internal TransformsOperations(AzureMediaServicesClient client) _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); _url = _url.Replace("{transformName}", System.Uri.EscapeDataString(transformName)); List _queryParameters = new List(); - if (Client.ApiVersion != null) + if (apiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); } if (_queryParameters.Count > 0) { @@ -521,10 +517,6 @@ internal TransformsOperations(AzureMediaServicesClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "transformName"); } - if (Client.ApiVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } if (outputs == null) { throw new ValidationException(ValidationRules.CannotBeNull, "outputs"); @@ -539,6 +531,7 @@ internal TransformsOperations(AzureMediaServicesClient client) } } } + string apiVersion = "2021-11-01"; Transform parameters = new Transform(); if (description != null || outputs != null) { @@ -555,6 +548,7 @@ internal TransformsOperations(AzureMediaServicesClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); tracingParameters.Add("transformName", transformName); + tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("parameters", parameters); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdate", tracingParameters); @@ -567,9 +561,9 @@ internal TransformsOperations(AzureMediaServicesClient client) _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); _url = _url.Replace("{transformName}", System.Uri.EscapeDataString(transformName)); List _queryParameters = new List(); - if (Client.ApiVersion != null) + if (apiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); } if (_queryParameters.Count > 0) { @@ -766,10 +760,7 @@ internal TransformsOperations(AzureMediaServicesClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "transformName"); } - if (Client.ApiVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } + string apiVersion = "2021-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -780,6 +771,7 @@ internal TransformsOperations(AzureMediaServicesClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); tracingParameters.Add("transformName", transformName); + tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "Delete", tracingParameters); } @@ -791,9 +783,9 @@ internal TransformsOperations(AzureMediaServicesClient client) _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); _url = _url.Replace("{transformName}", System.Uri.EscapeDataString(transformName)); List _queryParameters = new List(); - if (Client.ApiVersion != null) + if (apiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); } if (_queryParameters.Count > 0) { @@ -958,10 +950,6 @@ internal TransformsOperations(AzureMediaServicesClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "transformName"); } - if (Client.ApiVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } if (outputs == null) { throw new ValidationException(ValidationRules.CannotBeNull, "outputs"); @@ -976,6 +964,7 @@ internal TransformsOperations(AzureMediaServicesClient client) } } } + string apiVersion = "2021-11-01"; Transform parameters = new Transform(); if (description != null || outputs != null) { @@ -992,6 +981,7 @@ internal TransformsOperations(AzureMediaServicesClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); tracingParameters.Add("transformName", transformName); + tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("parameters", parameters); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "Update", tracingParameters); @@ -1004,9 +994,9 @@ internal TransformsOperations(AzureMediaServicesClient client) _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); _url = _url.Replace("{transformName}", System.Uri.EscapeDataString(transformName)); List _queryParameters = new List(); - if (Client.ApiVersion != null) + if (apiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); } if (_queryParameters.Count > 0) {