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 74865642e5b8..ef9453394a36 100644 --- a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/AccountFiltersOperations.cs +++ b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/AccountFiltersOperations.cs @@ -68,7 +68,7 @@ internal AccountFiltersOperations(AzureMediaServicesClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -97,7 +97,10 @@ internal AccountFiltersOperations(AzureMediaServicesClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "accountName"); } - string apiVersion = "2020-05-01"; + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -107,7 +110,6 @@ 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); } @@ -118,9 +120,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 (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -182,11 +184,11 @@ internal AccountFiltersOperations(AzureMediaServicesClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new ApiErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ApiError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; @@ -263,7 +265,7 @@ internal AccountFiltersOperations(AzureMediaServicesClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -296,7 +298,10 @@ internal AccountFiltersOperations(AzureMediaServicesClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "filterName"); } - string apiVersion = "2020-05-01"; + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -307,7 +312,6 @@ 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); } @@ -319,9 +323,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 (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -381,13 +385,13 @@ internal AccountFiltersOperations(AzureMediaServicesClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 404) + if ((int)_statusCode != 200) { - var ex = new ApiErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ApiError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; @@ -467,7 +471,7 @@ internal AccountFiltersOperations(AzureMediaServicesClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -508,7 +512,10 @@ internal AccountFiltersOperations(AzureMediaServicesClient client) { parameters.Validate(); } - string apiVersion = "2020-05-01"; + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -520,7 +527,6 @@ 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); } @@ -532,9 +538,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 (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -602,11 +608,11 @@ internal AccountFiltersOperations(AzureMediaServicesClient client) string _responseContent = null; if ((int)_statusCode != 200 && (int)_statusCode != 201) { - var ex = new ApiErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ApiError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; @@ -701,7 +707,7 @@ internal AccountFiltersOperations(AzureMediaServicesClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -731,7 +737,10 @@ internal AccountFiltersOperations(AzureMediaServicesClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "filterName"); } - string apiVersion = "2020-05-01"; + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -742,7 +751,6 @@ 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); } @@ -754,9 +762,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 (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -818,11 +826,11 @@ internal AccountFiltersOperations(AzureMediaServicesClient client) string _responseContent = null; if ((int)_statusCode != 200 && (int)_statusCode != 204) { - var ex = new ApiErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ApiError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; @@ -884,7 +892,7 @@ internal AccountFiltersOperations(AzureMediaServicesClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -921,7 +929,10 @@ internal AccountFiltersOperations(AzureMediaServicesClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); } - string apiVersion = "2020-05-01"; + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -933,7 +944,6 @@ 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); } @@ -945,9 +955,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 (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -1015,11 +1025,11 @@ internal AccountFiltersOperations(AzureMediaServicesClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new ApiErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ApiError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; @@ -1090,7 +1100,7 @@ internal AccountFiltersOperations(AzureMediaServicesClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -1186,11 +1196,11 @@ internal AccountFiltersOperations(AzureMediaServicesClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new ApiErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ApiError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; 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 6926c5d20854..7dfde3d47d60 100644 --- a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/AssetFiltersOperations.cs +++ b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/AssetFiltersOperations.cs @@ -71,7 +71,7 @@ internal AssetFiltersOperations(AzureMediaServicesClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -104,7 +104,10 @@ internal AssetFiltersOperations(AzureMediaServicesClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "assetName"); } - string apiVersion = "2020-05-01"; + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -115,7 +118,6 @@ 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); } @@ -127,9 +129,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 (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -191,11 +193,11 @@ internal AssetFiltersOperations(AzureMediaServicesClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new ApiErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ApiError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; @@ -275,7 +277,7 @@ internal AssetFiltersOperations(AzureMediaServicesClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -312,7 +314,10 @@ internal AssetFiltersOperations(AzureMediaServicesClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "filterName"); } - string apiVersion = "2020-05-01"; + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -324,7 +329,6 @@ 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); } @@ -337,9 +341,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 (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -399,13 +403,13 @@ internal AssetFiltersOperations(AzureMediaServicesClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 404) + if ((int)_statusCode != 200) { - var ex = new ApiErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ApiError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; @@ -488,7 +492,7 @@ internal AssetFiltersOperations(AzureMediaServicesClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -533,7 +537,10 @@ internal AssetFiltersOperations(AzureMediaServicesClient client) { parameters.Validate(); } - string apiVersion = "2020-05-01"; + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -546,7 +553,6 @@ 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); } @@ -559,9 +565,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 (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -629,11 +635,11 @@ internal AssetFiltersOperations(AzureMediaServicesClient client) string _responseContent = null; if ((int)_statusCode != 200 && (int)_statusCode != 201) { - var ex = new ApiErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ApiError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; @@ -731,7 +737,7 @@ internal AssetFiltersOperations(AzureMediaServicesClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -765,7 +771,10 @@ internal AssetFiltersOperations(AzureMediaServicesClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "filterName"); } - string apiVersion = "2020-05-01"; + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -777,7 +786,6 @@ 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); } @@ -790,9 +798,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 (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -854,11 +862,11 @@ internal AssetFiltersOperations(AzureMediaServicesClient client) string _responseContent = null; if ((int)_statusCode != 200 && (int)_statusCode != 204) { - var ex = new ApiErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ApiError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; @@ -923,7 +931,7 @@ internal AssetFiltersOperations(AzureMediaServicesClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -964,7 +972,10 @@ internal AssetFiltersOperations(AzureMediaServicesClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); } - string apiVersion = "2020-05-01"; + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -977,7 +988,6 @@ 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); } @@ -990,9 +1000,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 (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -1060,11 +1070,11 @@ internal AssetFiltersOperations(AzureMediaServicesClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new ApiErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ApiError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; @@ -1135,7 +1145,7 @@ internal AssetFiltersOperations(AzureMediaServicesClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -1231,11 +1241,11 @@ internal AssetFiltersOperations(AzureMediaServicesClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new ApiErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ApiError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; 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 2eb5e3bf8ba1..9edaf7b7a9ce 100644 --- a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/AssetsOperations.cs +++ b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/AssetsOperations.cs @@ -73,7 +73,7 @@ internal AssetsOperations(AzureMediaServicesClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -102,7 +102,10 @@ internal AssetsOperations(AzureMediaServicesClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "accountName"); } - string apiVersion = "2020-05-01"; + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -113,7 +116,6 @@ 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); } @@ -132,9 +134,9 @@ internal AssetsOperations(AzureMediaServicesClient client) _queryParameters.Add(_odataFilter); } } - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -196,11 +198,11 @@ internal AssetsOperations(AzureMediaServicesClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new ApiErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ApiError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; @@ -277,7 +279,7 @@ internal AssetsOperations(AzureMediaServicesClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -310,7 +312,10 @@ internal AssetsOperations(AzureMediaServicesClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "assetName"); } - string apiVersion = "2020-05-01"; + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -321,7 +326,6 @@ 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); } @@ -333,9 +337,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 (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -395,13 +399,13 @@ internal AssetsOperations(AzureMediaServicesClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 404) + if ((int)_statusCode != 200) { - var ex = new ApiErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ApiError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; @@ -481,7 +485,7 @@ internal AssetsOperations(AzureMediaServicesClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -518,7 +522,10 @@ internal AssetsOperations(AzureMediaServicesClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); } - string apiVersion = "2020-05-01"; + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -530,7 +537,6 @@ 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); } @@ -542,9 +548,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 (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -612,11 +618,11 @@ internal AssetsOperations(AzureMediaServicesClient client) string _responseContent = null; if ((int)_statusCode != 200 && (int)_statusCode != 201) { - var ex = new ApiErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ApiError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; @@ -711,7 +717,7 @@ internal AssetsOperations(AzureMediaServicesClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -741,7 +747,10 @@ internal AssetsOperations(AzureMediaServicesClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "assetName"); } - string apiVersion = "2020-05-01"; + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -752,7 +761,6 @@ 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); } @@ -764,9 +772,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 (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -828,11 +836,11 @@ internal AssetsOperations(AzureMediaServicesClient client) string _responseContent = null; if ((int)_statusCode != 200 && (int)_statusCode != 204) { - var ex = new ApiErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ApiError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; @@ -894,7 +902,7 @@ internal AssetsOperations(AzureMediaServicesClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -931,7 +939,10 @@ internal AssetsOperations(AzureMediaServicesClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); } - string apiVersion = "2020-05-01"; + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -943,7 +954,6 @@ 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); } @@ -955,9 +965,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 (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -1025,11 +1035,11 @@ internal AssetsOperations(AzureMediaServicesClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new ApiErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ApiError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; @@ -1116,7 +1126,7 @@ internal AssetsOperations(AzureMediaServicesClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -1149,7 +1159,10 @@ internal AssetsOperations(AzureMediaServicesClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "assetName"); } - string apiVersion = "2020-05-01"; + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } ListContainerSasInput parameters = new ListContainerSasInput(); if (permissions != null || expiryTime != null) { @@ -1166,7 +1179,6 @@ 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); @@ -1179,9 +1191,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 (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -1249,11 +1261,11 @@ internal AssetsOperations(AzureMediaServicesClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new ApiErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ApiError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; @@ -1331,7 +1343,7 @@ internal AssetsOperations(AzureMediaServicesClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -1364,7 +1376,10 @@ internal AssetsOperations(AzureMediaServicesClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "assetName"); } - string apiVersion = "2020-05-01"; + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1375,7 +1390,6 @@ 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); } @@ -1387,9 +1401,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 (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -1451,11 +1465,11 @@ internal AssetsOperations(AzureMediaServicesClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new ApiErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ApiError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; @@ -1532,7 +1546,7 @@ internal AssetsOperations(AzureMediaServicesClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -1565,7 +1579,10 @@ internal AssetsOperations(AzureMediaServicesClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "assetName"); } - string apiVersion = "2020-05-01"; + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1576,7 +1593,6 @@ 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); } @@ -1588,9 +1604,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 (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -1652,11 +1668,11 @@ internal AssetsOperations(AzureMediaServicesClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new ApiErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ApiError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; @@ -1728,7 +1744,7 @@ internal AssetsOperations(AzureMediaServicesClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -1824,11 +1840,11 @@ internal AssetsOperations(AzureMediaServicesClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new ApiErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ApiError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; 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 ecf5f4178e36..0a177a9973d0 100644 --- a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/AzureMediaServicesClient.cs +++ b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/AzureMediaServicesClient.cs @@ -48,6 +48,11 @@ 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. /// @@ -66,11 +71,6 @@ public partial class AzureMediaServicesClient : ServiceClient public bool? GenerateClientRequestId { get; set; } - /// - /// Gets the IAccountFiltersOperations. - /// - public virtual IAccountFiltersOperations AccountFilters { get; private set; } - /// /// Gets the IOperations. /// @@ -96,6 +96,11 @@ 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. /// @@ -387,12 +392,12 @@ 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); ContentKeyPolicies = new ContentKeyPoliciesOperations(this); @@ -404,6 +409,7 @@ 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; 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 f4b2da46ce48..aa14959a3358 100644 --- a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/ContentKeyPoliciesOperations.cs +++ b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/ContentKeyPoliciesOperations.cs @@ -72,7 +72,7 @@ internal ContentKeyPoliciesOperations(AzureMediaServicesClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -101,7 +101,10 @@ internal ContentKeyPoliciesOperations(AzureMediaServicesClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "accountName"); } - string apiVersion = "2020-05-01"; + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -112,7 +115,6 @@ 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); } @@ -131,9 +133,9 @@ internal ContentKeyPoliciesOperations(AzureMediaServicesClient client) _queryParameters.Add(_odataFilter); } } - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -195,11 +197,11 @@ internal ContentKeyPoliciesOperations(AzureMediaServicesClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new ApiErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ApiError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; @@ -276,7 +278,7 @@ internal ContentKeyPoliciesOperations(AzureMediaServicesClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -309,7 +311,10 @@ internal ContentKeyPoliciesOperations(AzureMediaServicesClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "contentKeyPolicyName"); } - string apiVersion = "2020-05-01"; + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -320,7 +325,6 @@ 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); } @@ -332,9 +336,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 (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -394,13 +398,13 @@ internal ContentKeyPoliciesOperations(AzureMediaServicesClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 404) + if ((int)_statusCode != 200) { - var ex = new ApiErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ApiError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; @@ -483,7 +487,7 @@ internal ContentKeyPoliciesOperations(AzureMediaServicesClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -516,6 +520,10 @@ 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"); @@ -530,7 +538,6 @@ internal ContentKeyPoliciesOperations(AzureMediaServicesClient client) } } } - string apiVersion = "2020-05-01"; ContentKeyPolicy parameters = new ContentKeyPolicy(); if (description != null || options != null) { @@ -547,7 +554,6 @@ 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); @@ -560,9 +566,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 (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -630,11 +636,11 @@ internal ContentKeyPoliciesOperations(AzureMediaServicesClient client) string _responseContent = null; if ((int)_statusCode != 200 && (int)_statusCode != 201) { - var ex = new ApiErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ApiError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; @@ -729,7 +735,7 @@ internal ContentKeyPoliciesOperations(AzureMediaServicesClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -759,7 +765,10 @@ internal ContentKeyPoliciesOperations(AzureMediaServicesClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "contentKeyPolicyName"); } - string apiVersion = "2020-05-01"; + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -770,7 +779,6 @@ 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); } @@ -782,9 +790,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 (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -846,11 +854,11 @@ internal ContentKeyPoliciesOperations(AzureMediaServicesClient client) string _responseContent = null; if ((int)_statusCode != 200 && (int)_statusCode != 204) { - var ex = new ApiErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ApiError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; @@ -915,7 +923,7 @@ internal ContentKeyPoliciesOperations(AzureMediaServicesClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -948,6 +956,10 @@ 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"); @@ -962,7 +974,6 @@ internal ContentKeyPoliciesOperations(AzureMediaServicesClient client) } } } - string apiVersion = "2020-05-01"; ContentKeyPolicy parameters = new ContentKeyPolicy(); if (description != null || options != null) { @@ -979,7 +990,6 @@ 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); @@ -992,9 +1002,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 (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -1062,11 +1072,11 @@ internal ContentKeyPoliciesOperations(AzureMediaServicesClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new ApiErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ApiError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; @@ -1143,7 +1153,7 @@ internal ContentKeyPoliciesOperations(AzureMediaServicesClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -1176,7 +1186,10 @@ internal ContentKeyPoliciesOperations(AzureMediaServicesClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "contentKeyPolicyName"); } - string apiVersion = "2020-05-01"; + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1187,7 +1200,6 @@ 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); } @@ -1199,9 +1211,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 (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -1261,13 +1273,13 @@ internal ContentKeyPoliciesOperations(AzureMediaServicesClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 404) + if ((int)_statusCode != 200) { - var ex = new ApiErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ApiError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; @@ -1338,7 +1350,7 @@ internal ContentKeyPoliciesOperations(AzureMediaServicesClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -1434,11 +1446,11 @@ internal ContentKeyPoliciesOperations(AzureMediaServicesClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new ApiErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ApiError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; diff --git a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/IAccountFiltersOperations.cs b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/IAccountFiltersOperations.cs index 4625d53a855a..7f556ecff710 100644 --- a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/IAccountFiltersOperations.cs +++ b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/IAccountFiltersOperations.cs @@ -41,7 +41,7 @@ public partial interface IAccountFiltersOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -72,7 +72,7 @@ public partial interface IAccountFiltersOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -106,7 +106,7 @@ public partial interface IAccountFiltersOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -137,7 +137,7 @@ public partial interface IAccountFiltersOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -168,7 +168,7 @@ public partial interface IAccountFiltersOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -193,7 +193,7 @@ public partial interface IAccountFiltersOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// diff --git a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/IAssetFiltersOperations.cs b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/IAssetFiltersOperations.cs index 4ef44450f10a..9fc4523e893f 100644 --- a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/IAssetFiltersOperations.cs +++ b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/IAssetFiltersOperations.cs @@ -44,7 +44,7 @@ public partial interface IAssetFiltersOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -79,7 +79,7 @@ public partial interface IAssetFiltersOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -117,7 +117,7 @@ public partial interface IAssetFiltersOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -151,7 +151,7 @@ public partial interface IAssetFiltersOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -186,7 +186,7 @@ public partial interface IAssetFiltersOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -211,7 +211,7 @@ public partial interface IAssetFiltersOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// diff --git a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/IAssetsOperations.cs b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/IAssetsOperations.cs index 8c814068c5ee..7d112a496dd8 100644 --- a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/IAssetsOperations.cs +++ b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/IAssetsOperations.cs @@ -46,7 +46,7 @@ public partial interface IAssetsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -77,7 +77,7 @@ public partial interface IAssetsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -111,7 +111,7 @@ public partial interface IAssetsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -142,7 +142,7 @@ public partial interface IAssetsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -173,7 +173,7 @@ public partial interface IAssetsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -214,7 +214,7 @@ public partial interface IAssetsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -246,7 +246,7 @@ public partial interface IAssetsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -277,7 +277,7 @@ public partial interface IAssetsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -303,7 +303,7 @@ public partial interface IAssetsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// 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 2a8f5b8510cb..d15d89845dac 100644 --- a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/IAzureMediaServicesClient.cs +++ b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/IAzureMediaServicesClient.cs @@ -44,6 +44,11 @@ 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. /// @@ -63,11 +68,6 @@ public partial interface IAzureMediaServicesClient : System.IDisposable bool? GenerateClientRequestId { get; set; } - /// - /// Gets the IAccountFiltersOperations. - /// - IAccountFiltersOperations AccountFilters { get; } - /// /// Gets the IOperations. /// @@ -93,6 +93,11 @@ public partial interface IAzureMediaServicesClient : System.IDisposable /// ILocationsOperations Locations { get; } + /// + /// Gets the IAccountFiltersOperations. + /// + IAccountFiltersOperations AccountFilters { get; } + /// /// Gets the IAssetsOperations. /// diff --git a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/IContentKeyPoliciesOperations.cs b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/IContentKeyPoliciesOperations.cs index f23639599569..ab7dcbc32e5d 100644 --- a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/IContentKeyPoliciesOperations.cs +++ b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/IContentKeyPoliciesOperations.cs @@ -45,7 +45,7 @@ public partial interface IContentKeyPoliciesOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -77,7 +77,7 @@ public partial interface IContentKeyPoliciesOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -114,7 +114,7 @@ public partial interface IContentKeyPoliciesOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -145,7 +145,7 @@ public partial interface IContentKeyPoliciesOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -180,7 +180,7 @@ public partial interface IContentKeyPoliciesOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -211,7 +211,7 @@ public partial interface IContentKeyPoliciesOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -236,7 +236,7 @@ public partial interface IContentKeyPoliciesOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// diff --git a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/IJobsOperations.cs b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/IJobsOperations.cs index 8e04bc61e91b..2bc1b4a9b321 100644 --- a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/IJobsOperations.cs +++ b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/IJobsOperations.cs @@ -48,7 +48,7 @@ public partial interface IJobsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -82,7 +82,7 @@ public partial interface IJobsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -119,7 +119,7 @@ public partial interface IJobsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -153,7 +153,7 @@ public partial interface IJobsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -189,7 +189,7 @@ public partial interface IJobsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -223,7 +223,7 @@ public partial interface IJobsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -245,7 +245,7 @@ public partial interface IJobsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// diff --git a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/ILiveEventsOperations.cs b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/ILiveEventsOperations.cs index a9e1280440f0..9b029e5459fd 100644 --- a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/ILiveEventsOperations.cs +++ b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/ILiveEventsOperations.cs @@ -41,7 +41,7 @@ public partial interface ILiveEventsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -72,7 +72,7 @@ public partial interface ILiveEventsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -110,7 +110,7 @@ public partial interface ILiveEventsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -141,7 +141,7 @@ public partial interface ILiveEventsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -172,7 +172,7 @@ public partial interface ILiveEventsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -201,7 +201,7 @@ public partial interface ILiveEventsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -230,7 +230,7 @@ public partial interface ILiveEventsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -263,7 +263,7 @@ public partial interface ILiveEventsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -294,7 +294,7 @@ public partial interface ILiveEventsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -329,7 +329,7 @@ public partial interface ILiveEventsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -360,7 +360,7 @@ public partial interface ILiveEventsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -391,7 +391,7 @@ public partial interface ILiveEventsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -420,7 +420,7 @@ public partial interface ILiveEventsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -449,7 +449,7 @@ public partial interface ILiveEventsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -482,7 +482,7 @@ public partial interface ILiveEventsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -513,7 +513,7 @@ public partial interface ILiveEventsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -535,7 +535,7 @@ public partial interface ILiveEventsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// diff --git a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/ILiveOutputsOperations.cs b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/ILiveOutputsOperations.cs index 224bb03e5d7d..4d7e409ef503 100644 --- a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/ILiveOutputsOperations.cs +++ b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/ILiveOutputsOperations.cs @@ -44,7 +44,7 @@ public partial interface ILiveOutputsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -78,7 +78,7 @@ public partial interface ILiveOutputsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -115,7 +115,7 @@ public partial interface ILiveOutputsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -150,7 +150,7 @@ public partial interface ILiveOutputsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -184,7 +184,7 @@ public partial interface ILiveOutputsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -219,7 +219,7 @@ public partial interface ILiveOutputsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -241,7 +241,7 @@ public partial interface ILiveOutputsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// diff --git a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/ILocationsOperations.cs b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/ILocationsOperations.cs index 89c3efb78814..8901a7a10cfa 100644 --- a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/ILocationsOperations.cs +++ b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/ILocationsOperations.cs @@ -45,7 +45,7 @@ public partial interface ILocationsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// diff --git a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/IMediaservicesOperations.cs b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/IMediaservicesOperations.cs index ff6e3c6cd301..28bd032bc784 100644 --- a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/IMediaservicesOperations.cs +++ b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/IMediaservicesOperations.cs @@ -38,7 +38,7 @@ public partial interface IMediaservicesOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -66,7 +66,7 @@ public partial interface IMediaservicesOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -97,7 +97,7 @@ public partial interface IMediaservicesOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -125,7 +125,7 @@ public partial interface IMediaservicesOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -153,7 +153,7 @@ public partial interface IMediaservicesOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -185,7 +185,7 @@ public partial interface IMediaservicesOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -215,7 +215,7 @@ public partial interface IMediaservicesOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -237,7 +237,7 @@ public partial interface IMediaservicesOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -262,7 +262,7 @@ public partial interface IMediaservicesOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -287,7 +287,7 @@ public partial interface IMediaservicesOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// diff --git a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/IOperations.cs b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/IOperations.cs index 1a705a848b9d..532d6c8cbf5a 100644 --- a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/IOperations.cs +++ b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/IOperations.cs @@ -35,7 +35,7 @@ public partial interface IOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -44,31 +44,6 @@ public partial interface IOperations /// /// Thrown when a required parameter is null /// - Task>> ListWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// List Operations - /// - /// - /// Lists all the Media Services operations. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// 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>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> ListWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); } } diff --git a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/IPrivateEndpointConnectionsOperations.cs b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/IPrivateEndpointConnectionsOperations.cs index d603da1f27c6..e2f5da63fd0e 100644 --- a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/IPrivateEndpointConnectionsOperations.cs +++ b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/IPrivateEndpointConnectionsOperations.cs @@ -41,7 +41,7 @@ public partial interface IPrivateEndpointConnectionsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -71,7 +71,7 @@ public partial interface IPrivateEndpointConnectionsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -104,7 +104,7 @@ public partial interface IPrivateEndpointConnectionsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -134,7 +134,7 @@ public partial interface IPrivateEndpointConnectionsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// diff --git a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/IPrivateLinkResourcesOperations.cs b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/IPrivateLinkResourcesOperations.cs index 755c6339fcbb..517e9113979d 100644 --- a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/IPrivateLinkResourcesOperations.cs +++ b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/IPrivateLinkResourcesOperations.cs @@ -41,7 +41,7 @@ public partial interface IPrivateLinkResourcesOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -71,7 +71,7 @@ public partial interface IPrivateLinkResourcesOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// 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 4a02e7025d36..d33681c68602 100644 --- a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/IStreamingEndpointsOperations.cs +++ b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/IStreamingEndpointsOperations.cs @@ -41,7 +41,7 @@ public partial interface IStreamingEndpointsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -72,7 +72,7 @@ public partial interface IStreamingEndpointsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -110,7 +110,7 @@ public partial interface IStreamingEndpointsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -144,7 +144,7 @@ public partial interface IStreamingEndpointsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -175,7 +175,7 @@ public partial interface IStreamingEndpointsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -203,7 +203,7 @@ public partial interface IStreamingEndpointsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -231,7 +231,7 @@ public partial interface IStreamingEndpointsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -262,7 +262,7 @@ public partial interface IStreamingEndpointsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -297,7 +297,7 @@ public partial interface IStreamingEndpointsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -331,7 +331,7 @@ public partial interface IStreamingEndpointsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -362,7 +362,7 @@ public partial interface IStreamingEndpointsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -390,7 +390,7 @@ public partial interface IStreamingEndpointsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -418,7 +418,7 @@ public partial interface IStreamingEndpointsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -449,7 +449,7 @@ public partial interface IStreamingEndpointsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -471,7 +471,7 @@ public partial interface IStreamingEndpointsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// diff --git a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/IStreamingLocatorsOperations.cs b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/IStreamingLocatorsOperations.cs index 951b735e229a..e07495cd17a5 100644 --- a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/IStreamingLocatorsOperations.cs +++ b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/IStreamingLocatorsOperations.cs @@ -45,7 +45,7 @@ public partial interface IStreamingLocatorsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -77,7 +77,7 @@ public partial interface IStreamingLocatorsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -111,7 +111,7 @@ public partial interface IStreamingLocatorsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -142,7 +142,7 @@ public partial interface IStreamingLocatorsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -170,7 +170,7 @@ public partial interface IStreamingLocatorsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -201,7 +201,7 @@ public partial interface IStreamingLocatorsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -226,7 +226,7 @@ public partial interface IStreamingLocatorsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// diff --git a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/IStreamingPoliciesOperations.cs b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/IStreamingPoliciesOperations.cs index 6d417e029a6a..5fd74a77c225 100644 --- a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/IStreamingPoliciesOperations.cs +++ b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/IStreamingPoliciesOperations.cs @@ -45,7 +45,7 @@ public partial interface IStreamingPoliciesOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -76,7 +76,7 @@ public partial interface IStreamingPoliciesOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -110,7 +110,7 @@ public partial interface IStreamingPoliciesOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -141,7 +141,7 @@ public partial interface IStreamingPoliciesOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -163,7 +163,7 @@ public partial interface IStreamingPoliciesOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// diff --git a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/ITransformsOperations.cs b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/ITransformsOperations.cs index 3cb12c372575..6a280fd3130a 100644 --- a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/ITransformsOperations.cs +++ b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/ITransformsOperations.cs @@ -45,7 +45,7 @@ public partial interface ITransformsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -76,7 +76,7 @@ public partial interface ITransformsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -114,7 +114,7 @@ public partial interface ITransformsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -145,7 +145,7 @@ public partial interface ITransformsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -180,7 +180,7 @@ public partial interface ITransformsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -205,7 +205,7 @@ public partial interface ITransformsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// 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 7115826168b8..84051215b26f 100644 --- a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/JobsOperations.cs +++ b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/JobsOperations.cs @@ -75,7 +75,7 @@ internal JobsOperations(AzureMediaServicesClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -108,7 +108,10 @@ internal JobsOperations(AzureMediaServicesClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "transformName"); } - string apiVersion = "2020-05-01"; + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -120,7 +123,6 @@ 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); } @@ -140,9 +142,9 @@ internal JobsOperations(AzureMediaServicesClient client) _queryParameters.Add(_odataFilter); } } - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -204,11 +206,11 @@ internal JobsOperations(AzureMediaServicesClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new ApiErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ApiError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; @@ -288,7 +290,7 @@ internal JobsOperations(AzureMediaServicesClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -325,7 +327,10 @@ internal JobsOperations(AzureMediaServicesClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "jobName"); } - string apiVersion = "2020-05-01"; + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -337,7 +342,6 @@ 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); } @@ -350,9 +354,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 (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -412,13 +416,13 @@ internal JobsOperations(AzureMediaServicesClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 404) + if ((int)_statusCode != 200) { - var ex = new ApiErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ApiError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; @@ -501,7 +505,7 @@ internal JobsOperations(AzureMediaServicesClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -546,7 +550,10 @@ internal JobsOperations(AzureMediaServicesClient client) { parameters.Validate(); } - string apiVersion = "2020-05-01"; + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -559,7 +566,6 @@ 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); } @@ -572,9 +578,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 (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -642,11 +648,11 @@ internal JobsOperations(AzureMediaServicesClient client) string _responseContent = null; if ((int)_statusCode != 201) { - var ex = new ApiErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ApiError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; @@ -726,7 +732,7 @@ internal JobsOperations(AzureMediaServicesClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -760,7 +766,10 @@ internal JobsOperations(AzureMediaServicesClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "jobName"); } - string apiVersion = "2020-05-01"; + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -772,7 +781,6 @@ 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); } @@ -785,9 +793,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 (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -849,11 +857,11 @@ internal JobsOperations(AzureMediaServicesClient client) string _responseContent = null; if ((int)_statusCode != 200 && (int)_statusCode != 204) { - var ex = new ApiErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ApiError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; @@ -920,7 +928,7 @@ internal JobsOperations(AzureMediaServicesClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -961,7 +969,10 @@ internal JobsOperations(AzureMediaServicesClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); } - string apiVersion = "2020-05-01"; + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -974,7 +985,6 @@ 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); } @@ -987,9 +997,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 (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -1057,11 +1067,11 @@ internal JobsOperations(AzureMediaServicesClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new ApiErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ApiError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; @@ -1141,7 +1151,7 @@ internal JobsOperations(AzureMediaServicesClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -1175,7 +1185,10 @@ internal JobsOperations(AzureMediaServicesClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "jobName"); } - string apiVersion = "2020-05-01"; + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1187,7 +1200,6 @@ 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); } @@ -1200,9 +1212,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 (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -1264,11 +1276,11 @@ internal JobsOperations(AzureMediaServicesClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new ApiErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ApiError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; @@ -1321,7 +1333,7 @@ internal JobsOperations(AzureMediaServicesClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -1417,11 +1429,11 @@ internal JobsOperations(AzureMediaServicesClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new ApiErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ApiError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; 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 8c965cfdfb25..1c09dc59953d 100644 --- a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/LiveEventsOperations.cs +++ b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/LiveEventsOperations.cs @@ -68,7 +68,7 @@ internal LiveEventsOperations(AzureMediaServicesClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -97,7 +97,10 @@ internal LiveEventsOperations(AzureMediaServicesClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "accountName"); } - string apiVersion = "2020-05-01"; + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -107,7 +110,6 @@ 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); } @@ -118,9 +120,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 (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -182,11 +184,11 @@ internal LiveEventsOperations(AzureMediaServicesClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new ApiErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ApiError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; @@ -263,7 +265,7 @@ internal LiveEventsOperations(AzureMediaServicesClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -311,7 +313,10 @@ internal LiveEventsOperations(AzureMediaServicesClient client) throw new ValidationException(ValidationRules.Pattern, "liveEventName", "^[a-zA-Z0-9]+(-*[a-zA-Z0-9])*$"); } } - string apiVersion = "2020-05-01"; + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -322,7 +327,6 @@ 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); } @@ -334,9 +338,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 (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -396,13 +400,13 @@ internal LiveEventsOperations(AzureMediaServicesClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 404) + if ((int)_statusCode != 200) { - var ex = new ApiErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ApiError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; @@ -699,7 +703,7 @@ internal LiveEventsOperations(AzureMediaServicesClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -747,6 +751,10 @@ 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"); @@ -755,7 +763,6 @@ internal LiveEventsOperations(AzureMediaServicesClient client) { parameters.Validate(); } - string apiVersion = "2020-05-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -766,7 +773,6 @@ 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); @@ -780,9 +786,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 (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (autoStart != null) { @@ -854,11 +860,11 @@ internal LiveEventsOperations(AzureMediaServicesClient client) string _responseContent = null; if ((int)_statusCode != 200 && (int)_statusCode != 201) { - var ex = new ApiErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ApiError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; @@ -953,7 +959,7 @@ internal LiveEventsOperations(AzureMediaServicesClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -1001,11 +1007,14 @@ 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 = "2020-05-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1016,7 +1025,6 @@ 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); @@ -1029,9 +1037,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 (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -1099,11 +1107,11 @@ internal LiveEventsOperations(AzureMediaServicesClient client) string _responseContent = null; if ((int)_statusCode != 200 && (int)_statusCode != 202) { - var ex = new ApiErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ApiError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; @@ -1198,7 +1206,7 @@ internal LiveEventsOperations(AzureMediaServicesClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -1243,7 +1251,10 @@ internal LiveEventsOperations(AzureMediaServicesClient client) throw new ValidationException(ValidationRules.Pattern, "liveEventName", "^[a-zA-Z0-9]+(-*[a-zA-Z0-9])*$"); } } - string apiVersion = "2020-05-01"; + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1254,7 +1265,6 @@ 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); } @@ -1266,9 +1276,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 (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -1330,11 +1340,11 @@ internal LiveEventsOperations(AzureMediaServicesClient client) string _responseContent = null; if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 204) { - var ex = new ApiErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ApiError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; @@ -1394,7 +1404,7 @@ internal LiveEventsOperations(AzureMediaServicesClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -1439,7 +1449,10 @@ internal LiveEventsOperations(AzureMediaServicesClient client) throw new ValidationException(ValidationRules.Pattern, "liveEventName", "^[a-zA-Z0-9]+(-*[a-zA-Z0-9])*$"); } } - string apiVersion = "2020-05-01"; + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1450,7 +1463,6 @@ 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); } @@ -1462,9 +1474,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 (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -1526,11 +1538,11 @@ internal LiveEventsOperations(AzureMediaServicesClient client) string _responseContent = null; if ((int)_statusCode != 200 && (int)_statusCode != 202) { - var ex = new ApiErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ApiError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; @@ -1590,7 +1602,7 @@ internal LiveEventsOperations(AzureMediaServicesClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -1635,7 +1647,10 @@ internal LiveEventsOperations(AzureMediaServicesClient client) throw new ValidationException(ValidationRules.Pattern, "liveEventName", "^[a-zA-Z0-9]+(-*[a-zA-Z0-9])*$"); } } - string apiVersion = "2020-05-01"; + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1646,7 +1661,6 @@ 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); } @@ -1658,9 +1672,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 (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -1722,11 +1736,11 @@ internal LiveEventsOperations(AzureMediaServicesClient client) string _responseContent = null; if ((int)_statusCode != 200 && (int)_statusCode != 202) { - var ex = new ApiErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ApiError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; @@ -1790,7 +1804,7 @@ internal LiveEventsOperations(AzureMediaServicesClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -1835,7 +1849,10 @@ internal LiveEventsOperations(AzureMediaServicesClient client) throw new ValidationException(ValidationRules.Pattern, "liveEventName", "^[a-zA-Z0-9]+(-*[a-zA-Z0-9])*$"); } } - string apiVersion = "2020-05-01"; + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } LiveEventActionInput parameters = new LiveEventActionInput(); if (removeOutputsOnStop != null) { @@ -1851,7 +1868,6 @@ 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); @@ -1864,9 +1880,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 (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -1934,11 +1950,11 @@ internal LiveEventsOperations(AzureMediaServicesClient client) string _responseContent = null; if ((int)_statusCode != 200 && (int)_statusCode != 202) { - var ex = new ApiErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ApiError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; @@ -2000,7 +2016,7 @@ internal LiveEventsOperations(AzureMediaServicesClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -2045,7 +2061,10 @@ internal LiveEventsOperations(AzureMediaServicesClient client) throw new ValidationException(ValidationRules.Pattern, "liveEventName", "^[a-zA-Z0-9]+(-*[a-zA-Z0-9])*$"); } } - string apiVersion = "2020-05-01"; + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -2056,7 +2075,6 @@ 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); } @@ -2068,9 +2086,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 (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -2132,11 +2150,11 @@ internal LiveEventsOperations(AzureMediaServicesClient client) string _responseContent = null; if ((int)_statusCode != 200 && (int)_statusCode != 202) { - var ex = new ApiErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ApiError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; @@ -2189,7 +2207,7 @@ internal LiveEventsOperations(AzureMediaServicesClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -2285,11 +2303,11 @@ internal LiveEventsOperations(AzureMediaServicesClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new ApiErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ApiError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; 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 c2dac9c9b2c6..ce3bdb7816a3 100644 --- a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/LiveOutputsOperations.cs +++ b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/LiveOutputsOperations.cs @@ -71,7 +71,7 @@ internal LiveOutputsOperations(AzureMediaServicesClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -119,7 +119,10 @@ internal LiveOutputsOperations(AzureMediaServicesClient client) throw new ValidationException(ValidationRules.Pattern, "liveEventName", "^[a-zA-Z0-9]+(-*[a-zA-Z0-9])*$"); } } - string apiVersion = "2020-05-01"; + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -130,7 +133,6 @@ 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); } @@ -142,9 +144,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 (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -206,11 +208,11 @@ internal LiveOutputsOperations(AzureMediaServicesClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new ApiErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ApiError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; @@ -290,7 +292,7 @@ internal LiveOutputsOperations(AzureMediaServicesClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -357,7 +359,10 @@ internal LiveOutputsOperations(AzureMediaServicesClient client) throw new ValidationException(ValidationRules.Pattern, "liveOutputName", "^([a-zA-Z0-9])+(-*[a-zA-Z0-9])*$"); } } - string apiVersion = "2020-05-01"; + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -369,7 +374,6 @@ 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); } @@ -382,9 +386,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 (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -444,13 +448,13 @@ internal LiveOutputsOperations(AzureMediaServicesClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 404) + if ((int)_statusCode != 200) { - var ex = new ApiErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ApiError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; @@ -599,7 +603,7 @@ internal LiveOutputsOperations(AzureMediaServicesClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -666,6 +670,10 @@ 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"); @@ -674,7 +682,6 @@ internal LiveOutputsOperations(AzureMediaServicesClient client) { parameters.Validate(); } - string apiVersion = "2020-05-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -686,7 +693,6 @@ 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); @@ -700,9 +706,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 (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -770,11 +776,11 @@ internal LiveOutputsOperations(AzureMediaServicesClient client) string _responseContent = null; if ((int)_statusCode != 200 && (int)_statusCode != 201) { - var ex = new ApiErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ApiError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; @@ -873,7 +879,7 @@ internal LiveOutputsOperations(AzureMediaServicesClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -937,7 +943,10 @@ internal LiveOutputsOperations(AzureMediaServicesClient client) throw new ValidationException(ValidationRules.Pattern, "liveOutputName", "^([a-zA-Z0-9])+(-*[a-zA-Z0-9])*$"); } } - string apiVersion = "2020-05-01"; + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -949,7 +958,6 @@ 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); } @@ -962,9 +970,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 (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -1026,11 +1034,11 @@ internal LiveOutputsOperations(AzureMediaServicesClient client) string _responseContent = null; if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 204) { - var ex = new ApiErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ApiError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; @@ -1083,7 +1091,7 @@ internal LiveOutputsOperations(AzureMediaServicesClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -1179,11 +1187,11 @@ internal LiveOutputsOperations(AzureMediaServicesClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new ApiErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ApiError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; 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 0b06f673ea42..a769429f7f06 100644 --- a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/LocationsOperations.cs +++ b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/LocationsOperations.cs @@ -72,7 +72,7 @@ internal LocationsOperations(AzureMediaServicesClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -97,7 +97,10 @@ internal LocationsOperations(AzureMediaServicesClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "locationName"); } - string apiVersion = "2021-05-01"; + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } CheckNameAvailabilityInput parameters = new CheckNameAvailabilityInput(); if (name != null || type != null) { @@ -112,7 +115,6 @@ 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); @@ -123,9 +125,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 (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -193,11 +195,11 @@ internal LocationsOperations(AzureMediaServicesClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new ApiErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ApiError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; 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 7f6aeac84b5d..1f1ddcb43c9c 100644 --- a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/MediaservicesOperations.cs +++ b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/MediaservicesOperations.cs @@ -65,7 +65,7 @@ internal MediaservicesOperations(AzureMediaServicesClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -90,7 +90,10 @@ internal MediaservicesOperations(AzureMediaServicesClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } - string apiVersion = "2021-05-01"; + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -99,7 +102,6 @@ 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); } @@ -109,9 +111,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 (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -173,11 +175,11 @@ internal MediaservicesOperations(AzureMediaServicesClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new ApiErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ApiError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; @@ -251,7 +253,7 @@ internal MediaservicesOperations(AzureMediaServicesClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -280,7 +282,10 @@ internal MediaservicesOperations(AzureMediaServicesClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "accountName"); } - string apiVersion = "2021-05-01"; + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -290,7 +295,6 @@ 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); } @@ -301,9 +305,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 (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -365,11 +369,11 @@ internal MediaservicesOperations(AzureMediaServicesClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new ApiErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ApiError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; @@ -446,7 +450,7 @@ internal MediaservicesOperations(AzureMediaServicesClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -483,7 +487,10 @@ internal MediaservicesOperations(AzureMediaServicesClient client) { parameters.Validate(); } - string apiVersion = "2021-05-01"; + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -494,7 +501,6 @@ 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); } @@ -505,9 +511,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 (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -575,11 +581,11 @@ internal MediaservicesOperations(AzureMediaServicesClient client) string _responseContent = null; if ((int)_statusCode != 200 && (int)_statusCode != 201) { - var ex = new ApiErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ApiError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; @@ -671,7 +677,7 @@ internal MediaservicesOperations(AzureMediaServicesClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -697,7 +703,10 @@ internal MediaservicesOperations(AzureMediaServicesClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "accountName"); } - string apiVersion = "2021-05-01"; + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -707,7 +716,6 @@ 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); } @@ -718,9 +726,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 (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -782,11 +790,11 @@ internal MediaservicesOperations(AzureMediaServicesClient client) string _responseContent = null; if ((int)_statusCode != 200 && (int)_statusCode != 204) { - var ex = new ApiErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ApiError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; @@ -845,7 +853,7 @@ internal MediaservicesOperations(AzureMediaServicesClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -878,7 +886,10 @@ internal MediaservicesOperations(AzureMediaServicesClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); } - string apiVersion = "2021-05-01"; + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -889,7 +900,6 @@ 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); } @@ -900,9 +910,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 (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -970,11 +980,11 @@ internal MediaservicesOperations(AzureMediaServicesClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new ApiErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ApiError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; @@ -1052,7 +1062,7 @@ internal MediaservicesOperations(AzureMediaServicesClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -1078,7 +1088,10 @@ internal MediaservicesOperations(AzureMediaServicesClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "accountName"); } - string apiVersion = "2021-05-01"; + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } SyncStorageKeysInput parameters = new SyncStorageKeysInput(); if (id != null) { @@ -1093,7 +1106,6 @@ 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); @@ -1105,9 +1117,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 (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -1175,11 +1187,11 @@ internal MediaservicesOperations(AzureMediaServicesClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new ApiErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ApiError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; @@ -1238,7 +1250,7 @@ internal MediaservicesOperations(AzureMediaServicesClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -1267,7 +1279,10 @@ internal MediaservicesOperations(AzureMediaServicesClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "accountName"); } - string apiVersion = "2021-05-01"; + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } ListEdgePoliciesInput parameters = new ListEdgePoliciesInput(); if (deviceId != null) { @@ -1282,7 +1297,6 @@ 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); @@ -1294,9 +1308,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 (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -1364,11 +1378,11 @@ internal MediaservicesOperations(AzureMediaServicesClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new ApiErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ApiError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; @@ -1436,7 +1450,7 @@ internal MediaservicesOperations(AzureMediaServicesClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -1457,7 +1471,10 @@ internal MediaservicesOperations(AzureMediaServicesClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-05-01"; + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1465,7 +1482,6 @@ 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); } @@ -1474,9 +1490,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 (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -1538,11 +1554,11 @@ internal MediaservicesOperations(AzureMediaServicesClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new ApiErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ApiError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; @@ -1613,7 +1629,7 @@ internal MediaservicesOperations(AzureMediaServicesClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -1709,11 +1725,11 @@ internal MediaservicesOperations(AzureMediaServicesClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new ApiErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ApiError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; @@ -1784,7 +1800,7 @@ internal MediaservicesOperations(AzureMediaServicesClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -1880,11 +1896,11 @@ internal MediaservicesOperations(AzureMediaServicesClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new ApiErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ApiError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; diff --git a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/AccountEncryption.cs b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/AccountEncryption.cs index 2a144a0a0cee..f36794ab1fa6 100644 --- a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/AccountEncryption.cs +++ b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/AccountEncryption.cs @@ -30,10 +30,15 @@ public AccountEncryption() /// Possible values include: 'SystemKey', 'CustomerKey' /// The properties of the key used to /// encrypt the account. - public AccountEncryption(AccountEncryptionKeyType type, KeyVaultProperties keyVaultProperties = default(KeyVaultProperties)) + /// The Key Vault identity. + /// The current status of the Key Vault + /// mapping. + public AccountEncryption(AccountEncryptionKeyType type, KeyVaultProperties keyVaultProperties = default(KeyVaultProperties), ResourceIdentity identity = default(ResourceIdentity), string status = default(string)) { Type = type; KeyVaultProperties = keyVaultProperties; + Identity = identity; + Status = status; CustomInit(); } @@ -55,6 +60,18 @@ public AccountEncryption() [JsonProperty(PropertyName = "keyVaultProperties")] public KeyVaultProperties KeyVaultProperties { get; set; } + /// + /// Gets or sets the Key Vault identity. + /// + [JsonProperty(PropertyName = "identity")] + public ResourceIdentity Identity { get; set; } + + /// + /// Gets the current status of the Key Vault mapping. + /// + [JsonProperty(PropertyName = "status")] + public string Status { get; private set; } + /// /// Validate the object. /// @@ -63,6 +80,10 @@ public AccountEncryption() /// public virtual void Validate() { + if (Identity != null) + { + Identity.Validate(); + } } } } 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 3c1d1a857de7..8e21d8cf02b9 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,8 +43,13 @@ public BuiltInStandardEncoderPreset() /// 'H265ContentAwareEncoding', 'H265AdaptiveStreaming', /// 'H265SingleBitrate720p', 'H265SingleBitrate1080p', /// 'H265SingleBitrate4K' - public BuiltInStandardEncoderPreset(EncoderNamedPreset presetName) + /// PresetConfigurations are only + /// supported for the ContentAwareEncoding and H265ContentAwareEncoding + /// built-in presets. These settings will not affect other built-in or + /// custom defined presets. + public BuiltInStandardEncoderPreset(EncoderNamedPreset presetName, PresetConfigurations configurations = default(PresetConfigurations)) { + Configurations = configurations; PresetName = presetName; CustomInit(); } @@ -54,6 +59,15 @@ public BuiltInStandardEncoderPreset(EncoderNamedPreset presetName) /// 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. + /// + [JsonProperty(PropertyName = "configurations")] + public PresetConfigurations Configurations { get; set; } + /// /// Gets or sets the built-in preset to be used for encoding videos. /// Possible values include: 'H264SingleBitrateSD', diff --git a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/Complexity.cs b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/Complexity.cs new file mode 100644 index 000000000000..f7818aece0cb --- /dev/null +++ b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/Complexity.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 Complexity. + /// + /// + /// Determine base value for a given allowed value if exists, else return + /// the value itself + /// + [JsonConverter(typeof(ComplexityConverter))] + public struct Complexity : System.IEquatable + { + private Complexity(string underlyingValue) + { + UnderlyingValue=underlyingValue; + } + + /// + /// Configures the encoder to use settings optimized for faster + /// encoding. Quality is sacrificed to decrease encoding time. + /// + public static readonly Complexity Speed = "Speed"; + + /// + /// Configures the encoder to use settings that achieve a balance + /// between speed and quality. + /// + public static readonly Complexity Balanced = "Balanced"; + + /// + /// Configures the encoder to use settings optimized to produce higher + /// quality output at the expense of slower overall encode time. + /// + public static readonly Complexity Quality = "Quality"; + + + /// + /// Underlying value of enum Complexity + /// + private readonly string UnderlyingValue; + + /// + /// Returns string representation for Complexity + /// + public override string ToString() + { + return UnderlyingValue == null ? null : UnderlyingValue.ToString(); + } + + /// + /// Compares enums of type Complexity + /// + public bool Equals(Complexity e) + { + return UnderlyingValue.Equals(e.UnderlyingValue); + } + + /// + /// Implicit operator to convert string to Complexity + /// + public static implicit operator Complexity(string value) + { + return new Complexity(value); + } + + /// + /// Implicit operator to convert Complexity to string + /// + public static implicit operator string(Complexity e) + { + return e.UnderlyingValue; + } + + /// + /// Overriding == operator for enum Complexity + /// + public static bool operator == (Complexity e1, Complexity e2) + { + return e2.Equals(e1); + } + + /// + /// Overriding != operator for enum Complexity + /// + public static bool operator != (Complexity e1, Complexity e2) + { + return !e2.Equals(e1); + } + + /// + /// Overrides Equals operator for Complexity + /// + public override bool Equals(object obj) + { + return obj is Complexity && Equals((Complexity)obj); + } + + /// + /// Returns for hashCode Complexity + /// + public override int GetHashCode() + { + return UnderlyingValue.GetHashCode(); + } + + } +} diff --git a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/ComplexityConverter.cs b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/ComplexityConverter.cs new file mode 100644 index 000000000000..6996faa95a60 --- /dev/null +++ b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/ComplexityConverter.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 Complexity. + /// + public sealed class ComplexityConverter : JsonConverter + { + + /// + /// Returns if objectType can be converted to Complexity by the + /// converter. + /// + public override bool CanConvert(System.Type objectType) + { + return typeof(Complexity).GetTypeInfo().IsAssignableFrom(objectType.GetTypeInfo()); + } + + /// + /// Overrides ReadJson and converts token to Complexity. + /// + public override object ReadJson(JsonReader reader, System.Type objectType, object existingValue, JsonSerializer serializer) + { + if (reader.TokenType == Newtonsoft.Json.JsonToken.Null) + { + return null; + } + return (Complexity)serializer.Deserialize(reader); + } + + /// + /// Overriding WriteJson for Complexity 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/Provider.cs b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/ErrorAdditionalInfo.cs similarity index 51% rename from sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/Provider.cs rename to sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/ErrorAdditionalInfo.cs index d136dadfc0c2..1bb6a1658df6 100644 --- a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/Provider.cs +++ b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/ErrorAdditionalInfo.cs @@ -10,30 +10,31 @@ namespace Microsoft.Azure.Management.Media.Models { - using Microsoft.Rest; using Newtonsoft.Json; using System.Linq; /// - /// A resource provider. + /// The resource management error additional info. /// - public partial class Provider + public partial class ErrorAdditionalInfo { /// - /// Initializes a new instance of the Provider class. + /// Initializes a new instance of the ErrorAdditionalInfo class. /// - public Provider() + public ErrorAdditionalInfo() { CustomInit(); } /// - /// Initializes a new instance of the Provider class. + /// Initializes a new instance of the ErrorAdditionalInfo class. /// - /// The provider name. - public Provider(string providerName) + /// The additional info type. + /// The additional info. + public ErrorAdditionalInfo(string type = default(string), object info = default(object)) { - ProviderName = providerName; + Type = type; + Info = info; CustomInit(); } @@ -43,23 +44,16 @@ public Provider(string providerName) partial void CustomInit(); /// - /// Gets or sets the provider name. + /// Gets the additional info type. /// - [JsonProperty(PropertyName = "providerName")] - public string ProviderName { get; set; } + [JsonProperty(PropertyName = "type")] + public string Type { get; private set; } /// - /// Validate the object. + /// Gets the additional info. /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (ProviderName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "ProviderName"); - } - } + [JsonProperty(PropertyName = "info")] + public object Info { get; private set; } + } } diff --git a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/ODataError.cs b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/ErrorDetail.cs similarity index 54% rename from sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/ODataError.cs rename to sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/ErrorDetail.cs index 48d916745452..1bebc6a80570 100644 --- a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/ODataError.cs +++ b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/ErrorDetail.cs @@ -16,32 +16,33 @@ namespace Microsoft.Azure.Management.Media.Models using System.Linq; /// - /// Information about an error. + /// The error detail. /// - public partial class ODataError + public partial class ErrorDetail { /// - /// Initializes a new instance of the ODataError class. + /// Initializes a new instance of the ErrorDetail class. /// - public ODataError() + public ErrorDetail() { CustomInit(); } /// - /// Initializes a new instance of the ODataError class. + /// Initializes a new instance of the ErrorDetail class. /// - /// A language-independent error name. + /// The error code. /// The error message. - /// The target of the error (for example, the name - /// of the property in error). + /// The error target. /// The error details. - public ODataError(string code = default(string), string message = default(string), string target = default(string), IList details = default(IList)) + /// The error additional info. + public ErrorDetail(string code = default(string), string message = default(string), string target = default(string), IList details = default(IList), IList additionalInfo = default(IList)) { Code = code; Message = message; Target = target; Details = details; + AdditionalInfo = additionalInfo; CustomInit(); } @@ -51,29 +52,34 @@ public ODataError() partial void CustomInit(); /// - /// Gets or sets a language-independent error name. + /// Gets the error code. /// [JsonProperty(PropertyName = "code")] - public string Code { get; set; } + public string Code { get; private set; } /// - /// Gets or sets the error message. + /// Gets the error message. /// [JsonProperty(PropertyName = "message")] - public string Message { get; set; } + public string Message { get; private set; } /// - /// Gets or sets the target of the error (for example, the name of the - /// property in error). + /// Gets the error target. /// [JsonProperty(PropertyName = "target")] - public string Target { get; set; } + public string Target { get; private set; } /// - /// Gets or sets the error details. + /// Gets the error details. /// [JsonProperty(PropertyName = "details")] - public IList Details { get; set; } + public IList Details { get; private set; } + + /// + /// Gets the error additional info. + /// + [JsonProperty(PropertyName = "additionalInfo")] + public IList AdditionalInfo { get; private set; } } } diff --git a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/ApiError.cs b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/ErrorResponse.cs similarity index 59% rename from sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/ApiError.cs rename to sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/ErrorResponse.cs index f13722e16aa2..12a5412e7809 100644 --- a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/ApiError.cs +++ b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/ErrorResponse.cs @@ -14,23 +14,28 @@ namespace Microsoft.Azure.Management.Media.Models using System.Linq; /// - /// The API error. + /// Error response /// - public partial class ApiError + /// + /// Common error response for all Azure Resource Manager APIs to return + /// error details for failed operations. (This also follows the OData error + /// response format.). + /// + public partial class ErrorResponse { /// - /// Initializes a new instance of the ApiError class. + /// Initializes a new instance of the ErrorResponse class. /// - public ApiError() + public ErrorResponse() { CustomInit(); } /// - /// Initializes a new instance of the ApiError class. + /// Initializes a new instance of the ErrorResponse class. /// - /// The error properties. - public ApiError(ODataError error = default(ODataError)) + /// The error object. + public ErrorResponse(ErrorDetail error = default(ErrorDetail)) { Error = error; CustomInit(); @@ -42,10 +47,10 @@ public ApiError() partial void CustomInit(); /// - /// Gets or sets the error properties. + /// Gets or sets the error object. /// [JsonProperty(PropertyName = "error")] - public ODataError Error { get; set; } + public ErrorDetail Error { get; set; } } } diff --git a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/ApiErrorException.cs b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/ErrorResponseException.cs similarity index 69% rename from sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/ApiErrorException.cs rename to sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/ErrorResponseException.cs index e40806c835d6..fd3355b6c4a0 100644 --- a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/ApiErrorException.cs +++ b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/ErrorResponseException.cs @@ -13,9 +13,10 @@ namespace Microsoft.Azure.Management.Media.Models using Microsoft.Rest; /// - /// Exception thrown for an invalid response with ApiError information. + /// Exception thrown for an invalid response with ErrorResponse + /// information. /// - public partial class ApiErrorException : RestException + public partial class ErrorResponseException : RestException { /// /// Gets information about the associated HTTP request. @@ -30,30 +31,30 @@ public partial class ApiErrorException : RestException /// /// Gets or sets the body object. /// - public ApiError Body { get; set; } + public ErrorResponse Body { get; set; } /// - /// Initializes a new instance of the ApiErrorException class. + /// Initializes a new instance of the ErrorResponseException class. /// - public ApiErrorException() + public ErrorResponseException() { } /// - /// Initializes a new instance of the ApiErrorException class. + /// Initializes a new instance of the ErrorResponseException class. /// /// The exception message. - public ApiErrorException(string message) + public ErrorResponseException(string message) : this(message, null) { } /// - /// Initializes a new instance of the ApiErrorException class. + /// Initializes a new instance of the ErrorResponseException class. /// /// The exception message. /// Inner exception. - public ApiErrorException(string message, System.Exception innerException) + public ErrorResponseException(string message, System.Exception innerException) : base(message, innerException) { } diff --git a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/InterleaveOutput.cs b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/InterleaveOutput.cs new file mode 100644 index 000000000000..20473b2b0726 --- /dev/null +++ b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/InterleaveOutput.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 InterleaveOutput. + /// + /// + /// Determine base value for a given allowed value if exists, else return + /// the value itself + /// + [JsonConverter(typeof(InterleaveOutputConverter))] + public struct InterleaveOutput : System.IEquatable + { + private InterleaveOutput(string underlyingValue) + { + UnderlyingValue=underlyingValue; + } + + /// + /// The output is video-only or audio-only. + /// + public static readonly InterleaveOutput NonInterleavedOutput = "NonInterleavedOutput"; + + /// + /// The output includes both audio and video. + /// + public static readonly InterleaveOutput InterleavedOutput = "InterleavedOutput"; + + + /// + /// Underlying value of enum InterleaveOutput + /// + private readonly string UnderlyingValue; + + /// + /// Returns string representation for InterleaveOutput + /// + public override string ToString() + { + return UnderlyingValue == null ? null : UnderlyingValue.ToString(); + } + + /// + /// Compares enums of type InterleaveOutput + /// + public bool Equals(InterleaveOutput e) + { + return UnderlyingValue.Equals(e.UnderlyingValue); + } + + /// + /// Implicit operator to convert string to InterleaveOutput + /// + public static implicit operator InterleaveOutput(string value) + { + return new InterleaveOutput(value); + } + + /// + /// Implicit operator to convert InterleaveOutput to string + /// + public static implicit operator string(InterleaveOutput e) + { + return e.UnderlyingValue; + } + + /// + /// Overriding == operator for enum InterleaveOutput + /// + public static bool operator == (InterleaveOutput e1, InterleaveOutput e2) + { + return e2.Equals(e1); + } + + /// + /// Overriding != operator for enum InterleaveOutput + /// + public static bool operator != (InterleaveOutput e1, InterleaveOutput e2) + { + return !e2.Equals(e1); + } + + /// + /// Overrides Equals operator for InterleaveOutput + /// + public override bool Equals(object obj) + { + return obj is InterleaveOutput && Equals((InterleaveOutput)obj); + } + + /// + /// Returns for hashCode InterleaveOutput + /// + public override int GetHashCode() + { + return UnderlyingValue.GetHashCode(); + } + + } +} diff --git a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/InterleaveOutputConverter.cs b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/InterleaveOutputConverter.cs new file mode 100644 index 000000000000..23d72c35dfcd --- /dev/null +++ b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/InterleaveOutputConverter.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 InterleaveOutput. + /// + public sealed class InterleaveOutputConverter : JsonConverter + { + + /// + /// Returns if objectType can be converted to InterleaveOutput by the + /// converter. + /// + public override bool CanConvert(System.Type objectType) + { + return typeof(InterleaveOutput).GetTypeInfo().IsAssignableFrom(objectType.GetTypeInfo()); + } + + /// + /// Overrides ReadJson and converts token to InterleaveOutput. + /// + public override object ReadJson(JsonReader reader, System.Type objectType, object existingValue, JsonSerializer serializer) + { + if (reader.TokenType == Newtonsoft.Json.JsonToken.Null) + { + return null; + } + return (InterleaveOutput)serializer.Deserialize(reader); + } + + /// + /// Overriding WriteJson for InterleaveOutput 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/JobInputAsset.cs b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/JobInputAsset.cs index a3bb4b2553f6..b81fe2457258 100644 --- a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/JobInputAsset.cs +++ b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/JobInputAsset.cs @@ -35,7 +35,8 @@ public JobInputAsset() /// /// The name of the input Asset. /// List of files. Required for JobInputHttp. - /// Maximum of 4000 characters each. + /// Maximum of 4000 characters each. Query strings will not be returned + /// in service responses to prevent sensitive data exposure. /// Defines a point on the timeline of the input /// media at which processing will start. Defaults to the beginning of /// the input media. diff --git a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/JobInputClip.cs b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/JobInputClip.cs index ac64b6aaeeb6..f319a7ab6490 100644 --- a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/JobInputClip.cs +++ b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/JobInputClip.cs @@ -33,7 +33,8 @@ public JobInputClip() /// Initializes a new instance of the JobInputClip class. /// /// List of files. Required for JobInputHttp. - /// Maximum of 4000 characters each. + /// Maximum of 4000 characters each. Query strings will not be returned + /// in service responses to prevent sensitive data exposure. /// Defines a point on the timeline of the input /// media at which processing will start. Defaults to the beginning of /// the input media. @@ -67,7 +68,8 @@ public JobInputClip() /// /// Gets or sets list of files. Required for JobInputHttp. Maximum of - /// 4000 characters each. + /// 4000 characters each. Query strings will not be returned in service + /// responses to prevent sensitive data exposure. /// [JsonProperty(PropertyName = "files")] public IList Files { get; set; } diff --git a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/JobInputHttp.cs b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/JobInputHttp.cs index 913584a8a207..2b994377643f 100644 --- a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/JobInputHttp.cs +++ b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/JobInputHttp.cs @@ -33,7 +33,8 @@ public JobInputHttp() /// Initializes a new instance of the JobInputHttp class. /// /// List of files. Required for JobInputHttp. - /// Maximum of 4000 characters each. + /// Maximum of 4000 characters each. Query strings will not be returned + /// in service responses to prevent sensitive data exposure. /// Defines a point on the timeline of the input /// media at which processing will start. Defaults to the beginning of /// the input media. @@ -53,7 +54,9 @@ public JobInputHttp() /// Base URI for HTTPS job input. It will be /// concatenated with provided file names. If no base uri is given, /// then the provided file list is assumed to be fully qualified uris. - /// Maximum length of 4000 characters. + /// Maximum length of 4000 characters. The query strings will not be + /// returned in service responses to prevent sensitive data + /// exposure. public JobInputHttp(IList files = default(IList), ClipTime start = default(ClipTime), ClipTime end = default(ClipTime), string label = default(string), IList inputDefinitions = default(IList), string baseUri = default(string)) : base(files, start, end, label, inputDefinitions) { @@ -70,7 +73,8 @@ public JobInputHttp() /// Gets or sets base URI for HTTPS job input. It will be concatenated /// with provided file names. If no base uri is given, then the /// provided file list is assumed to be fully qualified uris. Maximum - /// length of 4000 characters. + /// length of 4000 characters. The query strings will not be returned + /// in service responses to prevent sensitive data exposure. /// [JsonProperty(PropertyName = "baseUri")] public string BaseUri { get; set; } diff --git a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/JobOutput.cs b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/JobOutput.cs index 2fa12234cd7c..1aae7b965490 100644 --- a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/JobOutput.cs +++ b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/JobOutput.cs @@ -31,6 +31,8 @@ public JobOutput() /// /// If the JobOutput is in the Error state, it /// contains the details of the error. + /// A preset used to override the preset + /// in the corresponding transform output. /// Describes the state of the JobOutput. Possible /// values include: 'Canceled', 'Canceling', 'Error', 'Finished', /// 'Processing', 'Queued', 'Scheduled' @@ -57,9 +59,10 @@ public JobOutput() /// Output began processing. /// The UTC date and time at which this Job /// Output finished processing. - public JobOutput(JobError error = default(JobError), JobState state = default(JobState), int progress = default(int), string label = default(string), System.DateTime? startTime = default(System.DateTime?), System.DateTime? endTime = default(System.DateTime?)) + public JobOutput(JobError error = default(JobError), Preset presetOverride = default(Preset), JobState state = default(JobState), int progress = default(int), string label = default(string), System.DateTime? startTime = default(System.DateTime?), System.DateTime? endTime = default(System.DateTime?)) { Error = error; + PresetOverride = presetOverride; State = state; Progress = progress; Label = label; @@ -80,6 +83,13 @@ public JobOutput() [JsonProperty(PropertyName = "error")] public JobError Error { get; private set; } + /// + /// Gets or sets a preset used to override the preset in the + /// corresponding transform output. + /// + [JsonProperty(PropertyName = "presetOverride")] + public Preset PresetOverride { get; set; } + /// /// Gets describes the state of the JobOutput. Possible values include: /// 'Canceled', 'Canceling', 'Error', 'Finished', 'Processing', diff --git a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/JobOutputAsset.cs b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/JobOutputAsset.cs index 3afc45d40020..17769adead52 100644 --- a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/JobOutputAsset.cs +++ b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/JobOutputAsset.cs @@ -34,6 +34,8 @@ public JobOutputAsset() /// The name of the output Asset. /// If the JobOutput is in the Error state, it /// contains the details of the error. + /// A preset used to override the preset + /// in the corresponding transform output. /// Describes the state of the JobOutput. Possible /// values include: 'Canceled', 'Canceling', 'Error', 'Finished', /// 'Processing', 'Queued', 'Scheduled' @@ -60,8 +62,8 @@ public JobOutputAsset() /// Output began processing. /// The UTC date and time at which this Job /// Output finished processing. - public JobOutputAsset(string assetName, JobError error = default(JobError), JobState state = default(JobState), int progress = default(int), string label = default(string), System.DateTime? startTime = default(System.DateTime?), System.DateTime? endTime = default(System.DateTime?)) - : base(error, state, progress, label, startTime, endTime) + public JobOutputAsset(string assetName, JobError error = default(JobError), Preset presetOverride = default(Preset), JobState state = default(JobState), int progress = default(int), string label = default(string), System.DateTime? startTime = default(System.DateTime?), System.DateTime? endTime = default(System.DateTime?)) + : base(error, presetOverride, state, progress, label, startTime, endTime) { AssetName = assetName; CustomInit(); diff --git a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/LiveEventEncoding.cs b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/LiveEventEncoding.cs index 7b5a5495f775..ecf3eeb758d0 100644 --- a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/LiveEventEncoding.cs +++ b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/LiveEventEncoding.cs @@ -31,14 +31,14 @@ public LiveEventEncoding() /// Initializes a new instance of the LiveEventEncoding class. /// /// Live event type. When encodingType is - /// set to None, the service simply passes through the incoming video - /// and audio layer(s) to the output. When encodingType is set to - /// Standard or Premium1080p, a live encoder transcodes the incoming - /// stream into multiple bitrates or layers. See - /// https://go.microsoft.com/fwlink/?linkid=2095101 for more - /// information. This property cannot be modified after the live event - /// is created. Possible values include: 'None', 'Standard', - /// 'Premium1080p' + /// set to PassthroughBasic or PassthroughStandard, the service simply + /// passes through the incoming video and audio layer(s) to the output. + /// When encodingType is set to Standard or Premium1080p, a live + /// encoder transcodes the incoming stream into multiple bitrates or + /// layers. See https://go.microsoft.com/fwlink/?linkid=2095101 for + /// more information. This property cannot be modified after the live + /// event is created. Possible values include: 'None', 'Standard', + /// 'Premium1080p', 'PassthroughBasic', 'PassthroughStandard' /// The optional encoding preset name, used /// when encodingType is not None. This value is specified at creation /// time and cannot be updated. If the encodingType is set to Standard, @@ -71,15 +71,15 @@ public LiveEventEncoding() partial void CustomInit(); /// - /// Gets or sets live event type. When encodingType is set to None, the - /// service simply passes through the incoming video and audio layer(s) - /// to the output. When encodingType is set to Standard or - /// Premium1080p, a live encoder transcodes the incoming stream into - /// multiple bitrates or layers. See - /// https://go.microsoft.com/fwlink/?linkid=2095101 for more + /// Gets or sets live event type. When encodingType is set to + /// PassthroughBasic or PassthroughStandard, the service simply passes + /// through the incoming video and audio layer(s) to the output. When + /// encodingType is set to Standard or Premium1080p, a live encoder + /// transcodes the incoming stream into multiple bitrates or layers. + /// See https://go.microsoft.com/fwlink/?linkid=2095101 for more /// information. This property cannot be modified after the live event /// is created. Possible values include: 'None', 'Standard', - /// 'Premium1080p' + /// 'Premium1080p', 'PassthroughBasic', 'PassthroughStandard' /// [JsonProperty(PropertyName = "encodingType")] public LiveEventEncodingType? EncodingType { get; set; } diff --git a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/LiveEventEncodingType.cs b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/LiveEventEncodingType.cs index e20e6dd5c42c..f764b28aba93 100644 --- a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/LiveEventEncodingType.cs +++ b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/LiveEventEncodingType.cs @@ -28,9 +28,8 @@ private LiveEventEncodingType(string underlyingValue) } /// - /// A contribution live encoder sends a multiple bitrate stream. The - /// ingested stream passes through the live event without any further - /// processing. It is also called the pass-through mode. + /// This is the same as PassthroughStandard, please see description + /// below. This enumeration value is being deprecated. /// public static readonly LiveEventEncodingType None = "None"; @@ -48,6 +47,23 @@ private LiveEventEncodingType(string underlyingValue) /// public static readonly LiveEventEncodingType Premium1080p = "Premium1080p"; + /// + /// The ingested stream passes through the live event from the + /// contribution encoder without any further processing. In the + /// PassthroughBasic mode, ingestion is limited to up to 5Mbps and only + /// 1 concurrent live output is allowed. Live transcription is not + /// available. + /// + public static readonly LiveEventEncodingType PassthroughBasic = "PassthroughBasic"; + + /// + /// The ingested stream passes through the live event from the + /// contribution encoder without any further processing. Live + /// transcription is available. Ingestion bitrate limits are much + /// higher and up to 3 concurrent live outputs are allowed. + /// + public static readonly LiveEventEncodingType PassthroughStandard = "PassthroughStandard"; + /// /// Underlying value of enum LiveEventEncodingType diff --git a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/LiveOutput.cs b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/LiveOutput.cs index aaf5ac125263..92551844cb28 100644 --- a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/LiveOutput.cs +++ b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/LiveOutput.cs @@ -62,7 +62,9 @@ public LiveOutput() /// output. /// The resource state of the live output. /// Possible values include: 'Creating', 'Running', 'Deleting' - public LiveOutput(string assetName, System.TimeSpan archiveWindowLength, string id = default(string), string name = default(string), string type = default(string), string description = default(string), string manifestName = default(string), Hls hls = default(Hls), long? outputSnapTime = default(long?), System.DateTime? created = default(System.DateTime?), System.DateTime? lastModified = default(System.DateTime?), string provisioningState = default(string), LiveOutputResourceState? resourceState = default(LiveOutputResourceState?)) + /// The system metadata relating to this + /// resource. + public LiveOutput(string assetName, System.TimeSpan archiveWindowLength, string id = default(string), string name = default(string), string type = default(string), string description = default(string), string manifestName = default(string), Hls hls = default(Hls), long? outputSnapTime = default(long?), System.DateTime? created = default(System.DateTime?), System.DateTime? lastModified = default(System.DateTime?), string provisioningState = default(string), LiveOutputResourceState? resourceState = default(LiveOutputResourceState?), SystemData systemData = default(SystemData)) : base(id, name, type) { Description = description; @@ -75,6 +77,7 @@ public LiveOutput() LastModified = lastModified; ProvisioningState = provisioningState; ResourceState = resourceState; + SystemData = systemData; CustomInit(); } @@ -151,6 +154,12 @@ public LiveOutput() [JsonProperty(PropertyName = "properties.resourceState")] public LiveOutputResourceState? ResourceState { get; private set; } + /// + /// Gets the system metadata relating to this resource. + /// + [JsonProperty(PropertyName = "systemData")] + public SystemData SystemData { get; private set; } + /// /// Validate the object. /// diff --git a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/MediaService.cs b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/MediaService.cs index 3a2594f8a389..672ae61e62cd 100644 --- a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/MediaService.cs +++ b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/MediaService.cs @@ -51,11 +51,14 @@ public MediaService() /// The account encryption properties. /// The Key Delivery properties for Media /// Services account. + /// Whether or not public network + /// access is allowed for resources under the Media Services account. + /// Possible values include: 'Enabled', 'Disabled' /// The Managed Identity for the Media Services /// account. /// The system metadata relating to this /// resource. - public MediaService(string location, string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), System.Guid mediaServiceId = default(System.Guid), IList storageAccounts = default(IList), StorageAuthentication? storageAuthentication = default(StorageAuthentication?), AccountEncryption encryption = default(AccountEncryption), KeyDelivery keyDelivery = default(KeyDelivery), MediaServiceIdentity identity = default(MediaServiceIdentity), SystemData systemData = default(SystemData)) + public MediaService(string location, string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), System.Guid mediaServiceId = default(System.Guid), IList storageAccounts = default(IList), StorageAuthentication? storageAuthentication = default(StorageAuthentication?), AccountEncryption encryption = default(AccountEncryption), KeyDelivery keyDelivery = default(KeyDelivery), PublicNetworkAccess? publicNetworkAccess = default(PublicNetworkAccess?), MediaServiceIdentity identity = default(MediaServiceIdentity), SystemData systemData = default(SystemData)) : base(location, id, name, type, tags) { MediaServiceId = mediaServiceId; @@ -63,6 +66,7 @@ public MediaService() StorageAuthentication = storageAuthentication; Encryption = encryption; KeyDelivery = keyDelivery; + PublicNetworkAccess = publicNetworkAccess; Identity = identity; SystemData = systemData; CustomInit(); @@ -104,6 +108,14 @@ public MediaService() [JsonProperty(PropertyName = "properties.keyDelivery")] public KeyDelivery KeyDelivery { get; set; } + /// + /// Gets or sets whether or not public network access is allowed for + /// resources under the Media Services account. Possible values + /// include: 'Enabled', 'Disabled' + /// + [JsonProperty(PropertyName = "properties.publicNetworkAccess")] + public PublicNetworkAccess? PublicNetworkAccess { get; set; } + /// /// Gets or sets the Managed Identity for the Media Services account. /// diff --git a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/MediaServiceIdentity.cs b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/MediaServiceIdentity.cs index c193c28b768e..616cc4cf7ce4 100644 --- a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/MediaServiceIdentity.cs +++ b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/MediaServiceIdentity.cs @@ -10,7 +10,10 @@ namespace Microsoft.Azure.Management.Media.Models { + using Microsoft.Rest; using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; using System.Linq; public partial class MediaServiceIdentity @@ -26,15 +29,17 @@ public MediaServiceIdentity() /// /// Initializes a new instance of the MediaServiceIdentity class. /// - /// The identity type. Possible values include: - /// 'SystemAssigned', 'None' + /// The identity type. /// The Principal ID of the identity. /// The Tenant ID of the identity. - public MediaServiceIdentity(ManagedIdentityType type, string principalId = default(string), string tenantId = default(string)) + /// The user assigned managed + /// identities. + public MediaServiceIdentity(string type, System.Guid? principalId = default(System.Guid?), System.Guid? tenantId = default(System.Guid?), IDictionary userAssignedIdentities = default(IDictionary)) { Type = type; PrincipalId = principalId; TenantId = tenantId; + UserAssignedIdentities = userAssignedIdentities; CustomInit(); } @@ -44,32 +49,41 @@ public MediaServiceIdentity() partial void CustomInit(); /// - /// Gets or sets the identity type. Possible values include: - /// 'SystemAssigned', 'None' + /// Gets or sets the identity type. /// [JsonProperty(PropertyName = "type")] - public ManagedIdentityType Type { get; set; } + public string Type { get; set; } /// /// Gets the Principal ID of the identity. /// [JsonProperty(PropertyName = "principalId")] - public string PrincipalId { get; private set; } + public System.Guid? PrincipalId { get; private set; } /// /// Gets the Tenant ID of the identity. /// [JsonProperty(PropertyName = "tenantId")] - public string TenantId { get; private set; } + public System.Guid? TenantId { get; private set; } + + /// + /// Gets or sets the user assigned managed identities. + /// + [JsonProperty(PropertyName = "userAssignedIdentities")] + public IDictionary UserAssignedIdentities { get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { + if (Type == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Type"); + } } } } diff --git a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/MediaServiceUpdate.cs b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/MediaServiceUpdate.cs index 57ed5df3fedd..0b065c3b3213 100644 --- a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/MediaServiceUpdate.cs +++ b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/MediaServiceUpdate.cs @@ -43,9 +43,12 @@ public MediaServiceUpdate() /// The account encryption properties. /// The Key Delivery properties for Media /// Services account. + /// Whether or not public network + /// access is allowed for resources under the Media Services account. + /// Possible values include: 'Enabled', 'Disabled' /// The Managed Identity for the Media Services /// account. - public MediaServiceUpdate(IDictionary tags = default(IDictionary), System.Guid mediaServiceId = default(System.Guid), IList storageAccounts = default(IList), StorageAuthentication? storageAuthentication = default(StorageAuthentication?), AccountEncryption encryption = default(AccountEncryption), KeyDelivery keyDelivery = default(KeyDelivery), MediaServiceIdentity identity = default(MediaServiceIdentity)) + public MediaServiceUpdate(IDictionary tags = default(IDictionary), System.Guid mediaServiceId = default(System.Guid), IList storageAccounts = default(IList), StorageAuthentication? storageAuthentication = default(StorageAuthentication?), AccountEncryption encryption = default(AccountEncryption), KeyDelivery keyDelivery = default(KeyDelivery), PublicNetworkAccess? publicNetworkAccess = default(PublicNetworkAccess?), MediaServiceIdentity identity = default(MediaServiceIdentity)) { Tags = tags; MediaServiceId = mediaServiceId; @@ -53,6 +56,7 @@ public MediaServiceUpdate() StorageAuthentication = storageAuthentication; Encryption = encryption; KeyDelivery = keyDelivery; + PublicNetworkAccess = publicNetworkAccess; Identity = identity; CustomInit(); } @@ -99,6 +103,14 @@ public MediaServiceUpdate() [JsonProperty(PropertyName = "properties.keyDelivery")] public KeyDelivery KeyDelivery { get; set; } + /// + /// Gets or sets whether or not public network access is allowed for + /// resources under the Media Services account. Possible values + /// include: 'Enabled', 'Disabled' + /// + [JsonProperty(PropertyName = "properties.publicNetworkAccess")] + public PublicNetworkAccess? PublicNetworkAccess { get; set; } + /// /// Gets or sets the Managed Identity for the Media Services account. /// diff --git a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/Location.cs b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/OperationCollection.cs similarity index 53% rename from sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/Location.cs rename to sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/OperationCollection.cs index a7181860b958..05e7decbc84f 100644 --- a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/Location.cs +++ b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/OperationCollection.cs @@ -10,26 +10,31 @@ namespace Microsoft.Azure.Management.Media.Models { - using Microsoft.Rest; using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; using System.Linq; - public partial class Location + /// + /// A collection of Operation items. + /// + public partial class OperationCollection { /// - /// Initializes a new instance of the Location class. + /// Initializes a new instance of the OperationCollection class. /// - public Location() + public OperationCollection() { CustomInit(); } /// - /// Initializes a new instance of the Location class. + /// Initializes a new instance of the OperationCollection class. /// - public Location(string name) + /// A collection of Operation items. + public OperationCollection(IList value = default(IList)) { - Name = name; + Value = value; CustomInit(); } @@ -39,22 +44,10 @@ public Location(string name) partial void CustomInit(); /// + /// Gets or sets a collection of Operation items. /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } + [JsonProperty(PropertyName = "value")] + public IList Value { get; set; } - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (Name == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "Name"); - } - } } } diff --git a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/PresetConfigurations.cs b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/PresetConfigurations.cs new file mode 100644 index 000000000000..3857673ae499 --- /dev/null +++ b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/PresetConfigurations.cs @@ -0,0 +1,151 @@ +// +// 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; + + /// + /// An object of optional configuration settings for encoder. + /// + public partial class PresetConfigurations + { + /// + /// Initializes a new instance of the PresetConfigurations class. + /// + public PresetConfigurations() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the PresetConfigurations class. + /// + /// Allows you to configure the encoder + /// settings to control the balance between speed and quality. Example: + /// set Complexity as Speed for faster encoding but less compression + /// efficiency. Possible values include: 'Speed', 'Balanced', + /// 'Quality' + /// Sets the interleave mode of the + /// output to control how audio and video are stored in the container + /// format. Example: set InterleavedOutput as NonInterleavedOutput to + /// produce audio-only and video-only outputs in separate MP4 files. + /// Possible values include: 'NonInterleavedOutput', + /// 'InterleavedOutput' + /// The key frame interval in + /// seconds. Example: set KeyFrameIntervalInSeconds as 2 to reduce the + /// playback buffering for some players. + /// The maximum bitrate in bits per second + /// (threshold for the top video layer). Example: set MaxBitrateBps as + /// 6000000 to avoid producing very high bitrate outputs for contents + /// with high complexity. + /// The maximum height of output video layers. + /// Example: set MaxHeight as 720 to produce output layers up to 720P + /// even if the input is 4K. + /// The maximum number of output video layers. + /// Example: set MaxLayers as 4 to make sure at most 4 output layers + /// are produced to control the overall cost of the encoding + /// job. + /// The minimum bitrate in bits per second + /// (threshold for the bottom video layer). Example: set MinBitrateBps + /// as 200000 to have a bottom layer that covers users with low network + /// bandwidth. + /// The minimum height of output video layers. + /// Example: set MinHeight as 360 to avoid output layers of smaller + /// resolutions like 180P. + public PresetConfigurations(Complexity? complexity = default(Complexity?), InterleaveOutput? interleaveOutput = default(InterleaveOutput?), double? keyFrameIntervalInSeconds = default(double?), int? maxBitrateBps = default(int?), int? maxHeight = default(int?), int? maxLayers = default(int?), int? minBitrateBps = default(int?), int? minHeight = default(int?)) + { + Complexity = complexity; + InterleaveOutput = interleaveOutput; + KeyFrameIntervalInSeconds = keyFrameIntervalInSeconds; + MaxBitrateBps = maxBitrateBps; + MaxHeight = maxHeight; + MaxLayers = maxLayers; + MinBitrateBps = minBitrateBps; + MinHeight = minHeight; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets allows you to configure the encoder settings to + /// control the balance between speed and quality. Example: set + /// Complexity as Speed for faster encoding but less compression + /// efficiency. Possible values include: 'Speed', 'Balanced', 'Quality' + /// + [JsonProperty(PropertyName = "complexity")] + public Complexity? Complexity { get; set; } + + /// + /// Gets or sets sets the interleave mode of the output to control how + /// audio and video are stored in the container format. Example: set + /// InterleavedOutput as NonInterleavedOutput to produce audio-only and + /// video-only outputs in separate MP4 files. Possible values include: + /// 'NonInterleavedOutput', 'InterleavedOutput' + /// + [JsonProperty(PropertyName = "interleaveOutput")] + public InterleaveOutput? InterleaveOutput { get; set; } + + /// + /// Gets or sets the key frame interval in seconds. Example: set + /// KeyFrameIntervalInSeconds as 2 to reduce the playback buffering for + /// some players. + /// + [JsonProperty(PropertyName = "keyFrameIntervalInSeconds")] + public double? KeyFrameIntervalInSeconds { get; set; } + + /// + /// Gets or sets the maximum bitrate in bits per second (threshold for + /// the top video layer). Example: set MaxBitrateBps as 6000000 to + /// avoid producing very high bitrate outputs for contents with high + /// complexity. + /// + [JsonProperty(PropertyName = "maxBitrateBps")] + public int? MaxBitrateBps { get; set; } + + /// + /// Gets or sets the maximum height of output video layers. Example: + /// set MaxHeight as 720 to produce output layers up to 720P even if + /// the input is 4K. + /// + [JsonProperty(PropertyName = "maxHeight")] + public int? MaxHeight { get; set; } + + /// + /// Gets or sets the maximum number of output video layers. Example: + /// set MaxLayers as 4 to make sure at most 4 output layers are + /// produced to control the overall cost of the encoding job. + /// + [JsonProperty(PropertyName = "maxLayers")] + public int? MaxLayers { get; set; } + + /// + /// Gets or sets the minimum bitrate in bits per second (threshold for + /// the bottom video layer). Example: set MinBitrateBps as 200000 to + /// have a bottom layer that covers users with low network bandwidth. + /// + [JsonProperty(PropertyName = "minBitrateBps")] + public int? MinBitrateBps { get; set; } + + /// + /// Gets or sets the minimum height of output video layers. Example: + /// set MinHeight as 360 to avoid output layers of smaller resolutions + /// like 180P. + /// + [JsonProperty(PropertyName = "minHeight")] + public int? MinHeight { get; set; } + + } +} diff --git a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/ManagedIdentityType.cs b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/PublicNetworkAccess.cs similarity index 54% rename from sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/ManagedIdentityType.cs rename to sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/PublicNetworkAccess.cs index 8bf17a402048..899ec7937b99 100644 --- a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/ManagedIdentityType.cs +++ b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/PublicNetworkAccess.cs @@ -13,38 +13,38 @@ namespace Microsoft.Azure.Management.Media.Models using Newtonsoft.Json; /// - /// Defines values for ManagedIdentityType. + /// Defines values for PublicNetworkAccess. /// /// /// Determine base value for a given allowed value if exists, else return /// the value itself /// - [JsonConverter(typeof(ManagedIdentityTypeConverter))] - public struct ManagedIdentityType : System.IEquatable + [JsonConverter(typeof(PublicNetworkAccessConverter))] + public struct PublicNetworkAccess : System.IEquatable { - private ManagedIdentityType(string underlyingValue) + private PublicNetworkAccess(string underlyingValue) { UnderlyingValue=underlyingValue; } /// - /// A system-assigned managed identity. + /// Public network access is enabled. /// - public static readonly ManagedIdentityType SystemAssigned = "SystemAssigned"; + public static readonly PublicNetworkAccess Enabled = "Enabled"; /// - /// No managed identity. + /// Public network access is disabled. /// - public static readonly ManagedIdentityType None = "None"; + public static readonly PublicNetworkAccess Disabled = "Disabled"; /// - /// Underlying value of enum ManagedIdentityType + /// Underlying value of enum PublicNetworkAccess /// private readonly string UnderlyingValue; /// - /// Returns string representation for ManagedIdentityType + /// Returns string representation for PublicNetworkAccess /// public override string ToString() { @@ -52,55 +52,55 @@ public override string ToString() } /// - /// Compares enums of type ManagedIdentityType + /// Compares enums of type PublicNetworkAccess /// - public bool Equals(ManagedIdentityType e) + public bool Equals(PublicNetworkAccess e) { return UnderlyingValue.Equals(e.UnderlyingValue); } /// - /// Implicit operator to convert string to ManagedIdentityType + /// Implicit operator to convert string to PublicNetworkAccess /// - public static implicit operator ManagedIdentityType(string value) + public static implicit operator PublicNetworkAccess(string value) { - return new ManagedIdentityType(value); + return new PublicNetworkAccess(value); } /// - /// Implicit operator to convert ManagedIdentityType to string + /// Implicit operator to convert PublicNetworkAccess to string /// - public static implicit operator string(ManagedIdentityType e) + public static implicit operator string(PublicNetworkAccess e) { return e.UnderlyingValue; } /// - /// Overriding == operator for enum ManagedIdentityType + /// Overriding == operator for enum PublicNetworkAccess /// - public static bool operator == (ManagedIdentityType e1, ManagedIdentityType e2) + public static bool operator == (PublicNetworkAccess e1, PublicNetworkAccess e2) { return e2.Equals(e1); } /// - /// Overriding != operator for enum ManagedIdentityType + /// Overriding != operator for enum PublicNetworkAccess /// - public static bool operator != (ManagedIdentityType e1, ManagedIdentityType e2) + public static bool operator != (PublicNetworkAccess e1, PublicNetworkAccess e2) { return !e2.Equals(e1); } /// - /// Overrides Equals operator for ManagedIdentityType + /// Overrides Equals operator for PublicNetworkAccess /// public override bool Equals(object obj) { - return obj is ManagedIdentityType && Equals((ManagedIdentityType)obj); + return obj is PublicNetworkAccess && Equals((PublicNetworkAccess)obj); } /// - /// Returns for hashCode ManagedIdentityType + /// Returns for hashCode PublicNetworkAccess /// public override int GetHashCode() { diff --git a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/ManagedIdentityTypeConverter.cs b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/PublicNetworkAccessConverter.cs similarity index 73% rename from sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/ManagedIdentityTypeConverter.cs rename to sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/PublicNetworkAccessConverter.cs index 366f0cfd9937..3992c86fb824 100644 --- a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/ManagedIdentityTypeConverter.cs +++ b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/PublicNetworkAccessConverter.cs @@ -15,22 +15,22 @@ namespace Microsoft.Azure.Management.Media.Models using System.Reflection; /// - /// Defines values for ManagedIdentityType. + /// Defines values for PublicNetworkAccess. /// - public sealed class ManagedIdentityTypeConverter : JsonConverter + public sealed class PublicNetworkAccessConverter : JsonConverter { /// - /// Returns if objectType can be converted to ManagedIdentityType by + /// Returns if objectType can be converted to PublicNetworkAccess by /// the converter. /// public override bool CanConvert(System.Type objectType) { - return typeof(ManagedIdentityType).GetTypeInfo().IsAssignableFrom(objectType.GetTypeInfo()); + return typeof(PublicNetworkAccess).GetTypeInfo().IsAssignableFrom(objectType.GetTypeInfo()); } /// - /// Overrides ReadJson and converts token to ManagedIdentityType. + /// Overrides ReadJson and converts token to PublicNetworkAccess. /// public override object ReadJson(JsonReader reader, System.Type objectType, object existingValue, JsonSerializer serializer) { @@ -38,11 +38,11 @@ public override object ReadJson(JsonReader reader, System.Type objectType, objec { return null; } - return (ManagedIdentityType)serializer.Deserialize(reader); + return (PublicNetworkAccess)serializer.Deserialize(reader); } /// - /// Overriding WriteJson for ManagedIdentityType for serialization. + /// Overriding WriteJson for PublicNetworkAccess for serialization. /// public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer) { diff --git a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/ResourceIdentity.cs b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/ResourceIdentity.cs new file mode 100644 index 000000000000..daca01b3cd6d --- /dev/null +++ b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/ResourceIdentity.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; + + public partial class ResourceIdentity + { + /// + /// Initializes a new instance of the ResourceIdentity class. + /// + public ResourceIdentity() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ResourceIdentity class. + /// + /// Indicates whether to use + /// System Assigned Managed Identity. Mutual exclusive with User + /// Assigned Managed Identity. + /// The user assigned managed + /// identity's ARM ID to use when accessing a resource. + public ResourceIdentity(bool useSystemAssignedIdentity, string userAssignedIdentity = default(string)) + { + UserAssignedIdentity = userAssignedIdentity; + UseSystemAssignedIdentity = useSystemAssignedIdentity; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the user assigned managed identity's ARM ID to use + /// when accessing a resource. + /// + [JsonProperty(PropertyName = "userAssignedIdentity")] + public string UserAssignedIdentity { get; set; } + + /// + /// Gets or sets indicates whether to use System Assigned Managed + /// Identity. Mutual exclusive with User Assigned Managed Identity. + /// + [JsonProperty(PropertyName = "useSystemAssignedIdentity")] + public bool UseSystemAssignedIdentity { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + //Nothing to validate + } + } +} diff --git a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/StorageAccount.cs b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/StorageAccount.cs index 40bbb97259e3..546ade30fd48 100644 --- a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/StorageAccount.cs +++ b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/StorageAccount.cs @@ -36,10 +36,15 @@ public StorageAccount() /// primary storage account must be a Standard Storage account (either /// Microsoft.ClassicStorage or Microsoft.Storage). Blob only storage /// accounts can be added as secondary storage accounts. - public StorageAccount(StorageAccountType type, string id = default(string)) + /// The storage account identity. + /// The current status of the storage account + /// mapping. + public StorageAccount(StorageAccountType type, string id = default(string), ResourceIdentity identity = default(ResourceIdentity), string status = default(string)) { Id = id; Type = type; + Identity = identity; + Status = status; CustomInit(); } @@ -65,6 +70,18 @@ public StorageAccount() [JsonProperty(PropertyName = "type")] public StorageAccountType Type { get; set; } + /// + /// Gets or sets the storage account identity. + /// + [JsonProperty(PropertyName = "identity")] + public ResourceIdentity Identity { get; set; } + + /// + /// Gets the current status of the storage account mapping. + /// + [JsonProperty(PropertyName = "status")] + public string Status { get; private set; } + /// /// Validate the object. /// @@ -73,6 +90,10 @@ public StorageAccount() /// public virtual void Validate() { + if (Identity != null) + { + Identity.Validate(); + } } } } diff --git a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/UserAssignedManagedIdentity.cs b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/UserAssignedManagedIdentity.cs new file mode 100644 index 000000000000..d7726728c294 --- /dev/null +++ b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/UserAssignedManagedIdentity.cs @@ -0,0 +1,58 @@ +// +// 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 UserAssignedManagedIdentity + { + /// + /// Initializes a new instance of the UserAssignedManagedIdentity + /// class. + /// + public UserAssignedManagedIdentity() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the UserAssignedManagedIdentity + /// class. + /// + /// The client ID. + /// The principal ID. + public UserAssignedManagedIdentity(System.Guid? clientId = default(System.Guid?), System.Guid? principalId = default(System.Guid?)) + { + ClientId = clientId; + PrincipalId = principalId; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets the client ID. + /// + [JsonProperty(PropertyName = "clientId")] + public System.Guid? ClientId { get; private set; } + + /// + /// Gets the principal ID. + /// + [JsonProperty(PropertyName = "principalId")] + public System.Guid? PrincipalId { get; private set; } + + } +} 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 01f959a247d8..23327575bec4 100644 --- a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Operations.cs +++ b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Operations.cs @@ -62,173 +62,7 @@ internal Operations(AzureMediaServicesClient client) /// /// The cancellation token. /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when unable to deserialize the response - /// - /// - /// A response object containing the response body and response headers. - /// - public async Task>> ListWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - string apiVersion = "2021-05-01"; - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - 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("/") ? "" : "/")), "providers/Microsoft.Media/operations").ToString(); - 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 ApiErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ApiError _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; - } - - /// - /// List Operations - /// - /// - /// Lists all the Media Services operations. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// Headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -243,11 +77,11 @@ internal Operations(AzureMediaServicesClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> ListWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (nextPageLink == null) + if (Client.ApiVersion == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; @@ -256,14 +90,17 @@ internal Operations(AzureMediaServicesClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("nextPageLink", nextPageLink); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } // Construct URL - string _url = "{nextLink}"; - _url = _url.Replace("{nextLink}", nextPageLink); + 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) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); @@ -324,11 +161,11 @@ internal Operations(AzureMediaServicesClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new ApiErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ApiError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; @@ -352,7 +189,7 @@ internal Operations(AzureMediaServicesClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -365,7 +202,7 @@ internal Operations(AzureMediaServicesClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { diff --git a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/OperationsExtensions.cs b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/OperationsExtensions.cs index a0f85054992c..57ea5f1eb22d 100644 --- a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/OperationsExtensions.cs +++ b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/OperationsExtensions.cs @@ -30,7 +30,7 @@ public static partial class OperationsExtensions /// /// The operations group for this extension method. /// - public static IPage List(this IOperations operations) + public static OperationCollection List(this IOperations operations) { return operations.ListAsync().GetAwaiter().GetResult(); } @@ -47,7 +47,7 @@ public static IPage List(this IOperations operations) /// /// The cancellation token. /// - public static async Task> ListAsync(this IOperations operations, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task ListAsync(this IOperations operations, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.ListWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) { @@ -55,45 +55,5 @@ public static IPage List(this IOperations operations) } } - /// - /// List Operations - /// - /// - /// Lists all the Media Services operations. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListNext(this IOperations operations, string nextPageLink) - { - return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// List Operations - /// - /// - /// Lists all the Media Services operations. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListNextAsync(this IOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - } } diff --git a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/PrivateEndpointConnectionsOperations.cs b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/PrivateEndpointConnectionsOperations.cs index 34f7fb780286..030e96742075 100644 --- a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/PrivateEndpointConnectionsOperations.cs +++ b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/PrivateEndpointConnectionsOperations.cs @@ -68,7 +68,7 @@ internal PrivateEndpointConnectionsOperations(AzureMediaServicesClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -97,7 +97,10 @@ internal PrivateEndpointConnectionsOperations(AzureMediaServicesClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "accountName"); } - string apiVersion = "2021-05-01"; + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -107,7 +110,6 @@ 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); } @@ -118,9 +120,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 (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -182,11 +184,11 @@ internal PrivateEndpointConnectionsOperations(AzureMediaServicesClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new ApiErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ApiError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; @@ -262,7 +264,7 @@ internal PrivateEndpointConnectionsOperations(AzureMediaServicesClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -295,7 +297,10 @@ internal PrivateEndpointConnectionsOperations(AzureMediaServicesClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - string apiVersion = "2021-05-01"; + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -306,7 +311,6 @@ 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); } @@ -318,9 +322,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 (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -382,11 +386,11 @@ internal PrivateEndpointConnectionsOperations(AzureMediaServicesClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new ApiErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ApiError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; @@ -465,7 +469,7 @@ internal PrivateEndpointConnectionsOperations(AzureMediaServicesClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -506,7 +510,10 @@ internal PrivateEndpointConnectionsOperations(AzureMediaServicesClient client) { parameters.Validate(); } - string apiVersion = "2021-05-01"; + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -518,7 +525,6 @@ 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); } @@ -530,9 +536,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 (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -600,11 +606,11 @@ internal PrivateEndpointConnectionsOperations(AzureMediaServicesClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new ApiErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ApiError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; @@ -680,7 +686,7 @@ internal PrivateEndpointConnectionsOperations(AzureMediaServicesClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -710,7 +716,10 @@ internal PrivateEndpointConnectionsOperations(AzureMediaServicesClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - string apiVersion = "2021-05-01"; + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -721,7 +730,6 @@ 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); } @@ -733,9 +741,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 (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -795,13 +803,13 @@ internal PrivateEndpointConnectionsOperations(AzureMediaServicesClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 204) { - var ex = new ApiErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ApiError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; 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 0151d896c140..9367cddb4e6a 100644 --- a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/PrivateLinkResourcesOperations.cs +++ b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/PrivateLinkResourcesOperations.cs @@ -68,7 +68,7 @@ internal PrivateLinkResourcesOperations(AzureMediaServicesClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -97,7 +97,10 @@ internal PrivateLinkResourcesOperations(AzureMediaServicesClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "accountName"); } - string apiVersion = "2021-05-01"; + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -107,7 +110,6 @@ 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); } @@ -118,9 +120,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 (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -182,11 +184,11 @@ internal PrivateLinkResourcesOperations(AzureMediaServicesClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new ApiErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ApiError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; @@ -262,7 +264,7 @@ internal PrivateLinkResourcesOperations(AzureMediaServicesClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -295,7 +297,10 @@ internal PrivateLinkResourcesOperations(AzureMediaServicesClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - string apiVersion = "2021-05-01"; + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -306,7 +311,6 @@ 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); } @@ -318,9 +322,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 (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -382,11 +386,11 @@ internal PrivateLinkResourcesOperations(AzureMediaServicesClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new ApiErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ApiError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; 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 30e53c4f0997..a045ee9f7b08 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,24 @@ public static IEnumerable> ApiInfo_AzureMediaServi { return new Tuple[] { - new Tuple("Media", "AccountFilters", "2020-05-01"), - new Tuple("Media", "AssetFilters", "2020-05-01"), - new Tuple("Media", "Assets", "2020-05-01"), - new Tuple("Media", "ContentKeyPolicies", "2020-05-01"), - new Tuple("Media", "Jobs", "2020-05-01"), - new Tuple("Media", "LiveEvents", "2020-05-01"), - new Tuple("Media", "LiveOutputs", "2020-05-01"), - new Tuple("Media", "Locations", "2021-05-01"), - new Tuple("Media", "Mediaservices", "2021-05-01"), - new Tuple("Media", "Operations", "2021-05-01"), - new Tuple("Media", "PrivateEndpointConnections", "2021-05-01"), - new Tuple("Media", "PrivateLinkResources", "2021-05-01"), - new Tuple("Media", "StreamingEndpoints", "2020-05-01"), - new Tuple("Media", "StreamingLocators", "2020-05-01"), - new Tuple("Media", "StreamingPolicies", "2020-05-01"), - new Tuple("Media", "Transforms", "2020-05-01"), + new Tuple("Media", "AccountFilters", "2021-06-01"), + new Tuple("Media", "AssetFilters", "2021-06-01"), + new Tuple("Media", "Assets", "2021-06-01"), + new Tuple("Media", "ContentKeyPolicies", "2021-06-01"), + new Tuple("Media", "Jobs", "2021-06-01"), + new Tuple("Media", "LiveEvents", "2021-06-01"), + new Tuple("Media", "LiveOutputs", "2021-06-01"), + new Tuple("Media", "Locations", "2021-06-01"), + new Tuple("Media", "Mediaservices", "2021-06-01"), + new Tuple("Media", "Operations", "2021-06-01"), + new Tuple("Media", "PrivateEndpointConnections", "2021-06-01"), + new Tuple("Media", "PrivateLinkResources", "2021-06-01"), + new Tuple("Media", "StreamingEndpoints", "2021-06-01"), + new Tuple("Media", "StreamingLocators", "2021-06-01"), + new Tuple("Media", "StreamingPolicies", "2021-06-01"), + new Tuple("Media", "Transforms", "2021-06-01"), }.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-05 --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 = "e92d236d96ab4e229a9943ddea7a7534982a4028"; - 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 529e67a242e9..c31aa3fe594a 100644 --- a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/StreamingEndpointsOperations.cs +++ b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/StreamingEndpointsOperations.cs @@ -68,7 +68,7 @@ internal StreamingEndpointsOperations(AzureMediaServicesClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -97,7 +97,10 @@ internal StreamingEndpointsOperations(AzureMediaServicesClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "accountName"); } - string apiVersion = "2020-05-01"; + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -107,7 +110,6 @@ 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); } @@ -118,9 +120,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 (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -182,11 +184,11 @@ internal StreamingEndpointsOperations(AzureMediaServicesClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new ApiErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ApiError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; @@ -263,7 +265,7 @@ internal StreamingEndpointsOperations(AzureMediaServicesClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -311,7 +313,10 @@ internal StreamingEndpointsOperations(AzureMediaServicesClient client) throw new ValidationException(ValidationRules.Pattern, "streamingEndpointName", "^[a-zA-Z0-9]+(-*[a-zA-Z0-9])*$"); } } - string apiVersion = "2020-05-01"; + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -322,7 +327,6 @@ 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); } @@ -334,9 +338,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 (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -396,13 +400,13 @@ internal StreamingEndpointsOperations(AzureMediaServicesClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 404) + if ((int)_statusCode != 200) { - var ex = new ApiErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ApiError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; @@ -667,7 +671,7 @@ internal StreamingEndpointsOperations(AzureMediaServicesClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -715,6 +719,10 @@ 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"); @@ -723,7 +731,6 @@ internal StreamingEndpointsOperations(AzureMediaServicesClient client) { parameters.Validate(); } - string apiVersion = "2020-05-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -734,7 +741,6 @@ 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); @@ -748,9 +754,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 (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (autoStart != null) { @@ -822,11 +828,11 @@ internal StreamingEndpointsOperations(AzureMediaServicesClient client) string _responseContent = null; if ((int)_statusCode != 200 && (int)_statusCode != 201) { - var ex = new ApiErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ApiError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; @@ -924,7 +930,7 @@ internal StreamingEndpointsOperations(AzureMediaServicesClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -972,11 +978,14 @@ 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 = "2020-05-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -987,7 +996,6 @@ 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); @@ -1000,9 +1008,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 (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -1070,11 +1078,11 @@ internal StreamingEndpointsOperations(AzureMediaServicesClient client) string _responseContent = null; if ((int)_statusCode != 200 && (int)_statusCode != 202) { - var ex = new ApiErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ApiError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; @@ -1169,7 +1177,7 @@ internal StreamingEndpointsOperations(AzureMediaServicesClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -1214,7 +1222,10 @@ internal StreamingEndpointsOperations(AzureMediaServicesClient client) throw new ValidationException(ValidationRules.Pattern, "streamingEndpointName", "^[a-zA-Z0-9]+(-*[a-zA-Z0-9])*$"); } } - string apiVersion = "2020-05-01"; + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1225,7 +1236,6 @@ 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); } @@ -1237,9 +1247,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 (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -1301,11 +1311,11 @@ internal StreamingEndpointsOperations(AzureMediaServicesClient client) string _responseContent = null; if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 204) { - var ex = new ApiErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ApiError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; @@ -1364,7 +1374,7 @@ internal StreamingEndpointsOperations(AzureMediaServicesClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -1409,7 +1419,10 @@ internal StreamingEndpointsOperations(AzureMediaServicesClient client) throw new ValidationException(ValidationRules.Pattern, "streamingEndpointName", "^[a-zA-Z0-9]+(-*[a-zA-Z0-9])*$"); } } - string apiVersion = "2020-05-01"; + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1420,7 +1433,6 @@ 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); } @@ -1432,9 +1444,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 (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -1496,11 +1508,11 @@ internal StreamingEndpointsOperations(AzureMediaServicesClient client) string _responseContent = null; if ((int)_statusCode != 200 && (int)_statusCode != 202) { - var ex = new ApiErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ApiError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; @@ -1559,7 +1571,7 @@ internal StreamingEndpointsOperations(AzureMediaServicesClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -1604,7 +1616,10 @@ internal StreamingEndpointsOperations(AzureMediaServicesClient client) throw new ValidationException(ValidationRules.Pattern, "streamingEndpointName", "^[a-zA-Z0-9]+(-*[a-zA-Z0-9])*$"); } } - string apiVersion = "2020-05-01"; + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1615,7 +1630,6 @@ 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); } @@ -1627,9 +1641,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 (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -1691,11 +1705,11 @@ internal StreamingEndpointsOperations(AzureMediaServicesClient client) string _responseContent = null; if ((int)_statusCode != 200 && (int)_statusCode != 202) { - var ex = new ApiErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ApiError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; @@ -1757,7 +1771,7 @@ internal StreamingEndpointsOperations(AzureMediaServicesClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -1802,7 +1816,10 @@ internal StreamingEndpointsOperations(AzureMediaServicesClient client) throw new ValidationException(ValidationRules.Pattern, "streamingEndpointName", "^[a-zA-Z0-9]+(-*[a-zA-Z0-9])*$"); } } - string apiVersion = "2020-05-01"; + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } StreamingEntityScaleUnit parameters = new StreamingEntityScaleUnit(); if (scaleUnit != null) { @@ -1818,7 +1835,6 @@ 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); @@ -1831,9 +1847,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 (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -1901,11 +1917,11 @@ internal StreamingEndpointsOperations(AzureMediaServicesClient client) string _responseContent = null; if ((int)_statusCode != 200 && (int)_statusCode != 202) { - var ex = new ApiErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ApiError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; @@ -1958,7 +1974,7 @@ internal StreamingEndpointsOperations(AzureMediaServicesClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -2054,11 +2070,11 @@ internal StreamingEndpointsOperations(AzureMediaServicesClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new ApiErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ApiError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; 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 61f7766f2ef9..ec08d495b7fb 100644 --- a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/StreamingLocatorsOperations.cs +++ b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/StreamingLocatorsOperations.cs @@ -72,7 +72,7 @@ internal StreamingLocatorsOperations(AzureMediaServicesClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -101,7 +101,10 @@ internal StreamingLocatorsOperations(AzureMediaServicesClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "accountName"); } - string apiVersion = "2020-05-01"; + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -112,7 +115,6 @@ 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); } @@ -131,9 +133,9 @@ internal StreamingLocatorsOperations(AzureMediaServicesClient client) _queryParameters.Add(_odataFilter); } } - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -195,11 +197,11 @@ internal StreamingLocatorsOperations(AzureMediaServicesClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new ApiErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ApiError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; @@ -276,7 +278,7 @@ internal StreamingLocatorsOperations(AzureMediaServicesClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -309,7 +311,10 @@ internal StreamingLocatorsOperations(AzureMediaServicesClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "streamingLocatorName"); } - string apiVersion = "2020-05-01"; + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -320,7 +325,6 @@ 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); } @@ -332,9 +336,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 (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -394,13 +398,13 @@ internal StreamingLocatorsOperations(AzureMediaServicesClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 404) + if ((int)_statusCode != 200) { - var ex = new ApiErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ApiError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; @@ -480,7 +484,7 @@ internal StreamingLocatorsOperations(AzureMediaServicesClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -521,7 +525,10 @@ internal StreamingLocatorsOperations(AzureMediaServicesClient client) { parameters.Validate(); } - string apiVersion = "2020-05-01"; + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -533,7 +540,6 @@ 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); } @@ -545,9 +551,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 (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -615,11 +621,11 @@ internal StreamingLocatorsOperations(AzureMediaServicesClient client) string _responseContent = null; if ((int)_statusCode != 201) { - var ex = new ApiErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ApiError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; @@ -696,7 +702,7 @@ internal StreamingLocatorsOperations(AzureMediaServicesClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -726,7 +732,10 @@ internal StreamingLocatorsOperations(AzureMediaServicesClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "streamingLocatorName"); } - string apiVersion = "2020-05-01"; + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -737,7 +746,6 @@ 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); } @@ -749,9 +757,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 (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -813,11 +821,11 @@ internal StreamingLocatorsOperations(AzureMediaServicesClient client) string _responseContent = null; if ((int)_statusCode != 200 && (int)_statusCode != 204) { - var ex = new ApiErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ApiError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; @@ -876,7 +884,7 @@ internal StreamingLocatorsOperations(AzureMediaServicesClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -909,7 +917,10 @@ internal StreamingLocatorsOperations(AzureMediaServicesClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "streamingLocatorName"); } - string apiVersion = "2020-05-01"; + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -920,7 +931,6 @@ 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); } @@ -932,9 +942,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 (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -996,11 +1006,11 @@ internal StreamingLocatorsOperations(AzureMediaServicesClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new ApiErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ApiError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; @@ -1077,7 +1087,7 @@ internal StreamingLocatorsOperations(AzureMediaServicesClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -1110,7 +1120,10 @@ internal StreamingLocatorsOperations(AzureMediaServicesClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "streamingLocatorName"); } - string apiVersion = "2020-05-01"; + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1121,7 +1134,6 @@ 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); } @@ -1133,9 +1145,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 (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -1197,11 +1209,11 @@ internal StreamingLocatorsOperations(AzureMediaServicesClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new ApiErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ApiError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; @@ -1272,7 +1284,7 @@ internal StreamingLocatorsOperations(AzureMediaServicesClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -1368,11 +1380,11 @@ internal StreamingLocatorsOperations(AzureMediaServicesClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new ApiErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ApiError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; 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 0471b87b46f9..99dda0480a61 100644 --- a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/StreamingPoliciesOperations.cs +++ b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/StreamingPoliciesOperations.cs @@ -72,7 +72,7 @@ internal StreamingPoliciesOperations(AzureMediaServicesClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -101,7 +101,10 @@ internal StreamingPoliciesOperations(AzureMediaServicesClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "accountName"); } - string apiVersion = "2020-05-01"; + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -112,7 +115,6 @@ 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); } @@ -131,9 +133,9 @@ internal StreamingPoliciesOperations(AzureMediaServicesClient client) _queryParameters.Add(_odataFilter); } } - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -195,11 +197,11 @@ internal StreamingPoliciesOperations(AzureMediaServicesClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new ApiErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ApiError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; @@ -276,7 +278,7 @@ internal StreamingPoliciesOperations(AzureMediaServicesClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -309,7 +311,10 @@ internal StreamingPoliciesOperations(AzureMediaServicesClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "streamingPolicyName"); } - string apiVersion = "2020-05-01"; + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -320,7 +325,6 @@ 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); } @@ -332,9 +336,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 (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -394,13 +398,13 @@ internal StreamingPoliciesOperations(AzureMediaServicesClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 404) + if ((int)_statusCode != 200) { - var ex = new ApiErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ApiError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; @@ -480,7 +484,7 @@ internal StreamingPoliciesOperations(AzureMediaServicesClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -521,7 +525,10 @@ internal StreamingPoliciesOperations(AzureMediaServicesClient client) { parameters.Validate(); } - string apiVersion = "2020-05-01"; + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -533,7 +540,6 @@ 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); } @@ -545,9 +551,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 (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -615,11 +621,11 @@ internal StreamingPoliciesOperations(AzureMediaServicesClient client) string _responseContent = null; if ((int)_statusCode != 201) { - var ex = new ApiErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ApiError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; @@ -696,7 +702,7 @@ internal StreamingPoliciesOperations(AzureMediaServicesClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -726,7 +732,10 @@ internal StreamingPoliciesOperations(AzureMediaServicesClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "streamingPolicyName"); } - string apiVersion = "2020-05-01"; + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -737,7 +746,6 @@ 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); } @@ -749,9 +757,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 (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -813,11 +821,11 @@ internal StreamingPoliciesOperations(AzureMediaServicesClient client) string _responseContent = null; if ((int)_statusCode != 200 && (int)_statusCode != 204) { - var ex = new ApiErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ApiError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; @@ -870,7 +878,7 @@ internal StreamingPoliciesOperations(AzureMediaServicesClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -966,11 +974,11 @@ internal StreamingPoliciesOperations(AzureMediaServicesClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new ApiErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ApiError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; 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 1e6eaadec5c5..b7884438d191 100644 --- a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/TransformsOperations.cs +++ b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/TransformsOperations.cs @@ -72,7 +72,7 @@ internal TransformsOperations(AzureMediaServicesClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -101,7 +101,10 @@ internal TransformsOperations(AzureMediaServicesClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "accountName"); } - string apiVersion = "2020-05-01"; + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -112,7 +115,6 @@ 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); } @@ -131,9 +133,9 @@ internal TransformsOperations(AzureMediaServicesClient client) _queryParameters.Add(_odataFilter); } } - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -195,11 +197,11 @@ internal TransformsOperations(AzureMediaServicesClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new ApiErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ApiError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; @@ -276,7 +278,7 @@ internal TransformsOperations(AzureMediaServicesClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -309,7 +311,10 @@ internal TransformsOperations(AzureMediaServicesClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "transformName"); } - string apiVersion = "2020-05-01"; + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -320,7 +325,6 @@ 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); } @@ -332,9 +336,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 (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -394,13 +398,13 @@ internal TransformsOperations(AzureMediaServicesClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 404) + if ((int)_statusCode != 200) { - var ex = new ApiErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ApiError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; @@ -484,7 +488,7 @@ internal TransformsOperations(AzureMediaServicesClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -517,6 +521,10 @@ 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"); @@ -531,7 +539,6 @@ internal TransformsOperations(AzureMediaServicesClient client) } } } - string apiVersion = "2020-05-01"; Transform parameters = new Transform(); if (description != null || outputs != null) { @@ -548,7 +555,6 @@ 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); @@ -561,9 +567,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 (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -631,11 +637,11 @@ internal TransformsOperations(AzureMediaServicesClient client) string _responseContent = null; if ((int)_statusCode != 200 && (int)_statusCode != 201) { - var ex = new ApiErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ApiError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; @@ -730,7 +736,7 @@ internal TransformsOperations(AzureMediaServicesClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -760,7 +766,10 @@ internal TransformsOperations(AzureMediaServicesClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "transformName"); } - string apiVersion = "2020-05-01"; + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -771,7 +780,6 @@ 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); } @@ -783,9 +791,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 (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -847,11 +855,11 @@ internal TransformsOperations(AzureMediaServicesClient client) string _responseContent = null; if ((int)_statusCode != 200 && (int)_statusCode != 204) { - var ex = new ApiErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ApiError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; @@ -917,7 +925,7 @@ internal TransformsOperations(AzureMediaServicesClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -950,6 +958,10 @@ 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"); @@ -964,7 +976,6 @@ internal TransformsOperations(AzureMediaServicesClient client) } } } - string apiVersion = "2020-05-01"; Transform parameters = new Transform(); if (description != null || outputs != null) { @@ -981,7 +992,6 @@ 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); @@ -994,9 +1004,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 (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -1064,11 +1074,11 @@ internal TransformsOperations(AzureMediaServicesClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new ApiErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ApiError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; @@ -1139,7 +1149,7 @@ internal TransformsOperations(AzureMediaServicesClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -1235,11 +1245,11 @@ internal TransformsOperations(AzureMediaServicesClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new ApiErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ApiError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody;