diff --git a/sdk/deviceupdate/Microsoft.Azure.Management.DeviceUpdate/src/Generated/AccountsOperations.cs b/sdk/deviceupdate/Microsoft.Azure.Management.DeviceUpdate/src/Generated/AccountsOperations.cs index 50a929c2f867..08645e05bf1a 100644 --- a/sdk/deviceupdate/Microsoft.Azure.Management.DeviceUpdate/src/Generated/AccountsOperations.cs +++ b/sdk/deviceupdate/Microsoft.Azure.Management.DeviceUpdate/src/Generated/AccountsOperations.cs @@ -1186,7 +1186,7 @@ internal AccountsOperations(DeviceUpdateClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 201) { var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -1241,6 +1241,24 @@ internal AccountsOperations(DeviceUpdateClient client) throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); } } + // Deserialize Response + if ((int)_statusCode == 201) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); diff --git a/sdk/deviceupdate/Microsoft.Azure.Management.DeviceUpdate/src/Generated/DeviceUpdateClient.cs b/sdk/deviceupdate/Microsoft.Azure.Management.DeviceUpdate/src/Generated/DeviceUpdateClient.cs index 71663c9ed333..7a4d8498007d 100644 --- a/sdk/deviceupdate/Microsoft.Azure.Management.DeviceUpdate/src/Generated/DeviceUpdateClient.cs +++ b/sdk/deviceupdate/Microsoft.Azure.Management.DeviceUpdate/src/Generated/DeviceUpdateClient.cs @@ -20,6 +20,8 @@ namespace Microsoft.Azure.Management.DeviceUpdate using System.Linq; using System.Net; using System.Net.Http; + using System.Threading; + using System.Threading.Tasks; /// /// Microsoft Device Update resource provider. @@ -368,5 +370,192 @@ private void Initialize() DeserializationSettings.Converters.Add(new TransformationJsonConverter()); DeserializationSettings.Converters.Add(new CloudErrorJsonConverter()); } + /// + /// Checks ADU resource name availability. + /// + /// + /// Check Name Availability Request. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> CheckNameAvailabilityWithHttpMessagesAsync(CheckNameAvailabilityRequest request, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.ApiVersion"); + } + if (SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.SubscriptionId"); + } + if (request == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "request"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("request", request); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "CheckNameAvailability", tracingParameters); + } + // Construct URL + var _baseUrl = BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.DeviceUpdate/checknameavailability").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(SubscriptionId)); + List _queryParameters = new List(); + if (ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (GenerateClientRequestId != null && GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + if(request != null) + { + _requestContent = SafeJsonConvert.SerializeObject(request, SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } + // Set Credentials + if (Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorResponse _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = SafeJsonConvert.DeserializeObject(_responseContent, DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + } } diff --git a/sdk/deviceupdate/Microsoft.Azure.Management.DeviceUpdate/src/Generated/DeviceUpdateClientExtensions.cs b/sdk/deviceupdate/Microsoft.Azure.Management.DeviceUpdate/src/Generated/DeviceUpdateClientExtensions.cs new file mode 100644 index 000000000000..813df45e53e4 --- /dev/null +++ b/sdk/deviceupdate/Microsoft.Azure.Management.DeviceUpdate/src/Generated/DeviceUpdateClientExtensions.cs @@ -0,0 +1,59 @@ +// +// 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.DeviceUpdate +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for DeviceUpdateClient. + /// + public static partial class DeviceUpdateClientExtensions + { + /// + /// Checks ADU resource name availability. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Check Name Availability Request. + /// + public static CheckNameAvailabilityResponse CheckNameAvailability(this IDeviceUpdateClient operations, CheckNameAvailabilityRequest request) + { + return operations.CheckNameAvailabilityAsync(request).GetAwaiter().GetResult(); + } + + /// + /// Checks ADU resource name availability. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Check Name Availability Request. + /// + /// + /// The cancellation token. + /// + public static async Task CheckNameAvailabilityAsync(this IDeviceUpdateClient operations, CheckNameAvailabilityRequest request, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.CheckNameAvailabilityWithHttpMessagesAsync(request, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +} diff --git a/sdk/deviceupdate/Microsoft.Azure.Management.DeviceUpdate/src/Generated/IDeviceUpdateClient.cs b/sdk/deviceupdate/Microsoft.Azure.Management.DeviceUpdate/src/Generated/IDeviceUpdateClient.cs index 7b34b3d5d5c8..8857fa034bde 100644 --- a/sdk/deviceupdate/Microsoft.Azure.Management.DeviceUpdate/src/Generated/IDeviceUpdateClient.cs +++ b/sdk/deviceupdate/Microsoft.Azure.Management.DeviceUpdate/src/Generated/IDeviceUpdateClient.cs @@ -14,6 +14,10 @@ namespace Microsoft.Azure.Management.DeviceUpdate using Microsoft.Rest.Azure; using Models; using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; /// /// Microsoft Device Update resource provider. @@ -84,5 +88,19 @@ public partial interface IDeviceUpdateClient : System.IDisposable /// IOperations Operations { get; } + /// + /// Checks ADU resource name availability. + /// + /// + /// Check Name Availability Request. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + Task> CheckNameAvailabilityWithHttpMessagesAsync(CheckNameAvailabilityRequest request, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } } diff --git a/sdk/deviceupdate/Microsoft.Azure.Management.DeviceUpdate/src/Generated/IInstancesOperations.cs b/sdk/deviceupdate/Microsoft.Azure.Management.DeviceUpdate/src/Generated/IInstancesOperations.cs index 4e3df48e9120..2df67cd09723 100644 --- a/sdk/deviceupdate/Microsoft.Azure.Management.DeviceUpdate/src/Generated/IInstancesOperations.cs +++ b/sdk/deviceupdate/Microsoft.Azure.Management.DeviceUpdate/src/Generated/IInstancesOperations.cs @@ -23,28 +23,6 @@ namespace Microsoft.Azure.Management.DeviceUpdate /// public partial interface IInstancesOperations { - /// - /// Returns instances for the given account name. - /// - /// - /// Account 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>> ListBySubscriptionWithHttpMessagesAsync(string accountName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Returns instances for the given account name. /// @@ -263,28 +241,6 @@ public partial interface IInstancesOperations /// /// Thrown when a required parameter is null /// - Task>> ListBySubscriptionNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Returns instances for the given account name. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when unable to deserialize the response - /// - /// - /// Thrown when a required parameter is null - /// Task>> ListByAccountNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); } } diff --git a/sdk/deviceupdate/Microsoft.Azure.Management.DeviceUpdate/src/Generated/InstancesOperations.cs b/sdk/deviceupdate/Microsoft.Azure.Management.DeviceUpdate/src/Generated/InstancesOperations.cs index 606bdcebbadd..887d2dcc3172 100644 --- a/sdk/deviceupdate/Microsoft.Azure.Management.DeviceUpdate/src/Generated/InstancesOperations.cs +++ b/sdk/deviceupdate/Microsoft.Azure.Management.DeviceUpdate/src/Generated/InstancesOperations.cs @@ -50,188 +50,6 @@ internal InstancesOperations(DeviceUpdateClient client) /// public DeviceUpdateClient Client { get; private set; } - /// - /// Returns instances for the given account name. - /// - /// - /// Account name. - /// - /// - /// Headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when unable to deserialize the response - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// A response object containing the response body and response headers. - /// - public async Task>> ListBySubscriptionWithHttpMessagesAsync(string accountName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - if (Client.ApiVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - if (Client.SubscriptionId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (accountName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "accountName"); - } - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("accountName", accountName); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListBySubscription", tracingParameters); - } - // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.DeviceUpdate/accounts/{accountName}/instances").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); - List _queryParameters = new List(); - if (Client.ApiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); - } - if (_queryParameters.Count > 0) - { - _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); - } - // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200) - { - var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - if (_errorBody != null) - { - ex.Body = _errorBody; - } - } - catch (JsonException) - { - // Ignore the exception - } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_shouldTrace) - { - ServiceClientTracing.Error(_invocationId, ex); - } - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw ex; - } - // Create Result - var _result = new AzureOperationResponse>(); - _result.Request = _httpRequest; - _result.Response = _httpResponse; - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - /// /// Returns instances for the given account name. /// @@ -1285,174 +1103,6 @@ internal InstancesOperations(DeviceUpdateClient client) return _result; } - /// - /// Returns instances for the given account name. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// Headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when unable to deserialize the response - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// A response object containing the response body and response headers. - /// - public async Task>> ListBySubscriptionNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - if (nextPageLink == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); - } - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("nextPageLink", nextPageLink); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListBySubscriptionNext", tracingParameters); - } - // Construct URL - string _url = "{nextLink}"; - _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); - if (_queryParameters.Count > 0) - { - _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); - } - // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200) - { - var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - if (_errorBody != null) - { - ex.Body = _errorBody; - } - } - catch (JsonException) - { - // Ignore the exception - } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_shouldTrace) - { - ServiceClientTracing.Error(_invocationId, ex); - } - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw ex; - } - // Create Result - var _result = new AzureOperationResponse>(); - _result.Request = _httpRequest; - _result.Response = _httpResponse; - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - /// /// Returns instances for the given account name. /// diff --git a/sdk/deviceupdate/Microsoft.Azure.Management.DeviceUpdate/src/Generated/InstancesOperationsExtensions.cs b/sdk/deviceupdate/Microsoft.Azure.Management.DeviceUpdate/src/Generated/InstancesOperationsExtensions.cs index bfeb769bf28f..01371eccbee2 100644 --- a/sdk/deviceupdate/Microsoft.Azure.Management.DeviceUpdate/src/Generated/InstancesOperationsExtensions.cs +++ b/sdk/deviceupdate/Microsoft.Azure.Management.DeviceUpdate/src/Generated/InstancesOperationsExtensions.cs @@ -23,40 +23,6 @@ namespace Microsoft.Azure.Management.DeviceUpdate /// public static partial class InstancesOperationsExtensions { - /// - /// Returns instances for the given account name. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Account name. - /// - public static IPage ListBySubscription(this IInstancesOperations operations, string accountName) - { - return operations.ListBySubscriptionAsync(accountName).GetAwaiter().GetResult(); - } - - /// - /// Returns instances for the given account name. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Account name. - /// - /// - /// The cancellation token. - /// - public static async Task> ListBySubscriptionAsync(this IInstancesOperations operations, string accountName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListBySubscriptionWithHttpMessagesAsync(accountName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - /// /// Returns instances for the given account name. /// @@ -387,40 +353,6 @@ public static void BeginDelete(this IInstancesOperations operations, string reso (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, accountName, instanceName, null, cancellationToken).ConfigureAwait(false)).Dispose(); } - /// - /// Returns instances for the given account name. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListBySubscriptionNext(this IInstancesOperations operations, string nextPageLink) - { - return operations.ListBySubscriptionNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// Returns instances for the given account name. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListBySubscriptionNextAsync(this IInstancesOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListBySubscriptionNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - /// /// Returns instances for the given account name. /// diff --git a/sdk/deviceupdate/Microsoft.Azure.Management.DeviceUpdate/src/Generated/Models/Account.cs b/sdk/deviceupdate/Microsoft.Azure.Management.DeviceUpdate/src/Generated/Models/Account.cs index 775570668718..152416e87208 100644 --- a/sdk/deviceupdate/Microsoft.Azure.Management.DeviceUpdate/src/Generated/Models/Account.cs +++ b/sdk/deviceupdate/Microsoft.Azure.Management.DeviceUpdate/src/Generated/Models/Account.cs @@ -47,11 +47,15 @@ public Account() /// include: 'Succeeded', 'Deleted', 'Failed', 'Canceled', 'Accepted', /// 'Creating' /// API host name. - public Account(string location, string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), string provisioningState = default(string), string hostName = default(string)) + /// The type of identity used for the + /// resource. + public Account(string location, string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), SystemData systemData = default(SystemData), string provisioningState = default(string), string hostName = default(string), Identity identity = default(Identity)) : base(location, id, name, type, tags) { + SystemData = systemData; ProvisioningState = provisioningState; HostName = hostName; + Identity = identity; CustomInit(); } @@ -60,6 +64,11 @@ public Account() /// partial void CustomInit(); + /// + /// + [JsonProperty(PropertyName = "systemData")] + public SystemData SystemData { get; private set; } + /// /// Gets provisioning state. Possible values include: 'Succeeded', /// 'Deleted', 'Failed', 'Canceled', 'Accepted', 'Creating' @@ -73,5 +82,11 @@ public Account() [JsonProperty(PropertyName = "properties.hostName")] public string HostName { get; private set; } + /// + /// Gets or sets the type of identity used for the resource. + /// + [JsonProperty(PropertyName = "identity")] + public Identity Identity { get; set; } + } } diff --git a/sdk/deviceupdate/Microsoft.Azure.Management.DeviceUpdate/src/Generated/Models/AccountUpdate.cs b/sdk/deviceupdate/Microsoft.Azure.Management.DeviceUpdate/src/Generated/Models/AccountUpdate.cs index d859ea3e037d..4a40447b7cd5 100644 --- a/sdk/deviceupdate/Microsoft.Azure.Management.DeviceUpdate/src/Generated/Models/AccountUpdate.cs +++ b/sdk/deviceupdate/Microsoft.Azure.Management.DeviceUpdate/src/Generated/Models/AccountUpdate.cs @@ -33,11 +33,14 @@ public AccountUpdate() /// /// List of key value pairs that describe the /// resource. This will overwrite the existing tags. + /// The type of identity used for the + /// resource. /// The geo-location where the resource /// lives - public AccountUpdate(IDictionary tags = default(IDictionary), string location = default(string)) + public AccountUpdate(IDictionary tags = default(IDictionary), Identity identity = default(Identity), string location = default(string)) : base(tags) { + Identity = identity; Location = location; CustomInit(); } @@ -47,6 +50,12 @@ public AccountUpdate() /// partial void CustomInit(); + /// + /// Gets or sets the type of identity used for the resource. + /// + [JsonProperty(PropertyName = "identity")] + public Identity Identity { get; set; } + /// /// Gets or sets the geo-location where the resource lives /// diff --git a/sdk/deviceupdate/Microsoft.Azure.Management.DeviceUpdate/src/Generated/Models/CheckNameAvailabilityReason.cs b/sdk/deviceupdate/Microsoft.Azure.Management.DeviceUpdate/src/Generated/Models/CheckNameAvailabilityReason.cs new file mode 100644 index 000000000000..3efcc2436f2d --- /dev/null +++ b/sdk/deviceupdate/Microsoft.Azure.Management.DeviceUpdate/src/Generated/Models/CheckNameAvailabilityReason.cs @@ -0,0 +1,22 @@ +// +// 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.DeviceUpdate.Models +{ + + /// + /// Defines values for CheckNameAvailabilityReason. + /// + public static class CheckNameAvailabilityReason + { + public const string Invalid = "Invalid"; + public const string AlreadyExists = "AlreadyExists"; + } +} diff --git a/sdk/deviceupdate/Microsoft.Azure.Management.DeviceUpdate/src/Generated/Models/CheckNameAvailabilityRequest.cs b/sdk/deviceupdate/Microsoft.Azure.Management.DeviceUpdate/src/Generated/Models/CheckNameAvailabilityRequest.cs new file mode 100644 index 000000000000..2967d694c99e --- /dev/null +++ b/sdk/deviceupdate/Microsoft.Azure.Management.DeviceUpdate/src/Generated/Models/CheckNameAvailabilityRequest.cs @@ -0,0 +1,63 @@ +// +// 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.DeviceUpdate.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// The check availability request body. + /// + public partial class CheckNameAvailabilityRequest + { + /// + /// Initializes a new instance of the CheckNameAvailabilityRequest + /// class. + /// + public CheckNameAvailabilityRequest() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the CheckNameAvailabilityRequest + /// class. + /// + /// The name of the resource for which availability + /// needs to be checked. + /// The resource type. + public CheckNameAvailabilityRequest(string name = default(string), string type = default(string)) + { + Name = name; + Type = type; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the name of the resource for which availability needs + /// to be checked. + /// + [JsonProperty(PropertyName = "name")] + public string Name { get; set; } + + /// + /// Gets or sets the resource type. + /// + [JsonProperty(PropertyName = "type")] + public string Type { get; set; } + + } +} diff --git a/sdk/deviceupdate/Microsoft.Azure.Management.DeviceUpdate/src/Generated/Models/CheckNameAvailabilityResponse.cs b/sdk/deviceupdate/Microsoft.Azure.Management.DeviceUpdate/src/Generated/Models/CheckNameAvailabilityResponse.cs new file mode 100644 index 000000000000..f12b9ae6bfef --- /dev/null +++ b/sdk/deviceupdate/Microsoft.Azure.Management.DeviceUpdate/src/Generated/Models/CheckNameAvailabilityResponse.cs @@ -0,0 +1,74 @@ +// +// 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.DeviceUpdate.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// The check availability result. + /// + public partial class CheckNameAvailabilityResponse + { + /// + /// Initializes a new instance of the CheckNameAvailabilityResponse + /// class. + /// + public CheckNameAvailabilityResponse() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the CheckNameAvailabilityResponse + /// class. + /// + /// Indicates if the resource name is + /// available. + /// The reason why the given name is not + /// available. Possible values include: 'Invalid', + /// 'AlreadyExists' + /// Detailed reason why the given name is + /// available. + public CheckNameAvailabilityResponse(bool? nameAvailable = default(bool?), string reason = default(string), string message = default(string)) + { + NameAvailable = nameAvailable; + Reason = reason; + Message = message; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets indicates if the resource name is available. + /// + [JsonProperty(PropertyName = "nameAvailable")] + public bool? NameAvailable { get; set; } + + /// + /// Gets or sets the reason why the given name is not available. + /// Possible values include: 'Invalid', 'AlreadyExists' + /// + [JsonProperty(PropertyName = "reason")] + public string Reason { get; set; } + + /// + /// Gets or sets detailed reason why the given name is available. + /// + [JsonProperty(PropertyName = "message")] + public string Message { get; set; } + + } +} diff --git a/sdk/deviceupdate/Microsoft.Azure.Management.DeviceUpdate/src/Generated/Models/CreatedByType.cs b/sdk/deviceupdate/Microsoft.Azure.Management.DeviceUpdate/src/Generated/Models/CreatedByType.cs new file mode 100644 index 000000000000..efe9aa839fa9 --- /dev/null +++ b/sdk/deviceupdate/Microsoft.Azure.Management.DeviceUpdate/src/Generated/Models/CreatedByType.cs @@ -0,0 +1,24 @@ +// +// 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.DeviceUpdate.Models +{ + + /// + /// Defines values for CreatedByType. + /// + public static class CreatedByType + { + public const string User = "User"; + public const string Application = "Application"; + public const string ManagedIdentity = "ManagedIdentity"; + public const string Key = "Key"; + } +} diff --git a/sdk/deviceupdate/Microsoft.Azure.Management.DeviceUpdate/src/Generated/Models/ErrorAdditionalInfo.cs b/sdk/deviceupdate/Microsoft.Azure.Management.DeviceUpdate/src/Generated/Models/ErrorAdditionalInfo.cs new file mode 100644 index 000000000000..69522f376a91 --- /dev/null +++ b/sdk/deviceupdate/Microsoft.Azure.Management.DeviceUpdate/src/Generated/Models/ErrorAdditionalInfo.cs @@ -0,0 +1,59 @@ +// +// 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.DeviceUpdate.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// The resource management error additional info. + /// + public partial class ErrorAdditionalInfo + { + /// + /// Initializes a new instance of the ErrorAdditionalInfo class. + /// + public ErrorAdditionalInfo() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ErrorAdditionalInfo class. + /// + /// The additional info type. + /// The additional info. + public ErrorAdditionalInfo(string type = default(string), object info = default(object)) + { + Type = type; + Info = info; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets the additional info type. + /// + [JsonProperty(PropertyName = "type")] + public string Type { get; private set; } + + /// + /// Gets the additional info. + /// + [JsonProperty(PropertyName = "info")] + public object Info { get; private set; } + + } +} diff --git a/sdk/deviceupdate/Microsoft.Azure.Management.DeviceUpdate/src/Generated/Models/ErrorDefinition.cs b/sdk/deviceupdate/Microsoft.Azure.Management.DeviceUpdate/src/Generated/Models/ErrorDefinition.cs deleted file mode 100644 index c4d3fb9415ab..000000000000 --- a/sdk/deviceupdate/Microsoft.Azure.Management.DeviceUpdate/src/Generated/Models/ErrorDefinition.cs +++ /dev/null @@ -1,69 +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.DeviceUpdate.Models -{ - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - - /// - /// Error definition. - /// - public partial class ErrorDefinition - { - /// - /// Initializes a new instance of the ErrorDefinition class. - /// - public ErrorDefinition() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the ErrorDefinition class. - /// - /// Error status code. - /// Error message. - /// Error details. - public ErrorDefinition(string code = default(string), string message = default(string), IList details = default(IList)) - { - Code = code; - Message = message; - Details = details; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets error status code. - /// - [JsonProperty(PropertyName = "code")] - public string Code { get; private set; } - - /// - /// Gets error message. - /// - [JsonProperty(PropertyName = "message")] - public string Message { get; private set; } - - /// - /// Gets or sets error details. - /// - [JsonProperty(PropertyName = "details")] - public IList Details { get; set; } - - } -} diff --git a/sdk/deviceupdate/Microsoft.Azure.Management.DeviceUpdate/src/Generated/Models/ErrorDetail.cs b/sdk/deviceupdate/Microsoft.Azure.Management.DeviceUpdate/src/Generated/Models/ErrorDetail.cs new file mode 100644 index 000000000000..5aada779027d --- /dev/null +++ b/sdk/deviceupdate/Microsoft.Azure.Management.DeviceUpdate/src/Generated/Models/ErrorDetail.cs @@ -0,0 +1,85 @@ +// +// 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.DeviceUpdate.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// The error detail. + /// + public partial class ErrorDetail + { + /// + /// Initializes a new instance of the ErrorDetail class. + /// + public ErrorDetail() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ErrorDetail class. + /// + /// The error code. + /// The error message. + /// The error target. + /// The error details. + /// The error additional info. + public ErrorDetail(string code = default(string), string message = default(string), string target = default(string), IList details = default(IList), IList additionalInfo = default(IList)) + { + Code = code; + Message = message; + Target = target; + Details = details; + AdditionalInfo = additionalInfo; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets the error code. + /// + [JsonProperty(PropertyName = "code")] + public string Code { get; private set; } + + /// + /// Gets the error message. + /// + [JsonProperty(PropertyName = "message")] + public string Message { get; private set; } + + /// + /// Gets the error target. + /// + [JsonProperty(PropertyName = "target")] + public string Target { get; private set; } + + /// + /// Gets the error details. + /// + [JsonProperty(PropertyName = "details")] + public IList Details { get; private set; } + + /// + /// Gets the error additional info. + /// + [JsonProperty(PropertyName = "additionalInfo")] + public IList AdditionalInfo { get; private set; } + + } +} diff --git a/sdk/deviceupdate/Microsoft.Azure.Management.DeviceUpdate/src/Generated/Models/ErrorResponse.cs b/sdk/deviceupdate/Microsoft.Azure.Management.DeviceUpdate/src/Generated/Models/ErrorResponse.cs index 0523c368121a..3fffc19cf5a2 100644 --- a/sdk/deviceupdate/Microsoft.Azure.Management.DeviceUpdate/src/Generated/Models/ErrorResponse.cs +++ b/sdk/deviceupdate/Microsoft.Azure.Management.DeviceUpdate/src/Generated/Models/ErrorResponse.cs @@ -14,9 +14,13 @@ namespace Microsoft.Azure.Management.DeviceUpdate.Models using System.Linq; /// - /// Error response indicates that the service is not able to process the - /// incoming request. + /// Error response /// + /// + /// Common error response for all Azure Resource Manager APIs to return + /// error details for failed operations. (This also follows the OData error + /// response format.). + /// public partial class ErrorResponse { /// @@ -30,11 +34,9 @@ public ErrorResponse() /// /// Initializes a new instance of the ErrorResponse class. /// - /// Error status code. - /// Error details. - public ErrorResponse(string code = default(string), ErrorDefinition error = default(ErrorDefinition)) + /// The error object. + public ErrorResponse(ErrorDetail error = default(ErrorDetail)) { - Code = code; Error = error; CustomInit(); } @@ -45,16 +47,10 @@ public ErrorResponse() partial void CustomInit(); /// - /// Gets error status code. - /// - [JsonProperty(PropertyName = "code")] - public string Code { get; private set; } - - /// - /// Gets error details. + /// Gets or sets the error object. /// [JsonProperty(PropertyName = "error")] - public ErrorDefinition Error { get; private set; } + public ErrorDetail Error { get; set; } } } diff --git a/sdk/deviceupdate/Microsoft.Azure.Management.DeviceUpdate/src/Generated/Models/Identity.cs b/sdk/deviceupdate/Microsoft.Azure.Management.DeviceUpdate/src/Generated/Models/Identity.cs new file mode 100644 index 000000000000..488fd234ef57 --- /dev/null +++ b/sdk/deviceupdate/Microsoft.Azure.Management.DeviceUpdate/src/Generated/Models/Identity.cs @@ -0,0 +1,70 @@ +// +// 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.DeviceUpdate.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Identity for the resource. + /// + public partial class Identity + { + /// + /// Initializes a new instance of the Identity class. + /// + public Identity() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the Identity class. + /// + /// The principal ID of resource + /// identity. + /// The tenant ID of resource. + /// The identity type. Possible values include: + /// 'SystemAssigned', 'None' + public Identity(string principalId = default(string), string tenantId = default(string), ResourceIdentityType? type = default(ResourceIdentityType?)) + { + PrincipalId = principalId; + TenantId = tenantId; + Type = type; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets the principal ID of resource identity. + /// + [JsonProperty(PropertyName = "principalId")] + public string PrincipalId { get; private set; } + + /// + /// Gets the tenant ID of resource. + /// + [JsonProperty(PropertyName = "tenantId")] + public string TenantId { get; private set; } + + /// + /// Gets or sets the identity type. Possible values include: + /// 'SystemAssigned', 'None' + /// + [JsonProperty(PropertyName = "type")] + public ResourceIdentityType? Type { get; set; } + + } +} diff --git a/sdk/deviceupdate/Microsoft.Azure.Management.DeviceUpdate/src/Generated/Models/Instance.cs b/sdk/deviceupdate/Microsoft.Azure.Management.DeviceUpdate/src/Generated/Models/Instance.cs index 2388f859e207..6fa2c75a513c 100644 --- a/sdk/deviceupdate/Microsoft.Azure.Management.DeviceUpdate/src/Generated/Models/Instance.cs +++ b/sdk/deviceupdate/Microsoft.Azure.Management.DeviceUpdate/src/Generated/Models/Instance.cs @@ -50,9 +50,10 @@ public Instance() /// Instance belongs to. /// List of IoT Hubs associated with the /// account. - public Instance(string location, string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), string provisioningState = default(string), string accountName = default(string), IList iotHubs = default(IList)) + public Instance(string location, string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), SystemData systemData = default(SystemData), string provisioningState = default(string), string accountName = default(string), IList iotHubs = default(IList)) : base(location, id, name, type, tags) { + SystemData = systemData; ProvisioningState = provisioningState; AccountName = accountName; IotHubs = iotHubs; @@ -64,6 +65,11 @@ public Instance() /// partial void CustomInit(); + /// + /// + [JsonProperty(PropertyName = "systemData")] + public SystemData SystemData { get; private set; } + /// /// Gets provisioning state. Possible values include: 'Succeeded', /// 'Deleted', 'Failed', 'Canceled', 'Accepted', 'Creating' diff --git a/sdk/deviceupdate/Microsoft.Azure.Management.DeviceUpdate/src/Generated/Models/ResourceIdentityType.cs b/sdk/deviceupdate/Microsoft.Azure.Management.DeviceUpdate/src/Generated/Models/ResourceIdentityType.cs new file mode 100644 index 000000000000..f3b6d70f3eb9 --- /dev/null +++ b/sdk/deviceupdate/Microsoft.Azure.Management.DeviceUpdate/src/Generated/Models/ResourceIdentityType.cs @@ -0,0 +1,60 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.DeviceUpdate.Models +{ + using Newtonsoft.Json; + using Newtonsoft.Json.Converters; + using System.Runtime; + using System.Runtime.Serialization; + + /// + /// Defines values for ResourceIdentityType. + /// + [JsonConverter(typeof(StringEnumConverter))] + public enum ResourceIdentityType + { + [EnumMember(Value = "SystemAssigned")] + SystemAssigned, + [EnumMember(Value = "None")] + None + } + internal static class ResourceIdentityTypeEnumExtension + { + internal static string ToSerializedValue(this ResourceIdentityType? value) + { + return value == null ? null : ((ResourceIdentityType)value).ToSerializedValue(); + } + + internal static string ToSerializedValue(this ResourceIdentityType value) + { + switch( value ) + { + case ResourceIdentityType.SystemAssigned: + return "SystemAssigned"; + case ResourceIdentityType.None: + return "None"; + } + return null; + } + + internal static ResourceIdentityType? ParseResourceIdentityType(this string value) + { + switch( value ) + { + case "SystemAssigned": + return ResourceIdentityType.SystemAssigned; + case "None": + return ResourceIdentityType.None; + } + return null; + } + } +} diff --git a/sdk/deviceupdate/Microsoft.Azure.Management.DeviceUpdate/src/Generated/Models/SystemData.cs b/sdk/deviceupdate/Microsoft.Azure.Management.DeviceUpdate/src/Generated/Models/SystemData.cs new file mode 100644 index 000000000000..07ec58e13818 --- /dev/null +++ b/sdk/deviceupdate/Microsoft.Azure.Management.DeviceUpdate/src/Generated/Models/SystemData.cs @@ -0,0 +1,103 @@ +// +// 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.DeviceUpdate.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Metadata pertaining to creation and last modification of the resource. + /// + public partial class SystemData + { + /// + /// Initializes a new instance of the SystemData class. + /// + public SystemData() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the SystemData class. + /// + /// The identity that created the + /// resource. + /// The type of identity that created the + /// resource. Possible values include: 'User', 'Application', + /// 'ManagedIdentity', 'Key' + /// The timestamp of resource creation + /// (UTC). + /// The identity that last modified the + /// resource. + /// The type of identity that last + /// modified the resource. Possible values include: 'User', + /// 'Application', 'ManagedIdentity', 'Key' + /// The timestamp of resource last + /// modification (UTC) + public SystemData(string createdBy = default(string), string createdByType = default(string), System.DateTime? createdAt = default(System.DateTime?), string lastModifiedBy = default(string), string lastModifiedByType = default(string), System.DateTime? lastModifiedAt = default(System.DateTime?)) + { + CreatedBy = createdBy; + CreatedByType = createdByType; + CreatedAt = createdAt; + LastModifiedBy = lastModifiedBy; + LastModifiedByType = lastModifiedByType; + LastModifiedAt = lastModifiedAt; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the identity that created the resource. + /// + [JsonProperty(PropertyName = "createdBy")] + public string CreatedBy { get; set; } + + /// + /// Gets or sets the type of identity that created the resource. + /// Possible values include: 'User', 'Application', 'ManagedIdentity', + /// 'Key' + /// + [JsonProperty(PropertyName = "createdByType")] + public string CreatedByType { get; set; } + + /// + /// Gets or sets the timestamp of resource creation (UTC). + /// + [JsonProperty(PropertyName = "createdAt")] + public System.DateTime? CreatedAt { get; set; } + + /// + /// Gets or sets the identity that last modified the resource. + /// + [JsonProperty(PropertyName = "lastModifiedBy")] + public string LastModifiedBy { get; set; } + + /// + /// Gets or sets the type of identity that last modified the resource. + /// Possible values include: 'User', 'Application', 'ManagedIdentity', + /// 'Key' + /// + [JsonProperty(PropertyName = "lastModifiedByType")] + public string LastModifiedByType { get; set; } + + /// + /// Gets or sets the timestamp of resource last modification (UTC) + /// + [JsonProperty(PropertyName = "lastModifiedAt")] + public System.DateTime? LastModifiedAt { get; set; } + + } +} diff --git a/sdk/deviceupdate/Microsoft.Azure.Management.DeviceUpdate/src/Generated/SdkInfo_DeviceUpdate.cs b/sdk/deviceupdate/Microsoft.Azure.Management.DeviceUpdate/src/Generated/SdkInfo_DeviceUpdate.cs index 3857f18d5fad..9a221683038e 100644 --- a/sdk/deviceupdate/Microsoft.Azure.Management.DeviceUpdate/src/Generated/SdkInfo_DeviceUpdate.cs +++ b/sdk/deviceupdate/Microsoft.Azure.Management.DeviceUpdate/src/Generated/SdkInfo_DeviceUpdate.cs @@ -20,21 +20,11 @@ public static IEnumerable> ApiInfo_DeviceUpdate return new Tuple[] { new Tuple("DeviceUpdate", "Accounts", "2020-03-01-preview"), + new Tuple("DeviceUpdate", "CheckNameAvailability", "2020-03-01-preview"), new Tuple("DeviceUpdate", "Instances", "2020-03-01-preview"), new Tuple("DeviceUpdate", "Operations", "2020-03-01-preview"), }.AsEnumerable(); } } - // BEGIN: Code Generation Metadata Section - public static readonly String AutoRestVersion = "v2"; - public static readonly String AutoRestBootStrapperVersion = "autorest@2.0.4413"; - public static readonly String AutoRestCmdExecuted = "cmd.exe /c autorest.cmd https://github.com/Azure/azure-rest-api-specs/blob/master/specification/deviceupdate/resource-manager/readme.md --csharp --version=v2 --reflect-api-versions --csharp-sdks-folder=E:\\GitHub\\azure-sdk-for-net\\sdk"; - public static readonly String GithubForkName = "Azure"; - public static readonly String GithubBranchName = "master"; - public static readonly String GithubCommidId = "4d1ea13dd5ec9e9e73e8ebabfa2d27a83b7e0e0d"; - public static readonly String CodeGenerationErrors = ""; - public static readonly String GithubRepoName = "azure-rest-api-specs"; - // END: Code Generation Metadata Section } } -