diff --git a/sdk/iotcentral/Microsoft.Azure.Management.IotCentral/src/Generated/AppsOperations.cs b/sdk/iotcentral/Microsoft.Azure.Management.IotCentral/src/Generated/AppsOperations.cs
index acbd90b300e3..a383c6326dad 100644
--- a/sdk/iotcentral/Microsoft.Azure.Management.IotCentral/src/Generated/AppsOperations.cs
+++ b/sdk/iotcentral/Microsoft.Azure.Management.IotCentral/src/Generated/AppsOperations.cs
@@ -65,7 +65,7 @@ internal AppsOperations(IotCentralClient client)
///
/// The cancellation token.
///
- ///
+ ///
/// Thrown when the operation returned an invalid status code
///
///
@@ -181,13 +181,14 @@ internal AppsOperations(IotCentralClient client)
string _responseContent = null;
if ((int)_statusCode != 200)
{
- var ex = new ErrorDetailsException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
+ var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
try
{
_responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
- ErrorDetails _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
if (_errorBody != null)
{
+ ex = new CloudException(_errorBody.Message);
ex.Body = _errorBody;
}
}
@@ -197,6 +198,10 @@ internal AppsOperations(IotCentralClient client)
}
ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent);
ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent);
+ if (_httpResponse.Headers.Contains("x-ms-request-id"))
+ {
+ ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
+ }
if (_shouldTrace)
{
ServiceClientTracing.Error(_invocationId, ex);
@@ -325,7 +330,7 @@ internal AppsOperations(IotCentralClient client)
///
/// The cancellation token.
///
- ///
+ ///
/// Thrown when the operation returned an invalid status code
///
///
@@ -429,13 +434,14 @@ internal AppsOperations(IotCentralClient client)
string _responseContent = null;
if ((int)_statusCode != 200)
{
- var ex = new ErrorDetailsException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
+ var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
try
{
_responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
- ErrorDetails _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
if (_errorBody != null)
{
+ ex = new CloudException(_errorBody.Message);
ex.Body = _errorBody;
}
}
@@ -445,6 +451,10 @@ internal AppsOperations(IotCentralClient client)
}
ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent);
ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent);
+ if (_httpResponse.Headers.Contains("x-ms-request-id"))
+ {
+ ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
+ }
if (_shouldTrace)
{
ServiceClientTracing.Error(_invocationId, ex);
@@ -501,7 +511,7 @@ internal AppsOperations(IotCentralClient client)
///
/// The cancellation token.
///
- ///
+ ///
/// Thrown when the operation returned an invalid status code
///
///
@@ -611,13 +621,14 @@ internal AppsOperations(IotCentralClient client)
string _responseContent = null;
if ((int)_statusCode != 200)
{
- var ex = new ErrorDetailsException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
+ var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
try
{
_responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
- ErrorDetails _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
if (_errorBody != null)
{
+ ex = new CloudException(_errorBody.Message);
ex.Body = _errorBody;
}
}
@@ -627,6 +638,10 @@ internal AppsOperations(IotCentralClient client)
}
ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent);
ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent);
+ if (_httpResponse.Headers.Contains("x-ms-request-id"))
+ {
+ ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
+ }
if (_shouldTrace)
{
ServiceClientTracing.Error(_invocationId, ex);
@@ -684,7 +699,7 @@ internal AppsOperations(IotCentralClient client)
///
/// The cancellation token.
///
- ///
+ ///
/// Thrown when the operation returned an invalid status code
///
///
@@ -803,13 +818,14 @@ internal AppsOperations(IotCentralClient client)
string _responseContent = null;
if ((int)_statusCode != 200)
{
- var ex = new ErrorDetailsException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
+ var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
try
{
_responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
- ErrorDetails _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
if (_errorBody != null)
{
+ ex = new CloudException(_errorBody.Message);
ex.Body = _errorBody;
}
}
@@ -819,6 +835,10 @@ internal AppsOperations(IotCentralClient client)
}
ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent);
ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent);
+ if (_httpResponse.Headers.Contains("x-ms-request-id"))
+ {
+ ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
+ }
if (_shouldTrace)
{
ServiceClientTracing.Error(_invocationId, ex);
@@ -876,7 +896,7 @@ internal AppsOperations(IotCentralClient client)
///
/// The cancellation token.
///
- ///
+ ///
/// Thrown when the operation returned an invalid status code
///
///
@@ -995,13 +1015,14 @@ internal AppsOperations(IotCentralClient client)
string _responseContent = null;
if ((int)_statusCode != 200)
{
- var ex = new ErrorDetailsException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
+ var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
try
{
_responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
- ErrorDetails _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
if (_errorBody != null)
{
+ ex = new CloudException(_errorBody.Message);
ex.Body = _errorBody;
}
}
@@ -1011,6 +1032,10 @@ internal AppsOperations(IotCentralClient client)
}
ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent);
ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent);
+ if (_httpResponse.Headers.Contains("x-ms-request-id"))
+ {
+ ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
+ }
if (_shouldTrace)
{
ServiceClientTracing.Error(_invocationId, ex);
@@ -1064,7 +1089,7 @@ internal AppsOperations(IotCentralClient client)
///
/// The cancellation token.
///
- ///
+ ///
/// Thrown when the operation returned an invalid status code
///
///
@@ -1168,13 +1193,14 @@ internal AppsOperations(IotCentralClient client)
string _responseContent = null;
if ((int)_statusCode != 200)
{
- var ex = new ErrorDetailsException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
+ var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
try
{
_responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
- ErrorDetails _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
if (_errorBody != null)
{
+ ex = new CloudException(_errorBody.Message);
ex.Body = _errorBody;
}
}
@@ -1184,6 +1210,10 @@ internal AppsOperations(IotCentralClient client)
}
ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent);
ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent);
+ if (_httpResponse.Headers.Contains("x-ms-request-id"))
+ {
+ ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
+ }
if (_shouldTrace)
{
ServiceClientTracing.Error(_invocationId, ex);
@@ -1249,7 +1279,7 @@ internal AppsOperations(IotCentralClient client)
///
/// The cancellation token.
///
- ///
+ ///
/// Thrown when the operation returned an invalid status code
///
///
@@ -1380,13 +1410,14 @@ internal AppsOperations(IotCentralClient client)
string _responseContent = null;
if ((int)_statusCode != 200 && (int)_statusCode != 201 && (int)_statusCode != 202)
{
- var ex = new ErrorDetailsException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
+ var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
try
{
_responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
- ErrorDetails _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
if (_errorBody != null)
{
+ ex = new CloudException(_errorBody.Message);
ex.Body = _errorBody;
}
}
@@ -1396,6 +1427,10 @@ internal AppsOperations(IotCentralClient client)
}
ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent);
ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent);
+ if (_httpResponse.Headers.Contains("x-ms-request-id"))
+ {
+ ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
+ }
if (_shouldTrace)
{
ServiceClientTracing.Error(_invocationId, ex);
@@ -1476,7 +1511,7 @@ internal AppsOperations(IotCentralClient client)
///
/// The cancellation token.
///
- ///
+ ///
/// Thrown when the operation returned an invalid status code
///
///
@@ -1603,13 +1638,14 @@ internal AppsOperations(IotCentralClient client)
string _responseContent = null;
if ((int)_statusCode != 200 && (int)_statusCode != 202)
{
- var ex = new ErrorDetailsException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
+ var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
try
{
_responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
- ErrorDetails _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
if (_errorBody != null)
{
+ ex = new CloudException(_errorBody.Message);
ex.Body = _errorBody;
}
}
@@ -1619,6 +1655,10 @@ internal AppsOperations(IotCentralClient client)
}
ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent);
ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent);
+ if (_httpResponse.Headers.Contains("x-ms-request-id"))
+ {
+ ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
+ }
if (_shouldTrace)
{
ServiceClientTracing.Error(_invocationId, ex);
@@ -1678,7 +1718,7 @@ internal AppsOperations(IotCentralClient client)
///
/// The cancellation token.
///
- ///
+ ///
/// Thrown when the operation returned an invalid status code
///
///
@@ -1791,13 +1831,14 @@ internal AppsOperations(IotCentralClient client)
string _responseContent = null;
if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 204)
{
- var ex = new ErrorDetailsException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
+ var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
try
{
_responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
- ErrorDetails _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
if (_errorBody != null)
{
+ ex = new CloudException(_errorBody.Message);
ex.Body = _errorBody;
}
}
@@ -1807,6 +1848,10 @@ internal AppsOperations(IotCentralClient client)
}
ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent);
ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent);
+ if (_httpResponse.Headers.Contains("x-ms-request-id"))
+ {
+ ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
+ }
if (_shouldTrace)
{
ServiceClientTracing.Error(_invocationId, ex);
@@ -1845,7 +1890,7 @@ internal AppsOperations(IotCentralClient client)
///
/// The cancellation token.
///
- ///
+ ///
/// Thrown when the operation returned an invalid status code
///
///
@@ -1941,13 +1986,14 @@ internal AppsOperations(IotCentralClient client)
string _responseContent = null;
if ((int)_statusCode != 200)
{
- var ex = new ErrorDetailsException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
+ var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
try
{
_responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
- ErrorDetails _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
if (_errorBody != null)
{
+ ex = new CloudException(_errorBody.Message);
ex.Body = _errorBody;
}
}
@@ -1957,6 +2003,10 @@ internal AppsOperations(IotCentralClient client)
}
ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent);
ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent);
+ if (_httpResponse.Headers.Contains("x-ms-request-id"))
+ {
+ ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
+ }
if (_shouldTrace)
{
ServiceClientTracing.Error(_invocationId, ex);
@@ -2013,7 +2063,7 @@ internal AppsOperations(IotCentralClient client)
///
/// The cancellation token.
///
- ///
+ ///
/// Thrown when the operation returned an invalid status code
///
///
@@ -2109,13 +2159,14 @@ internal AppsOperations(IotCentralClient client)
string _responseContent = null;
if ((int)_statusCode != 200)
{
- var ex = new ErrorDetailsException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
+ var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
try
{
_responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
- ErrorDetails _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
if (_errorBody != null)
{
+ ex = new CloudException(_errorBody.Message);
ex.Body = _errorBody;
}
}
@@ -2125,6 +2176,10 @@ internal AppsOperations(IotCentralClient client)
}
ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent);
ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent);
+ if (_httpResponse.Headers.Contains("x-ms-request-id"))
+ {
+ ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
+ }
if (_shouldTrace)
{
ServiceClientTracing.Error(_invocationId, ex);
@@ -2181,7 +2236,7 @@ internal AppsOperations(IotCentralClient client)
///
/// The cancellation token.
///
- ///
+ ///
/// Thrown when the operation returned an invalid status code
///
///
@@ -2277,13 +2332,14 @@ internal AppsOperations(IotCentralClient client)
string _responseContent = null;
if ((int)_statusCode != 200)
{
- var ex = new ErrorDetailsException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
+ var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
try
{
_responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
- ErrorDetails _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
if (_errorBody != null)
{
+ ex = new CloudException(_errorBody.Message);
ex.Body = _errorBody;
}
}
@@ -2293,6 +2349,10 @@ internal AppsOperations(IotCentralClient client)
}
ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent);
ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent);
+ if (_httpResponse.Headers.Contains("x-ms-request-id"))
+ {
+ ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
+ }
if (_shouldTrace)
{
ServiceClientTracing.Error(_invocationId, ex);
diff --git a/sdk/iotcentral/Microsoft.Azure.Management.IotCentral/src/Generated/IAppsOperations.cs b/sdk/iotcentral/Microsoft.Azure.Management.IotCentral/src/Generated/IAppsOperations.cs
index 88bcfe63dae5..534090f46244 100644
--- a/sdk/iotcentral/Microsoft.Azure.Management.IotCentral/src/Generated/IAppsOperations.cs
+++ b/sdk/iotcentral/Microsoft.Azure.Management.IotCentral/src/Generated/IAppsOperations.cs
@@ -39,7 +39,7 @@ public partial interface IAppsOperations
///
/// The cancellation token.
///
- ///
+ ///
/// Thrown when the operation returned an invalid status code
///
///
@@ -72,7 +72,7 @@ public partial interface IAppsOperations
///
/// The cancellation token.
///
- ///
+ ///
/// Thrown when the operation returned an invalid status code
///
///
@@ -101,7 +101,7 @@ public partial interface IAppsOperations
///
/// The cancellation token.
///
- ///
+ ///
/// Thrown when the operation returned an invalid status code
///
///
@@ -127,7 +127,7 @@ public partial interface IAppsOperations
///
/// The cancellation token.
///
- ///
+ ///
/// Thrown when the operation returned an invalid status code
///
///
@@ -143,7 +143,7 @@ public partial interface IAppsOperations
///
/// The cancellation token.
///
- ///
+ ///
/// Thrown when the operation returned an invalid status code
///
///
@@ -166,7 +166,7 @@ public partial interface IAppsOperations
///
/// The cancellation token.
///
- ///
+ ///
/// Thrown when the operation returned an invalid status code
///
///
@@ -189,7 +189,7 @@ public partial interface IAppsOperations
///
/// The cancellation token.
///
- ///
+ ///
/// Thrown when the operation returned an invalid status code
///
///
@@ -212,7 +212,7 @@ public partial interface IAppsOperations
///
/// The cancellation token.
///
- ///
+ ///
/// Thrown when the operation returned an invalid status code
///
///
@@ -231,7 +231,7 @@ public partial interface IAppsOperations
///
/// The cancellation token.
///
- ///
+ ///
/// Thrown when the operation returned an invalid status code
///
///
@@ -264,7 +264,7 @@ public partial interface IAppsOperations
///
/// The cancellation token.
///
- ///
+ ///
/// Thrown when the operation returned an invalid status code
///
///
@@ -293,7 +293,7 @@ public partial interface IAppsOperations
///
/// The cancellation token.
///
- ///
+ ///
/// Thrown when the operation returned an invalid status code
///
///
@@ -319,7 +319,7 @@ public partial interface IAppsOperations
///
/// The cancellation token.
///
- ///
+ ///
/// Thrown when the operation returned an invalid status code
///
///
@@ -338,7 +338,7 @@ public partial interface IAppsOperations
///
/// The cancellation token.
///
- ///
+ ///
/// Thrown when the operation returned an invalid status code
///
///
@@ -360,7 +360,7 @@ public partial interface IAppsOperations
///
/// The cancellation token.
///
- ///
+ ///
/// Thrown when the operation returned an invalid status code
///
///
@@ -382,7 +382,7 @@ public partial interface IAppsOperations
///
/// The cancellation token.
///
- ///
+ ///
/// Thrown when the operation returned an invalid status code
///
///
diff --git a/sdk/iotcentral/Microsoft.Azure.Management.IotCentral/src/Generated/IOperations.cs b/sdk/iotcentral/Microsoft.Azure.Management.IotCentral/src/Generated/IOperations.cs
index 2c1a6c152b0d..76541811542c 100644
--- a/sdk/iotcentral/Microsoft.Azure.Management.IotCentral/src/Generated/IOperations.cs
+++ b/sdk/iotcentral/Microsoft.Azure.Management.IotCentral/src/Generated/IOperations.cs
@@ -33,7 +33,7 @@ public partial interface IOperations
///
/// The cancellation token.
///
- ///
+ ///
/// Thrown when the operation returned an invalid status code
///
///
@@ -56,7 +56,7 @@ public partial interface IOperations
///
/// The cancellation token.
///
- ///
+ ///
/// Thrown when the operation returned an invalid status code
///
///
diff --git a/sdk/iotcentral/Microsoft.Azure.Management.IotCentral/src/Generated/Models/App.cs b/sdk/iotcentral/Microsoft.Azure.Management.IotCentral/src/Generated/Models/App.cs
index 7bb89715d466..ae9f2efd9b97 100644
--- a/sdk/iotcentral/Microsoft.Azure.Management.IotCentral/src/Generated/Models/App.cs
+++ b/sdk/iotcentral/Microsoft.Azure.Management.IotCentral/src/Generated/Models/App.cs
@@ -111,20 +111,6 @@ public override void Validate()
{
throw new ValidationException(ValidationRules.CannotBeNull, "Sku");
}
- if (DisplayName != null)
- {
- if (!System.Text.RegularExpressions.Regex.IsMatch(DisplayName, "^.{1,200}$"))
- {
- throw new ValidationException(ValidationRules.Pattern, "DisplayName", "^.{1,200}$");
- }
- }
- if (Subdomain != null)
- {
- if (!System.Text.RegularExpressions.Regex.IsMatch(Subdomain, "^[a-z0-9-]{1,63}$"))
- {
- throw new ValidationException(ValidationRules.Pattern, "Subdomain", "^[a-z0-9-]{1,63}$");
- }
- }
if (Sku != null)
{
Sku.Validate();
diff --git a/sdk/iotcentral/Microsoft.Azure.Management.IotCentral/src/Generated/Models/AppPatch.cs b/sdk/iotcentral/Microsoft.Azure.Management.IotCentral/src/Generated/Models/AppPatch.cs
index 2817821d780e..3cbd09426950 100644
--- a/sdk/iotcentral/Microsoft.Azure.Management.IotCentral/src/Generated/Models/AppPatch.cs
+++ b/sdk/iotcentral/Microsoft.Azure.Management.IotCentral/src/Generated/Models/AppPatch.cs
@@ -92,28 +92,5 @@ public AppPatch()
[JsonProperty(PropertyName = "properties.template")]
public string Template { get; set; }
- ///
- /// Validate the object.
- ///
- ///
- /// Thrown if validation fails
- ///
- public virtual void Validate()
- {
- if (DisplayName != null)
- {
- if (!System.Text.RegularExpressions.Regex.IsMatch(DisplayName, "^.{1,200}$"))
- {
- throw new ValidationException(ValidationRules.Pattern, "DisplayName", "^.{1,200}$");
- }
- }
- if (Subdomain != null)
- {
- if (!System.Text.RegularExpressions.Regex.IsMatch(Subdomain, "^[a-z0-9-]{1,63}$"))
- {
- throw new ValidationException(ValidationRules.Pattern, "Subdomain", "^[a-z0-9-]{1,63}$");
- }
- }
- }
}
}
diff --git a/sdk/iotcentral/Microsoft.Azure.Management.IotCentral/src/Generated/Models/ErrorResponseBody.cs b/sdk/iotcentral/Microsoft.Azure.Management.IotCentral/src/Generated/Models/CloudErrorBody.cs
similarity index 81%
rename from sdk/iotcentral/Microsoft.Azure.Management.IotCentral/src/Generated/Models/ErrorResponseBody.cs
rename to sdk/iotcentral/Microsoft.Azure.Management.IotCentral/src/Generated/Models/CloudErrorBody.cs
index 9aa1e14dab0b..6ca9f55e5c60 100644
--- a/sdk/iotcentral/Microsoft.Azure.Management.IotCentral/src/Generated/Models/ErrorResponseBody.cs
+++ b/sdk/iotcentral/Microsoft.Azure.Management.IotCentral/src/Generated/Models/CloudErrorBody.cs
@@ -18,25 +18,25 @@ namespace Microsoft.Azure.Management.IotCentral.Models
///
/// Details of error response.
///
- public partial class ErrorResponseBody
+ public partial class CloudErrorBody
{
///
- /// Initializes a new instance of the ErrorResponseBody class.
+ /// Initializes a new instance of the CloudErrorBody class.
///
- public ErrorResponseBody()
+ public CloudErrorBody()
{
CustomInit();
}
///
- /// Initializes a new instance of the ErrorResponseBody class.
+ /// Initializes a new instance of the CloudErrorBody class.
///
/// The error code.
/// The error message.
/// The target of the particular error.
/// A list of additional details about the
/// error.
- public ErrorResponseBody(string code = default(string), string message = default(string), string target = default(string), IList details = default(IList))
+ public CloudErrorBody(string code = default(string), string message = default(string), string target = default(string), IList details = default(IList))
{
Code = code;
Message = message;
@@ -72,7 +72,7 @@ public ErrorResponseBody()
/// Gets or sets a list of additional details about the error.
///
[JsonProperty(PropertyName = "details")]
- public IList Details { get; set; }
+ public IList Details { get; set; }
}
}
diff --git a/sdk/iotcentral/Microsoft.Azure.Management.IotCentral/src/Generated/Models/ErrorDetails.cs b/sdk/iotcentral/Microsoft.Azure.Management.IotCentral/src/Generated/Models/ErrorDetails.cs
deleted file mode 100644
index 8c7527fe8098..000000000000
--- a/sdk/iotcentral/Microsoft.Azure.Management.IotCentral/src/Generated/Models/ErrorDetails.cs
+++ /dev/null
@@ -1,81 +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.IotCentral.Models
-{
- using Microsoft.Rest;
- using Microsoft.Rest.Serialization;
- using Newtonsoft.Json;
- using System.Collections;
- using System.Collections.Generic;
- using System.Linq;
-
- ///
- /// Error details.
- ///
- [Rest.Serialization.JsonTransformation]
- public partial class ErrorDetails
- {
- ///
- /// Initializes a new instance of the ErrorDetails class.
- ///
- public ErrorDetails()
- {
- CustomInit();
- }
-
- ///
- /// Initializes a new instance of the ErrorDetails class.
- ///
- /// The error code.
- /// The error message.
- /// The target of the particular error.
- /// A list of additional details about the
- /// error.
- public ErrorDetails(string code = default(string), string message = default(string), string target = default(string), IList details = default(IList))
- {
- Code = code;
- Message = message;
- Target = target;
- Details = details;
- CustomInit();
- }
-
- ///
- /// An initialization method that performs custom operations like setting defaults
- ///
- partial void CustomInit();
-
- ///
- /// Gets the error code.
- ///
- [JsonProperty(PropertyName = "error.code")]
- public string Code { get; private set; }
-
- ///
- /// Gets the error message.
- ///
- [JsonProperty(PropertyName = "error.message")]
- public string Message { get; private set; }
-
- ///
- /// Gets the target of the particular error.
- ///
- [JsonProperty(PropertyName = "error.target")]
- public string Target { get; private set; }
-
- ///
- /// Gets or sets a list of additional details about the error.
- ///
- [JsonProperty(PropertyName = "error.details")]
- public IList Details { get; set; }
-
- }
-}
diff --git a/sdk/iotcentral/Microsoft.Azure.Management.IotCentral/src/Generated/Models/ErrorDetailsException.cs b/sdk/iotcentral/Microsoft.Azure.Management.IotCentral/src/Generated/Models/ErrorDetailsException.cs
deleted file mode 100644
index acc80ee264f6..000000000000
--- a/sdk/iotcentral/Microsoft.Azure.Management.IotCentral/src/Generated/Models/ErrorDetailsException.cs
+++ /dev/null
@@ -1,61 +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.IotCentral.Models
-{
- using Microsoft.Rest;
-
- ///
- /// Exception thrown for an invalid response with ErrorDetails information.
- ///
- public partial class ErrorDetailsException : RestException
- {
- ///
- /// Gets information about the associated HTTP request.
- ///
- public HttpRequestMessageWrapper Request { get; set; }
-
- ///
- /// Gets information about the associated HTTP response.
- ///
- public HttpResponseMessageWrapper Response { get; set; }
-
- ///
- /// Gets or sets the body object.
- ///
- public ErrorDetails Body { get; set; }
-
- ///
- /// Initializes a new instance of the ErrorDetailsException class.
- ///
- public ErrorDetailsException()
- {
- }
-
- ///
- /// Initializes a new instance of the ErrorDetailsException class.
- ///
- /// The exception message.
- public ErrorDetailsException(string message)
- : this(message, null)
- {
- }
-
- ///
- /// Initializes a new instance of the ErrorDetailsException class.
- ///
- /// The exception message.
- /// Inner exception.
- public ErrorDetailsException(string message, System.Exception innerException)
- : base(message, innerException)
- {
- }
- }
-}
diff --git a/sdk/iotcentral/Microsoft.Azure.Management.IotCentral/src/Generated/Models/OperationInputs.cs b/sdk/iotcentral/Microsoft.Azure.Management.IotCentral/src/Generated/Models/OperationInputs.cs
index f2114661cd08..a26c6c2700bc 100644
--- a/sdk/iotcentral/Microsoft.Azure.Management.IotCentral/src/Generated/Models/OperationInputs.cs
+++ b/sdk/iotcentral/Microsoft.Azure.Management.IotCentral/src/Generated/Models/OperationInputs.cs
@@ -71,13 +71,6 @@ public virtual void Validate()
{
throw new ValidationException(ValidationRules.CannotBeNull, "Name");
}
- if (Name != null)
- {
- if (!System.Text.RegularExpressions.Regex.IsMatch(Name, "^[a-z0-9-]{1,63}$"))
- {
- throw new ValidationException(ValidationRules.Pattern, "Name", "^[a-z0-9-]{1,63}$");
- }
- }
}
}
}
diff --git a/sdk/iotcentral/Microsoft.Azure.Management.IotCentral/src/Generated/Operations.cs b/sdk/iotcentral/Microsoft.Azure.Management.IotCentral/src/Generated/Operations.cs
index ea0a0e51cc93..9f9db537c879 100644
--- a/sdk/iotcentral/Microsoft.Azure.Management.IotCentral/src/Generated/Operations.cs
+++ b/sdk/iotcentral/Microsoft.Azure.Management.IotCentral/src/Generated/Operations.cs
@@ -59,7 +59,7 @@ internal Operations(IotCentralClient client)
///
/// The cancellation token.
///
- ///
+ ///
/// Thrown when the operation returned an invalid status code
///
///
@@ -158,13 +158,14 @@ internal Operations(IotCentralClient client)
string _responseContent = null;
if ((int)_statusCode != 200)
{
- var ex = new ErrorDetailsException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
+ var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
try
{
_responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
- ErrorDetails _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
if (_errorBody != null)
{
+ ex = new CloudException(_errorBody.Message);
ex.Body = _errorBody;
}
}
@@ -174,6 +175,10 @@ internal Operations(IotCentralClient client)
}
ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent);
ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent);
+ if (_httpResponse.Headers.Contains("x-ms-request-id"))
+ {
+ ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
+ }
if (_shouldTrace)
{
ServiceClientTracing.Error(_invocationId, ex);
@@ -230,7 +235,7 @@ internal Operations(IotCentralClient client)
///
/// The cancellation token.
///
- ///
+ ///
/// Thrown when the operation returned an invalid status code
///
///
@@ -326,13 +331,14 @@ internal Operations(IotCentralClient client)
string _responseContent = null;
if ((int)_statusCode != 200)
{
- var ex = new ErrorDetailsException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
+ var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
try
{
_responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
- ErrorDetails _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
if (_errorBody != null)
{
+ ex = new CloudException(_errorBody.Message);
ex.Body = _errorBody;
}
}
@@ -342,6 +348,10 @@ internal Operations(IotCentralClient client)
}
ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent);
ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent);
+ if (_httpResponse.Headers.Contains("x-ms-request-id"))
+ {
+ ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
+ }
if (_shouldTrace)
{
ServiceClientTracing.Error(_invocationId, ex);
diff --git a/sdk/iotcentral/Microsoft.Azure.Management.IotCentral/src/Generated/SdkInfo_IotCentralClient.cs b/sdk/iotcentral/Microsoft.Azure.Management.IotCentral/src/Generated/SdkInfo_IotCentralClient.cs
index 08b3cbe78158..93a05f67db95 100644
--- a/sdk/iotcentral/Microsoft.Azure.Management.IotCentral/src/Generated/SdkInfo_IotCentralClient.cs
+++ b/sdk/iotcentral/Microsoft.Azure.Management.IotCentral/src/Generated/SdkInfo_IotCentralClient.cs
@@ -24,16 +24,5 @@ public static IEnumerable> ApiInfo_IotCentralClien
}.AsEnumerable();
}
}
- // BEGIN: Code Generation Metadata Section
- public static readonly String AutoRestVersion = "latest";
- public static readonly String AutoRestBootStrapperVersion = "autorest@2.0.4407";
- public static readonly String AutoRestCmdExecuted = "cmd.exe /c autorest.cmd https://github.com/Azure/azure-rest-api-specs/blob/master/specification/iotcentral/resource-manager/readme.md --csharp --version=latest --reflect-api-versions --csharp.output-folder=C:\\Users\\pochen\\Github\\azure-sdk-for-net\\sdk\\iotcentral\\Microsoft.Azure.Management.IotCentral\\src\\Generated";
- public static readonly String GithubForkName = "Azure";
- public static readonly String GithubBranchName = "master";
- public static readonly String GithubCommidId = "4676d9187988aa6793ff704aa39c5f495b40f6e0";
- public static readonly String CodeGenerationErrors = "";
- public static readonly String GithubRepoName = "azure-rest-api-specs";
- // END: Code Generation Metadata Section
}
}
-