Skip to content

Commit

Permalink
Getting update management changes result from PR Azure#3095
Browse files Browse the repository at this point in the history
  • Loading branch information
finiteattractor committed May 21, 2018
1 parent 8197f7d commit 4a9b2f3
Show file tree
Hide file tree
Showing 8 changed files with 48 additions and 143 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public partial interface ISoftwareUpdateConfigurationMachineRunsOperations
/// <param name='cancellationToken'>
/// The cancellation token.
/// </param>
/// <exception cref="Microsoft.Rest.Azure.CloudException">
/// <exception cref="ErrorResponseException">
/// Thrown when the operation returned an invalid status code
/// </exception>
/// <exception cref="Microsoft.Rest.SerializationException">
Expand Down Expand Up @@ -86,7 +86,7 @@ public partial interface ISoftwareUpdateConfigurationMachineRunsOperations
/// <param name='cancellationToken'>
/// The cancellation token.
/// </param>
/// <exception cref="Microsoft.Rest.Azure.CloudException">
/// <exception cref="ErrorResponseException">
/// Thrown when the operation returned an invalid status code
/// </exception>
/// <exception cref="Microsoft.Rest.SerializationException">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public partial interface ISoftwareUpdateConfigurationRunsOperations
/// <param name='cancellationToken'>
/// The cancellation token.
/// </param>
/// <exception cref="Microsoft.Rest.Azure.CloudException">
/// <exception cref="ErrorResponseException">
/// Thrown when the operation returned an invalid status code
/// </exception>
/// <exception cref="Microsoft.Rest.SerializationException">
Expand Down Expand Up @@ -86,7 +86,7 @@ public partial interface ISoftwareUpdateConfigurationRunsOperations
/// <param name='cancellationToken'>
/// The cancellation token.
/// </param>
/// <exception cref="Microsoft.Rest.Azure.CloudException">
/// <exception cref="ErrorResponseException">
/// Thrown when the operation returned an invalid status code
/// </exception>
/// <exception cref="Microsoft.Rest.SerializationException">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public partial interface ISoftwareUpdateConfigurationsOperations
/// <param name='cancellationToken'>
/// The cancellation token.
/// </param>
/// <exception cref="Microsoft.Rest.Azure.CloudException">
/// <exception cref="ErrorResponseException">
/// Thrown when the operation returned an invalid status code
/// </exception>
/// <exception cref="Microsoft.Rest.SerializationException">
Expand Down Expand Up @@ -81,7 +81,7 @@ public partial interface ISoftwareUpdateConfigurationsOperations
/// <param name='cancellationToken'>
/// The cancellation token.
/// </param>
/// <exception cref="Microsoft.Rest.Azure.CloudException">
/// <exception cref="ErrorResponseException">
/// Thrown when the operation returned an invalid status code
/// </exception>
/// <exception cref="Microsoft.Rest.SerializationException">
Expand Down Expand Up @@ -113,7 +113,7 @@ public partial interface ISoftwareUpdateConfigurationsOperations
/// <param name='cancellationToken'>
/// The cancellation token.
/// </param>
/// <exception cref="Microsoft.Rest.Azure.CloudException">
/// <exception cref="ErrorResponseException">
/// Thrown when the operation returned an invalid status code
/// </exception>
/// <exception cref="Microsoft.Rest.ValidationException">
Expand Down Expand Up @@ -142,7 +142,7 @@ public partial interface ISoftwareUpdateConfigurationsOperations
/// <param name='cancellationToken'>
/// The cancellation token.
/// </param>
/// <exception cref="Microsoft.Rest.Azure.CloudException">
/// <exception cref="ErrorResponseException">
/// Thrown when the operation returned an invalid status code
/// </exception>
/// <exception cref="Microsoft.Rest.SerializationException">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,29 +38,19 @@ public DscNodeConfigurationCreateOrUpdateParameters()
/// DscNodeConfigurationCreateOrUpdateParameters class.
/// </summary>
/// <param name="source">Gets or sets the source.</param>
/// <param name="name">Name of the node configuration.</param>
/// <param name="configuration">Gets or sets the configuration of the
/// node.</param>
/// <param name="source1">Gets or sets the source.</param>
/// <param name="name1">Gets or sets the type of the parameter.</param>
/// <param name="configuration1">Gets or sets the configuration of the
/// node.</param>
/// <param name="newNodeConfigurationBuildVersionRequired">If a new
/// build version of NodeConfiguration is required.</param>
/// <param name="incrementNodeConfigurationBuild">If a new build
/// version of NodeConfiguration is required.</param>
/// <param name="name">Name of the node configuration.</param>
/// <param name="tags">Gets or sets the tags attached to the
/// resource.</param>
public DscNodeConfigurationCreateOrUpdateParameters(ContentSource source, string name, DscConfigurationAssociationProperty configuration, ContentSource source1, string name1, DscConfigurationAssociationProperty configuration1, bool? newNodeConfigurationBuildVersionRequired = default(bool?), bool? incrementNodeConfigurationBuild = default(bool?), IDictionary<string, string> tags = default(IDictionary<string, string>))
public DscNodeConfigurationCreateOrUpdateParameters(ContentSource source, DscConfigurationAssociationProperty configuration, bool? incrementNodeConfigurationBuild = default(bool?), string name = default(string), IDictionary<string, string> tags = default(IDictionary<string, string>))
{
Source = source;
Name = name;
Configuration = configuration;
NewNodeConfigurationBuildVersionRequired = newNodeConfigurationBuildVersionRequired;
Source1 = source1;
Name1 = name1;
Configuration1 = configuration1;
IncrementNodeConfigurationBuild = incrementNodeConfigurationBuild;
Name = name;
Tags = tags;
CustomInit();
}
Expand All @@ -73,52 +63,27 @@ public DscNodeConfigurationCreateOrUpdateParameters()
/// <summary>
/// Gets or sets the source.
/// </summary>
[JsonProperty(PropertyName = "source")]
[JsonProperty(PropertyName = "properties.source")]
public ContentSource Source { get; set; }

/// <summary>
/// Gets or sets name of the node configuration.
/// </summary>
[JsonProperty(PropertyName = "name")]
public string Name { get; set; }

/// <summary>
/// Gets or sets the configuration of the node.
/// </summary>
[JsonProperty(PropertyName = "configuration")]
[JsonProperty(PropertyName = "properties.configuration")]
public DscConfigurationAssociationProperty Configuration { get; set; }

/// <summary>
/// Gets or sets if a new build version of NodeConfiguration is
/// required.
/// </summary>
[JsonProperty(PropertyName = "newNodeConfigurationBuildVersionRequired")]
public bool? NewNodeConfigurationBuildVersionRequired { get; set; }

/// <summary>
/// Gets or sets the source.
/// </summary>
[JsonProperty(PropertyName = "properties.source")]
public ContentSource Source1 { get; set; }

/// <summary>
/// Gets or sets the type of the parameter.
/// </summary>
[JsonProperty(PropertyName = "properties.name")]
public string Name1 { get; set; }

/// <summary>
/// Gets or sets the configuration of the node.
/// </summary>
[JsonProperty(PropertyName = "properties.configuration")]
public DscConfigurationAssociationProperty Configuration1 { get; set; }
[JsonProperty(PropertyName = "properties.incrementNodeConfigurationBuild")]
public bool? IncrementNodeConfigurationBuild { get; set; }

/// <summary>
/// Gets or sets if a new build version of NodeConfiguration is
/// required.
/// Gets or sets name of the node configuration.
/// </summary>
[JsonProperty(PropertyName = "properties.incrementNodeConfigurationBuild")]
public bool? IncrementNodeConfigurationBuild { get; set; }
[JsonProperty(PropertyName = "name")]
public string Name { get; set; }

/// <summary>
/// Gets or sets the tags attached to the resource.
Expand All @@ -138,34 +103,14 @@ public virtual void Validate()
{
throw new ValidationException(ValidationRules.CannotBeNull, "Source");
}
if (Name == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "Name");
}
if (Configuration == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "Configuration");
}
if (Source1 == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "Source1");
}
if (Name1 == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "Name1");
}
if (Configuration1 == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "Configuration1");
}
if (Source != null)
{
Source.Validate();
}
if (Source1 != null)
{
Source1.Validate();
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ internal SoftwareUpdateConfigurationMachineRunsOperations(AutomationClient clien
/// <param name='cancellationToken'>
/// The cancellation token.
/// </param>
/// <exception cref="CloudException">
/// <exception cref="ErrorResponseException">
/// Thrown when the operation returned an invalid status code
/// </exception>
/// <exception cref="SerializationException">
Expand Down Expand Up @@ -212,14 +212,13 @@ internal SoftwareUpdateConfigurationMachineRunsOperations(AutomationClient clien
string _responseContent = null;
if ((int)_statusCode != 200 && (int)_statusCode != 404)
{
var ex = new CloudException(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);
CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject<CloudError>(_responseContent, Client.DeserializationSettings);
ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject<ErrorResponse>(_responseContent, Client.DeserializationSettings);
if (_errorBody != null)
{
ex = new CloudException(_errorBody.Message);
ex.Body = _errorBody;
}
}
Expand All @@ -229,10 +228,6 @@ internal SoftwareUpdateConfigurationMachineRunsOperations(AutomationClient clien
}
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);
Expand Down Expand Up @@ -307,7 +302,7 @@ internal SoftwareUpdateConfigurationMachineRunsOperations(AutomationClient clien
/// <param name='cancellationToken'>
/// The cancellation token.
/// </param>
/// <exception cref="CloudException">
/// <exception cref="ErrorResponseException">
/// Thrown when the operation returned an invalid status code
/// </exception>
/// <exception cref="SerializationException">
Expand Down Expand Up @@ -460,14 +455,13 @@ internal SoftwareUpdateConfigurationMachineRunsOperations(AutomationClient clien
string _responseContent = null;
if ((int)_statusCode != 200 && (int)_statusCode != 404)
{
var ex = new CloudException(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);
CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject<CloudError>(_responseContent, Client.DeserializationSettings);
ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject<ErrorResponse>(_responseContent, Client.DeserializationSettings);
if (_errorBody != null)
{
ex = new CloudException(_errorBody.Message);
ex.Body = _errorBody;
}
}
Expand All @@ -477,10 +471,6 @@ internal SoftwareUpdateConfigurationMachineRunsOperations(AutomationClient clien
}
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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ internal SoftwareUpdateConfigurationRunsOperations(AutomationClient client)
/// <param name='cancellationToken'>
/// The cancellation token.
/// </param>
/// <exception cref="CloudException">
/// <exception cref="ErrorResponseException">
/// Thrown when the operation returned an invalid status code
/// </exception>
/// <exception cref="SerializationException">
Expand Down Expand Up @@ -212,14 +212,13 @@ internal SoftwareUpdateConfigurationRunsOperations(AutomationClient client)
string _responseContent = null;
if ((int)_statusCode != 200 && (int)_statusCode != 404)
{
var ex = new CloudException(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);
CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject<CloudError>(_responseContent, Client.DeserializationSettings);
ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject<ErrorResponse>(_responseContent, Client.DeserializationSettings);
if (_errorBody != null)
{
ex = new CloudException(_errorBody.Message);
ex.Body = _errorBody;
}
}
Expand All @@ -229,10 +228,6 @@ internal SoftwareUpdateConfigurationRunsOperations(AutomationClient 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);
Expand Down Expand Up @@ -307,7 +302,7 @@ internal SoftwareUpdateConfigurationRunsOperations(AutomationClient client)
/// <param name='cancellationToken'>
/// The cancellation token.
/// </param>
/// <exception cref="CloudException">
/// <exception cref="ErrorResponseException">
/// Thrown when the operation returned an invalid status code
/// </exception>
/// <exception cref="SerializationException">
Expand Down Expand Up @@ -460,14 +455,13 @@ internal SoftwareUpdateConfigurationRunsOperations(AutomationClient client)
string _responseContent = null;
if ((int)_statusCode != 200 && (int)_statusCode != 404)
{
var ex = new CloudException(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);
CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject<CloudError>(_responseContent, Client.DeserializationSettings);
ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject<ErrorResponse>(_responseContent, Client.DeserializationSettings);
if (_errorBody != null)
{
ex = new CloudException(_errorBody.Message);
ex.Body = _errorBody;
}
}
Expand All @@ -477,10 +471,6 @@ internal SoftwareUpdateConfigurationRunsOperations(AutomationClient 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);
Expand Down
Loading

0 comments on commit 4a9b2f3

Please sign in to comment.