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 74865642e5b8a..ef9453394a367 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 6926c5d208543..7dfde3d47d607 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 2eb5e3bf8ba1d..9edaf7b7a9ceb 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 ecf5f4178e360..9b6d3666b6cf3 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.
///
@@ -111,16 +116,6 @@ public partial class AzureMediaServicesClient : ServiceClient
public virtual IContentKeyPoliciesOperations ContentKeyPolicies { get; private set; }
- ///
- /// Gets the ITransformsOperations.
- ///
- public virtual ITransformsOperations Transforms { get; private set; }
-
- ///
- /// Gets the IJobsOperations.
- ///
- public virtual IJobsOperations Jobs { get; private set; }
-
///
/// Gets the IStreamingPoliciesOperations.
///
@@ -387,23 +382,22 @@ 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);
- Transforms = new TransformsOperations(this);
- Jobs = new JobsOperations(this);
StreamingPolicies = new StreamingPoliciesOperations(this);
StreamingLocators = new StreamingLocatorsOperations(this);
LiveEvents = new LiveEventsOperations(this);
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;
@@ -441,26 +435,6 @@ private void Initialize()
DeserializationSettings.Converters.Add(new PolymorphicDeserializeJsonConverter("@odata.type"));
SerializationSettings.Converters.Add(new PolymorphicSerializeJsonConverter("@odata.type"));
DeserializationSettings.Converters.Add(new PolymorphicDeserializeJsonConverter("@odata.type"));
- SerializationSettings.Converters.Add(new PolymorphicSerializeJsonConverter("@odata.type"));
- DeserializationSettings.Converters.Add(new PolymorphicDeserializeJsonConverter("@odata.type"));
- SerializationSettings.Converters.Add(new PolymorphicSerializeJsonConverter("@odata.type"));
- DeserializationSettings.Converters.Add(new PolymorphicDeserializeJsonConverter("@odata.type"));
- SerializationSettings.Converters.Add(new PolymorphicSerializeJsonConverter("@odata.type"));
- DeserializationSettings.Converters.Add(new PolymorphicDeserializeJsonConverter("@odata.type"));
- SerializationSettings.Converters.Add(new PolymorphicSerializeJsonConverter("@odata.type"));
- DeserializationSettings.Converters.Add(new PolymorphicDeserializeJsonConverter("@odata.type"));
- SerializationSettings.Converters.Add(new PolymorphicSerializeJsonConverter("@odata.type"));
- DeserializationSettings.Converters.Add(new PolymorphicDeserializeJsonConverter("@odata.type"));
- SerializationSettings.Converters.Add(new PolymorphicSerializeJsonConverter("@odata.type"));
- DeserializationSettings.Converters.Add(new PolymorphicDeserializeJsonConverter("@odata.type"));
- SerializationSettings.Converters.Add(new PolymorphicSerializeJsonConverter("@odata.type"));
- DeserializationSettings.Converters.Add(new PolymorphicDeserializeJsonConverter("@odata.type"));
- SerializationSettings.Converters.Add(new PolymorphicSerializeJsonConverter("@odata.type"));
- DeserializationSettings.Converters.Add(new PolymorphicDeserializeJsonConverter("@odata.type"));
- SerializationSettings.Converters.Add(new PolymorphicSerializeJsonConverter("@odata.type"));
- DeserializationSettings.Converters.Add(new PolymorphicDeserializeJsonConverter("@odata.type"));
- SerializationSettings.Converters.Add(new PolymorphicSerializeJsonConverter("@odata.type"));
- DeserializationSettings.Converters.Add(new PolymorphicDeserializeJsonConverter("@odata.type"));
CustomInitialize();
DeserializationSettings.Converters.Add(new TransformationJsonConverter());
DeserializationSettings.Converters.Add(new CloudErrorJsonConverter());
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 f4b2da46ce48e..aa14959a33582 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 4625d53a855a4..7f556ecff710d 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 4ef44450f10a5..9fc4523e893fd 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 8c814068c5ee2..7d112a496dd8b 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 2a8f5b8510cb0..c8a8d2e540aaf 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.
///
@@ -108,16 +113,6 @@ public partial interface IAzureMediaServicesClient : System.IDisposable
///
IContentKeyPoliciesOperations ContentKeyPolicies { get; }
- ///
- /// Gets the ITransformsOperations.
- ///
- ITransformsOperations Transforms { get; }
-
- ///
- /// Gets the IJobsOperations.
- ///
- IJobsOperations Jobs { get; }
-
///
/// Gets the IStreamingPoliciesOperations.
///
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 f23639599569b..ab7dcbc32e5dd 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
deleted file mode 100644
index 8e04bc61e91b1..0000000000000
--- a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/IJobsOperations.cs
+++ /dev/null
@@ -1,259 +0,0 @@
-//
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License. See License.txt in the project root for
-// license information.
-//
-// Code generated by Microsoft (R) AutoRest Code Generator.
-// Changes may cause incorrect behavior and will be lost if the code is
-// regenerated.
-//
-
-namespace Microsoft.Azure.Management.Media
-{
- using Microsoft.Rest;
- using Microsoft.Rest.Azure;
- using Microsoft.Rest.Azure.OData;
- using Models;
- using System.Collections;
- using System.Collections.Generic;
- using System.Threading;
- using System.Threading.Tasks;
-
- ///
- /// JobsOperations operations.
- ///
- public partial interface IJobsOperations
- {
- ///
- /// List Jobs
- ///
- ///
- /// Lists all of the Jobs for the Transform.
- ///
- ///
- /// The name of the resource group within the Azure subscription.
- ///
- ///
- /// The Media Services account name.
- ///
- ///
- /// The Transform name.
- ///
- ///
- /// OData parameters to apply to the 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>> ListWithHttpMessagesAsync(string resourceGroupName, string accountName, string transformName, ODataQuery odataQuery = default(ODataQuery), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
- ///
- /// Get Job
- ///
- ///
- /// Gets a Job.
- ///
- ///
- /// The name of the resource group within the Azure subscription.
- ///
- ///
- /// The Media Services account name.
- ///
- ///
- /// The Transform name.
- ///
- ///
- /// The Job name.
- ///
- ///
- /// The headers that will be added to request.
- ///
- ///
- /// The cancellation token.
- ///
- ///
- /// Thrown when the operation returned an invalid status code
- ///
- ///
- /// Thrown when unable to deserialize the response
- ///
- ///
- /// Thrown when a required parameter is null
- ///
- Task> GetWithHttpMessagesAsync(string resourceGroupName, string accountName, string transformName, string jobName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
- ///
- /// Create Job
- ///
- ///
- /// Creates a Job.
- ///
- ///
- /// The name of the resource group within the Azure subscription.
- ///
- ///
- /// The Media Services account name.
- ///
- ///
- /// The Transform name.
- ///
- ///
- /// The Job name.
- ///
- ///
- /// The request parameters
- ///
- ///
- /// The headers that will be added to request.
- ///
- ///
- /// The cancellation token.
- ///
- ///
- /// Thrown when the operation returned an invalid status code
- ///
- ///
- /// Thrown when unable to deserialize the response
- ///
- ///
- /// Thrown when a required parameter is null
- ///
- Task> CreateWithHttpMessagesAsync(string resourceGroupName, string accountName, string transformName, string jobName, Job parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
- ///
- /// Delete Job
- ///
- ///
- /// Deletes a Job.
- ///
- ///
- /// The name of the resource group within the Azure subscription.
- ///
- ///
- /// The Media Services account name.
- ///
- ///
- /// The Transform name.
- ///
- ///
- /// The Job name.
- ///
- ///
- /// The headers that will be added to request.
- ///
- ///
- /// The cancellation token.
- ///
- ///
- /// Thrown when the operation returned an invalid status code
- ///
- ///
- /// Thrown when a required parameter is null
- ///
- Task DeleteWithHttpMessagesAsync(string resourceGroupName, string accountName, string transformName, string jobName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
- ///
- /// Update Job
- ///
- ///
- /// Update is only supported for description and priority. Updating
- /// Priority will take effect when the Job state is Queued or Scheduled
- /// and depending on the timing the priority update may be ignored.
- ///
- ///
- /// The name of the resource group within the Azure subscription.
- ///
- ///
- /// The Media Services account name.
- ///
- ///
- /// The Transform name.
- ///
- ///
- /// The Job name.
- ///
- ///
- /// The request parameters
- ///
- ///
- /// The headers that will be added to request.
- ///
- ///
- /// The cancellation token.
- ///
- ///
- /// Thrown when the operation returned an invalid status code
- ///
- ///
- /// Thrown when unable to deserialize the response
- ///
- ///
- /// Thrown when a required parameter is null
- ///
- Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string accountName, string transformName, string jobName, Job parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
- ///
- /// Cancel Job
- ///
- ///
- /// Cancel a Job.
- ///
- ///
- /// The name of the resource group within the Azure subscription.
- ///
- ///
- /// The Media Services account name.
- ///
- ///
- /// The Transform name.
- ///
- ///
- /// The Job name.
- ///
- ///
- /// The headers that will be added to request.
- ///
- ///
- /// The cancellation token.
- ///
- ///
- /// Thrown when the operation returned an invalid status code
- ///
- ///
- /// Thrown when a required parameter is null
- ///
- Task CancelJobWithHttpMessagesAsync(string resourceGroupName, string accountName, string transformName, string jobName, Dictionary