diff --git a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/ArmTemplatesOperations.cs b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/ArmTemplatesOperations.cs index ec387a5bacf8..bb30f0f0b756 100644 --- a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/ArmTemplatesOperations.cs +++ b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/ArmTemplatesOperations.cs @@ -281,10 +281,7 @@ internal ArmTemplatesOperations(DevTestLabsClient client) /// The name of the artifact source. /// /// - /// The name of the azure Resource Manager template. - /// - /// - /// Specify the $expand query. Example: 'properties($select=displayName)' + /// The name of the azure resource manager template. /// /// /// Headers that will be added to request. @@ -307,7 +304,7 @@ internal ArmTemplatesOperations(DevTestLabsClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string labName, string artifactSourceName, string name, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string labName, string artifactSourceName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (Client.SubscriptionId == null) { @@ -344,7 +341,6 @@ internal ArmTemplatesOperations(DevTestLabsClient client) tracingParameters.Add("labName", labName); tracingParameters.Add("artifactSourceName", artifactSourceName); tracingParameters.Add("name", name); - tracingParameters.Add("expand", expand); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } @@ -357,10 +353,6 @@ internal ArmTemplatesOperations(DevTestLabsClient client) _url = _url.Replace("{artifactSourceName}", System.Uri.EscapeDataString(artifactSourceName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); List _queryParameters = new List(); - if (expand != null) - { - _queryParameters.Add(string.Format("$expand={0}", System.Uri.EscapeDataString(expand))); - } if (Client.ApiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); diff --git a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/ArmTemplatesOperationsExtensions.cs b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/ArmTemplatesOperationsExtensions.cs index afc94bbbd57a..f9025c69087f 100644 --- a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/ArmTemplatesOperationsExtensions.cs +++ b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/ArmTemplatesOperationsExtensions.cs @@ -90,14 +90,11 @@ public static partial class ArmTemplatesOperationsExtensions /// The name of the artifact source. /// /// - /// The name of the azure Resource Manager template. + /// The name of the azure resource manager template. /// - /// - /// Specify the $expand query. Example: 'properties($select=displayName)' - /// - public static ArmTemplate Get(this IArmTemplatesOperations operations, string resourceGroupName, string labName, string artifactSourceName, string name, string expand = default(string)) + public static ArmTemplate Get(this IArmTemplatesOperations operations, string resourceGroupName, string labName, string artifactSourceName, string name) { - return operations.GetAsync(resourceGroupName, labName, artifactSourceName, name, expand).GetAwaiter().GetResult(); + return operations.GetAsync(resourceGroupName, labName, artifactSourceName, name).GetAwaiter().GetResult(); } /// @@ -116,17 +113,14 @@ public static partial class ArmTemplatesOperationsExtensions /// The name of the artifact source. /// /// - /// The name of the azure Resource Manager template. - /// - /// - /// Specify the $expand query. Example: 'properties($select=displayName)' + /// The name of the azure resource manager template. /// /// /// The cancellation token. /// - public static async Task GetAsync(this IArmTemplatesOperations operations, string resourceGroupName, string labName, string artifactSourceName, string name, string expand = default(string), CancellationToken cancellationToken = default(CancellationToken)) + public static async Task GetAsync(this IArmTemplatesOperations operations, string resourceGroupName, string labName, string artifactSourceName, string name, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, labName, artifactSourceName, name, expand, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, labName, artifactSourceName, name, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } diff --git a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/ArtifactSourcesOperations.cs b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/ArtifactSourcesOperations.cs index 63061ca56f84..302f46012632 100644 --- a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/ArtifactSourcesOperations.cs +++ b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/ArtifactSourcesOperations.cs @@ -271,9 +271,6 @@ internal ArtifactSourcesOperations(DevTestLabsClient client) /// /// The name of the artifact source. /// - /// - /// Specify the $expand query. Example: 'properties($select=displayName)' - /// /// /// Headers that will be added to request. /// @@ -295,7 +292,7 @@ internal ArtifactSourcesOperations(DevTestLabsClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string labName, string name, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string labName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (Client.SubscriptionId == null) { @@ -327,7 +324,6 @@ internal ArtifactSourcesOperations(DevTestLabsClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("labName", labName); tracingParameters.Add("name", name); - tracingParameters.Add("expand", expand); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } @@ -339,10 +335,6 @@ internal ArtifactSourcesOperations(DevTestLabsClient client) _url = _url.Replace("{labName}", System.Uri.EscapeDataString(labName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); List _queryParameters = new List(); - if (expand != null) - { - _queryParameters.Add(string.Format("$expand={0}", System.Uri.EscapeDataString(expand))); - } if (Client.ApiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); @@ -530,6 +522,10 @@ internal ArtifactSourcesOperations(DevTestLabsClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "artifactSource"); } + if (artifactSource != null) + { + artifactSource.Validate(); + } if (Client.ApiVersion == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); @@ -894,7 +890,8 @@ internal ArtifactSourcesOperations(DevTestLabsClient client) } /// - /// Modify properties of artifact sources. + /// Allows modifying tags of artifact sources. All other properties will be + /// ignored. /// /// /// The name of the resource group. @@ -906,7 +903,8 @@ internal ArtifactSourcesOperations(DevTestLabsClient client) /// The name of the artifact source. /// /// - /// Properties of an artifact source. + /// Allows modifying tags of artifact sources. All other properties will be + /// ignored. /// /// /// Headers that will be added to request. diff --git a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/ArtifactSourcesOperationsExtensions.cs b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/ArtifactSourcesOperationsExtensions.cs index fe37b564812f..6bec2f941e77 100644 --- a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/ArtifactSourcesOperationsExtensions.cs +++ b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/ArtifactSourcesOperationsExtensions.cs @@ -83,12 +83,9 @@ public static partial class ArtifactSourcesOperationsExtensions /// /// The name of the artifact source. /// - /// - /// Specify the $expand query. Example: 'properties($select=displayName)' - /// - public static ArtifactSource Get(this IArtifactSourcesOperations operations, string resourceGroupName, string labName, string name, string expand = default(string)) + public static ArtifactSource Get(this IArtifactSourcesOperations operations, string resourceGroupName, string labName, string name) { - return operations.GetAsync(resourceGroupName, labName, name, expand).GetAwaiter().GetResult(); + return operations.GetAsync(resourceGroupName, labName, name).GetAwaiter().GetResult(); } /// @@ -106,15 +103,12 @@ public static partial class ArtifactSourcesOperationsExtensions /// /// The name of the artifact source. /// - /// - /// Specify the $expand query. Example: 'properties($select=displayName)' - /// /// /// The cancellation token. /// - public static async Task GetAsync(this IArtifactSourcesOperations operations, string resourceGroupName, string labName, string name, string expand = default(string), CancellationToken cancellationToken = default(CancellationToken)) + public static async Task GetAsync(this IArtifactSourcesOperations operations, string resourceGroupName, string labName, string name, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, labName, name, expand, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, labName, name, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } @@ -216,7 +210,8 @@ public static void Delete(this IArtifactSourcesOperations operations, string res } /// - /// Modify properties of artifact sources. + /// Allows modifying tags of artifact sources. All other properties will be + /// ignored. /// /// /// The operations group for this extension method. @@ -231,7 +226,8 @@ public static void Delete(this IArtifactSourcesOperations operations, string res /// The name of the artifact source. /// /// - /// Properties of an artifact source. + /// Allows modifying tags of artifact sources. All other properties will be + /// ignored. /// public static ArtifactSource Update(this IArtifactSourcesOperations operations, string resourceGroupName, string labName, string name, ArtifactSourceFragment artifactSource) { @@ -239,7 +235,8 @@ public static ArtifactSource Update(this IArtifactSourcesOperations operations, } /// - /// Modify properties of artifact sources. + /// Allows modifying tags of artifact sources. All other properties will be + /// ignored. /// /// /// The operations group for this extension method. @@ -254,7 +251,8 @@ public static ArtifactSource Update(this IArtifactSourcesOperations operations, /// The name of the artifact source. /// /// - /// Properties of an artifact source. + /// Allows modifying tags of artifact sources. All other properties will be + /// ignored. /// /// /// The cancellation token. diff --git a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/ArtifactsOperations.cs b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/ArtifactsOperations.cs index ab7a2811546d..2e266f625e0e 100644 --- a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/ArtifactsOperations.cs +++ b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/ArtifactsOperations.cs @@ -283,9 +283,6 @@ internal ArtifactsOperations(DevTestLabsClient client) /// /// The name of the artifact. /// - /// - /// Specify the $expand query. Example: 'properties($select=title)' - /// /// /// Headers that will be added to request. /// @@ -307,7 +304,7 @@ internal ArtifactsOperations(DevTestLabsClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string labName, string artifactSourceName, string name, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string labName, string artifactSourceName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (Client.SubscriptionId == null) { @@ -344,7 +341,6 @@ internal ArtifactsOperations(DevTestLabsClient client) tracingParameters.Add("labName", labName); tracingParameters.Add("artifactSourceName", artifactSourceName); tracingParameters.Add("name", name); - tracingParameters.Add("expand", expand); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } @@ -357,10 +353,6 @@ internal ArtifactsOperations(DevTestLabsClient client) _url = _url.Replace("{artifactSourceName}", System.Uri.EscapeDataString(artifactSourceName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); List _queryParameters = new List(); - if (expand != null) - { - _queryParameters.Add(string.Format("$expand={0}", System.Uri.EscapeDataString(expand))); - } if (Client.ApiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); diff --git a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/ArtifactsOperationsExtensions.cs b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/ArtifactsOperationsExtensions.cs index 207fbb2fe011..343958489b80 100644 --- a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/ArtifactsOperationsExtensions.cs +++ b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/ArtifactsOperationsExtensions.cs @@ -92,12 +92,9 @@ public static partial class ArtifactsOperationsExtensions /// /// The name of the artifact. /// - /// - /// Specify the $expand query. Example: 'properties($select=title)' - /// - public static Artifact Get(this IArtifactsOperations operations, string resourceGroupName, string labName, string artifactSourceName, string name, string expand = default(string)) + public static Artifact Get(this IArtifactsOperations operations, string resourceGroupName, string labName, string artifactSourceName, string name) { - return operations.GetAsync(resourceGroupName, labName, artifactSourceName, name, expand).GetAwaiter().GetResult(); + return operations.GetAsync(resourceGroupName, labName, artifactSourceName, name).GetAwaiter().GetResult(); } /// @@ -118,15 +115,12 @@ public static partial class ArtifactsOperationsExtensions /// /// The name of the artifact. /// - /// - /// Specify the $expand query. Example: 'properties($select=title)' - /// /// /// The cancellation token. /// - public static async Task GetAsync(this IArtifactsOperations operations, string resourceGroupName, string labName, string artifactSourceName, string name, string expand = default(string), CancellationToken cancellationToken = default(CancellationToken)) + public static async Task GetAsync(this IArtifactsOperations operations, string resourceGroupName, string labName, string artifactSourceName, string name, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, labName, artifactSourceName, name, expand, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, labName, artifactSourceName, name, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } diff --git a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/BastionHostsOperations.cs b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/BastionHostsOperations.cs new file mode 100644 index 000000000000..e50881c83f21 --- /dev/null +++ b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/BastionHostsOperations.cs @@ -0,0 +1,1393 @@ +// +// 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.DevTestLabs +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Microsoft.Rest.Azure.OData; + using Models; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + using System.Net; + using System.Net.Http; + using System.Threading; + using System.Threading.Tasks; + + /// + /// BastionHostsOperations operations. + /// + internal partial class BastionHostsOperations : IServiceOperations, IBastionHostsOperations + { + /// + /// Initializes a new instance of the BastionHostsOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal BastionHostsOperations(DevTestLabsClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the DevTestLabsClient + /// + public DevTestLabsClient Client { get; private set; } + + /// + /// List bastionhosts in a given virtual network. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the lab. + /// + /// + /// The name of the virtual network. + /// + /// + /// OData parameters to apply to the 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>> ListWithHttpMessagesAsync(string resourceGroupName, string labName, string virtualNetworkName, ODataQuery odataQuery = default(ODataQuery), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (labName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "labName"); + } + if (virtualNetworkName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "virtualNetworkName"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("odataQuery", odataQuery); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("labName", labName); + tracingParameters.Add("virtualNetworkName", virtualNetworkName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/virtualnetworks/{virtualNetworkName}/bastionhosts").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{labName}", System.Uri.EscapeDataString(labName)); + _url = _url.Replace("{virtualNetworkName}", System.Uri.EscapeDataString(virtualNetworkName)); + List _queryParameters = new List(); + if (odataQuery != null) + { + var _odataFilter = odataQuery.ToString(); + if (!string.IsNullOrEmpty(_odataFilter)) + { + _queryParameters.Add(_odataFilter); + } + } + 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); + } + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + 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); + } + _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; + } + + /// + /// Get bastionhost. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the lab. + /// + /// + /// The name of the virtual network. + /// + /// + /// The name of the bastionhost. + /// + /// + /// 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> GetWithHttpMessagesAsync(string resourceGroupName, string labName, string virtualNetworkName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (labName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "labName"); + } + if (virtualNetworkName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "virtualNetworkName"); + } + if (name == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "name"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("labName", labName); + tracingParameters.Add("virtualNetworkName", virtualNetworkName); + tracingParameters.Add("name", name); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/virtualnetworks/{virtualNetworkName}/bastionhosts/{name}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{labName}", System.Uri.EscapeDataString(labName)); + _url = _url.Replace("{virtualNetworkName}", System.Uri.EscapeDataString(virtualNetworkName)); + _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + 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); + } + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + 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); + } + _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; + } + + /// + /// Create or replace an existing bastionHost. This operation can take a while + /// to complete. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the lab. + /// + /// + /// The name of the virtual network. + /// + /// + /// The name of the bastionhost. + /// + /// + /// Profile of a Bastion Host + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string labName, string virtualNetworkName, string name, BastionHost bastionHost, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send Request + AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, labName, virtualNetworkName, name, bastionHost, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Delete bastionhost. This operation can take a while to complete. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the lab. + /// + /// + /// The name of the virtual network. + /// + /// + /// The name of the bastionhost. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string labName, string virtualNetworkName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, labName, virtualNetworkName, name, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Allows modifying tags of bastionhosts. All other properties will be + /// ignored. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the lab. + /// + /// + /// The name of the virtual network. + /// + /// + /// The name of the bastionhost. + /// + /// + /// Allows modifying tags of bastionhosts. All other properties will be + /// ignored. + /// + /// + /// 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> UpdateWithHttpMessagesAsync(string resourceGroupName, string labName, string virtualNetworkName, string name, BastionHostFragment bastionHost, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (labName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "labName"); + } + if (virtualNetworkName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "virtualNetworkName"); + } + if (name == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "name"); + } + if (bastionHost == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "bastionHost"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("labName", labName); + tracingParameters.Add("virtualNetworkName", virtualNetworkName); + tracingParameters.Add("name", name); + tracingParameters.Add("bastionHost", bastionHost); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "Update", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/virtualnetworks/{virtualNetworkName}/bastionhosts/{name}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{labName}", System.Uri.EscapeDataString(labName)); + _url = _url.Replace("{virtualNetworkName}", System.Uri.EscapeDataString(virtualNetworkName)); + _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + 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("PATCH"); + _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; + if(bastionHost != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(bastionHost, Client.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 (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); + } + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + 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); + } + _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; + } + + /// + /// Create or replace an existing bastionHost. This operation can take a while + /// to complete. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the lab. + /// + /// + /// The name of the virtual network. + /// + /// + /// The name of the bastionhost. + /// + /// + /// Profile of a Bastion Host + /// + /// + /// 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> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string labName, string virtualNetworkName, string name, BastionHost bastionHost, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (labName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "labName"); + } + if (virtualNetworkName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "virtualNetworkName"); + } + if (name == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "name"); + } + if (bastionHost == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "bastionHost"); + } + if (bastionHost != null) + { + bastionHost.Validate(); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("labName", labName); + tracingParameters.Add("virtualNetworkName", virtualNetworkName); + tracingParameters.Add("name", name); + tracingParameters.Add("bastionHost", bastionHost); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/virtualnetworks/{virtualNetworkName}/bastionhosts/{name}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{labName}", System.Uri.EscapeDataString(labName)); + _url = _url.Replace("{virtualNetworkName}", System.Uri.EscapeDataString(virtualNetworkName)); + _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + 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("PUT"); + _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; + if(bastionHost != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(bastionHost, Client.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 (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); + } + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 201 && (int)_statusCode != 202) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + 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); + } + _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); + } + } + // 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); + } + return _result; + } + + /// + /// Delete bastionhost. This operation can take a while to complete. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the lab. + /// + /// + /// The name of the virtual network. + /// + /// + /// The name of the bastionhost. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string labName, string virtualNetworkName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (labName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "labName"); + } + if (virtualNetworkName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "virtualNetworkName"); + } + if (name == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "name"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("labName", labName); + tracingParameters.Add("virtualNetworkName", virtualNetworkName); + tracingParameters.Add("name", name); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/virtualnetworks/{virtualNetworkName}/bastionhosts/{name}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{labName}", System.Uri.EscapeDataString(labName)); + _url = _url.Replace("{virtualNetworkName}", System.Uri.EscapeDataString(virtualNetworkName)); + _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + 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("DELETE"); + _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); + } + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 204) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + 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); + } + _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(); + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// List bastionhosts in a given virtual network. + /// + /// + /// 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>> ListNextWithHttpMessagesAsync(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, "ListNext", 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); + } + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + 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); + } + _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; + } + + } +} diff --git a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/BastionHostsOperationsExtensions.cs b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/BastionHostsOperationsExtensions.cs new file mode 100644 index 000000000000..ecc4924a65f0 --- /dev/null +++ b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/BastionHostsOperationsExtensions.cs @@ -0,0 +1,444 @@ +// +// 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.DevTestLabs +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Microsoft.Rest.Azure.OData; + using Models; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for BastionHostsOperations. + /// + public static partial class BastionHostsOperationsExtensions + { + /// + /// List bastionhosts in a given virtual network. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the lab. + /// + /// + /// The name of the virtual network. + /// + /// + /// OData parameters to apply to the operation. + /// + public static IPage List(this IBastionHostsOperations operations, string resourceGroupName, string labName, string virtualNetworkName, ODataQuery odataQuery = default(ODataQuery)) + { + return operations.ListAsync(resourceGroupName, labName, virtualNetworkName, odataQuery).GetAwaiter().GetResult(); + } + + /// + /// List bastionhosts in a given virtual network. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the lab. + /// + /// + /// The name of the virtual network. + /// + /// + /// OData parameters to apply to the operation. + /// + /// + /// The cancellation token. + /// + public static async Task> ListAsync(this IBastionHostsOperations operations, string resourceGroupName, string labName, string virtualNetworkName, ODataQuery odataQuery = default(ODataQuery), CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, labName, virtualNetworkName, odataQuery, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Get bastionhost. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the lab. + /// + /// + /// The name of the virtual network. + /// + /// + /// The name of the bastionhost. + /// + public static BastionHost Get(this IBastionHostsOperations operations, string resourceGroupName, string labName, string virtualNetworkName, string name) + { + return operations.GetAsync(resourceGroupName, labName, virtualNetworkName, name).GetAwaiter().GetResult(); + } + + /// + /// Get bastionhost. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the lab. + /// + /// + /// The name of the virtual network. + /// + /// + /// The name of the bastionhost. + /// + /// + /// The cancellation token. + /// + public static async Task GetAsync(this IBastionHostsOperations operations, string resourceGroupName, string labName, string virtualNetworkName, string name, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, labName, virtualNetworkName, name, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Create or replace an existing bastionHost. This operation can take a while + /// to complete. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the lab. + /// + /// + /// The name of the virtual network. + /// + /// + /// The name of the bastionhost. + /// + /// + /// Profile of a Bastion Host + /// + public static BastionHost CreateOrUpdate(this IBastionHostsOperations operations, string resourceGroupName, string labName, string virtualNetworkName, string name, BastionHost bastionHost) + { + return operations.CreateOrUpdateAsync(resourceGroupName, labName, virtualNetworkName, name, bastionHost).GetAwaiter().GetResult(); + } + + /// + /// Create or replace an existing bastionHost. This operation can take a while + /// to complete. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the lab. + /// + /// + /// The name of the virtual network. + /// + /// + /// The name of the bastionhost. + /// + /// + /// Profile of a Bastion Host + /// + /// + /// The cancellation token. + /// + public static async Task CreateOrUpdateAsync(this IBastionHostsOperations operations, string resourceGroupName, string labName, string virtualNetworkName, string name, BastionHost bastionHost, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, labName, virtualNetworkName, name, bastionHost, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Delete bastionhost. This operation can take a while to complete. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the lab. + /// + /// + /// The name of the virtual network. + /// + /// + /// The name of the bastionhost. + /// + public static void Delete(this IBastionHostsOperations operations, string resourceGroupName, string labName, string virtualNetworkName, string name) + { + operations.DeleteAsync(resourceGroupName, labName, virtualNetworkName, name).GetAwaiter().GetResult(); + } + + /// + /// Delete bastionhost. This operation can take a while to complete. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the lab. + /// + /// + /// The name of the virtual network. + /// + /// + /// The name of the bastionhost. + /// + /// + /// The cancellation token. + /// + public static async Task DeleteAsync(this IBastionHostsOperations operations, string resourceGroupName, string labName, string virtualNetworkName, string name, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, labName, virtualNetworkName, name, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// Allows modifying tags of bastionhosts. All other properties will be + /// ignored. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the lab. + /// + /// + /// The name of the virtual network. + /// + /// + /// The name of the bastionhost. + /// + /// + /// Allows modifying tags of bastionhosts. All other properties will be + /// ignored. + /// + public static BastionHost Update(this IBastionHostsOperations operations, string resourceGroupName, string labName, string virtualNetworkName, string name, BastionHostFragment bastionHost) + { + return operations.UpdateAsync(resourceGroupName, labName, virtualNetworkName, name, bastionHost).GetAwaiter().GetResult(); + } + + /// + /// Allows modifying tags of bastionhosts. All other properties will be + /// ignored. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the lab. + /// + /// + /// The name of the virtual network. + /// + /// + /// The name of the bastionhost. + /// + /// + /// Allows modifying tags of bastionhosts. All other properties will be + /// ignored. + /// + /// + /// The cancellation token. + /// + public static async Task UpdateAsync(this IBastionHostsOperations operations, string resourceGroupName, string labName, string virtualNetworkName, string name, BastionHostFragment bastionHost, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.UpdateWithHttpMessagesAsync(resourceGroupName, labName, virtualNetworkName, name, bastionHost, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Create or replace an existing bastionHost. This operation can take a while + /// to complete. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the lab. + /// + /// + /// The name of the virtual network. + /// + /// + /// The name of the bastionhost. + /// + /// + /// Profile of a Bastion Host + /// + public static BastionHost BeginCreateOrUpdate(this IBastionHostsOperations operations, string resourceGroupName, string labName, string virtualNetworkName, string name, BastionHost bastionHost) + { + return operations.BeginCreateOrUpdateAsync(resourceGroupName, labName, virtualNetworkName, name, bastionHost).GetAwaiter().GetResult(); + } + + /// + /// Create or replace an existing bastionHost. This operation can take a while + /// to complete. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the lab. + /// + /// + /// The name of the virtual network. + /// + /// + /// The name of the bastionhost. + /// + /// + /// Profile of a Bastion Host + /// + /// + /// The cancellation token. + /// + public static async Task BeginCreateOrUpdateAsync(this IBastionHostsOperations operations, string resourceGroupName, string labName, string virtualNetworkName, string name, BastionHost bastionHost, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, labName, virtualNetworkName, name, bastionHost, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Delete bastionhost. This operation can take a while to complete. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the lab. + /// + /// + /// The name of the virtual network. + /// + /// + /// The name of the bastionhost. + /// + public static void BeginDelete(this IBastionHostsOperations operations, string resourceGroupName, string labName, string virtualNetworkName, string name) + { + operations.BeginDeleteAsync(resourceGroupName, labName, virtualNetworkName, name).GetAwaiter().GetResult(); + } + + /// + /// Delete bastionhost. This operation can take a while to complete. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the lab. + /// + /// + /// The name of the virtual network. + /// + /// + /// The name of the bastionhost. + /// + /// + /// The cancellation token. + /// + public static async Task BeginDeleteAsync(this IBastionHostsOperations operations, string resourceGroupName, string labName, string virtualNetworkName, string name, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, labName, virtualNetworkName, name, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// List bastionhosts in a given virtual network. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage ListNext(this IBastionHostsOperations operations, string nextPageLink) + { + return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// List bastionhosts in a given virtual network. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async Task> ListNextAsync(this IBastionHostsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +} diff --git a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/CostsOperations.cs b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/CostsOperations.cs index e4131f6acdc6..b828ac16228b 100644 --- a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/CostsOperations.cs +++ b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/CostsOperations.cs @@ -12,6 +12,7 @@ namespace Microsoft.Azure.Management.DevTestLabs { using Microsoft.Rest; using Microsoft.Rest.Azure; + using Microsoft.Rest.Azure.OData; using Models; using Newtonsoft.Json; using System.Collections; @@ -50,6 +51,214 @@ internal CostsOperations(DevTestLabsClient client) /// public DevTestLabsClient Client { get; private set; } + /// + /// List costs in a given lab. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the lab. + /// + /// + /// OData parameters to apply to the 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>> ListWithHttpMessagesAsync(string resourceGroupName, string labName, ODataQuery odataQuery = default(ODataQuery), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (labName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "labName"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("odataQuery", odataQuery); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("labName", labName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/costs").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{labName}", System.Uri.EscapeDataString(labName)); + List _queryParameters = new List(); + if (odataQuery != null) + { + var _odataFilter = odataQuery.ToString(); + if (!string.IsNullOrEmpty(_odataFilter)) + { + _queryParameters.Add(_odataFilter); + } + } + 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); + } + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + 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); + } + _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; + } + /// /// Get cost. /// @@ -500,5 +709,178 @@ internal CostsOperations(DevTestLabsClient client) return _result; } + /// + /// List costs in a given lab. + /// + /// + /// 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>> ListNextWithHttpMessagesAsync(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, "ListNext", 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); + } + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + 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); + } + _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; + } + } } diff --git a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/CostsOperationsExtensions.cs b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/CostsOperationsExtensions.cs index 499d0b1d761f..2c6b0d339669 100644 --- a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/CostsOperationsExtensions.cs +++ b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/CostsOperationsExtensions.cs @@ -12,6 +12,7 @@ namespace Microsoft.Azure.Management.DevTestLabs { using Microsoft.Rest; using Microsoft.Rest.Azure; + using Microsoft.Rest.Azure.OData; using Models; using System.Threading; using System.Threading.Tasks; @@ -21,6 +22,52 @@ namespace Microsoft.Azure.Management.DevTestLabs /// public static partial class CostsOperationsExtensions { + /// + /// List costs in a given lab. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the lab. + /// + /// + /// OData parameters to apply to the operation. + /// + public static IPage List(this ICostsOperations operations, string resourceGroupName, string labName, ODataQuery odataQuery = default(ODataQuery)) + { + return operations.ListAsync(resourceGroupName, labName, odataQuery).GetAwaiter().GetResult(); + } + + /// + /// List costs in a given lab. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the lab. + /// + /// + /// OData parameters to apply to the operation. + /// + /// + /// The cancellation token. + /// + public static async Task> ListAsync(this ICostsOperations operations, string resourceGroupName, string labName, ODataQuery odataQuery = default(ODataQuery), CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, labName, odataQuery, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// /// Get cost. /// @@ -125,5 +172,39 @@ public static LabCost CreateOrUpdate(this ICostsOperations operations, string re } } + /// + /// List costs in a given lab. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage ListNext(this ICostsOperations operations, string nextPageLink) + { + return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// List costs in a given lab. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async Task> ListNextAsync(this ICostsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + } } diff --git a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/CustomImagesOperations.cs b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/CustomImagesOperations.cs index 225a8c040b9a..4fb850654480 100644 --- a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/CustomImagesOperations.cs +++ b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/CustomImagesOperations.cs @@ -271,9 +271,6 @@ internal CustomImagesOperations(DevTestLabsClient client) /// /// The name of the custom image. /// - /// - /// Specify the $expand query. Example: 'properties($select=vm)' - /// /// /// Headers that will be added to request. /// @@ -295,7 +292,7 @@ internal CustomImagesOperations(DevTestLabsClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string labName, string name, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string labName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (Client.SubscriptionId == null) { @@ -327,7 +324,6 @@ internal CustomImagesOperations(DevTestLabsClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("labName", labName); tracingParameters.Add("name", name); - tracingParameters.Add("expand", expand); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } @@ -339,10 +335,6 @@ internal CustomImagesOperations(DevTestLabsClient client) _url = _url.Replace("{labName}", System.Uri.EscapeDataString(labName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); List _queryParameters = new List(); - if (expand != null) - { - _queryParameters.Add(string.Format("$expand={0}", System.Uri.EscapeDataString(expand))); - } if (Client.ApiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); @@ -527,7 +519,8 @@ internal CustomImagesOperations(DevTestLabsClient client) } /// - /// Modify properties of custom images. + /// Allows modifying tags of custom images. All other properties will be + /// ignored. /// /// /// The name of the resource group. @@ -539,7 +532,8 @@ internal CustomImagesOperations(DevTestLabsClient client) /// The name of the custom image. /// /// - /// A custom image. + /// Allows modifying tags of custom images. All other properties will be + /// ignored. /// /// /// Headers that will be added to request. @@ -902,7 +896,7 @@ internal CustomImagesOperations(DevTestLabsClient client) System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 201) + if ((int)_statusCode != 200 && (int)_statusCode != 201 && (int)_statusCode != 202) { var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try diff --git a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/CustomImagesOperationsExtensions.cs b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/CustomImagesOperationsExtensions.cs index d600fc47b4d0..159ba61be98d 100644 --- a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/CustomImagesOperationsExtensions.cs +++ b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/CustomImagesOperationsExtensions.cs @@ -83,12 +83,9 @@ public static partial class CustomImagesOperationsExtensions /// /// The name of the custom image. /// - /// - /// Specify the $expand query. Example: 'properties($select=vm)' - /// - public static CustomImage Get(this ICustomImagesOperations operations, string resourceGroupName, string labName, string name, string expand = default(string)) + public static CustomImage Get(this ICustomImagesOperations operations, string resourceGroupName, string labName, string name) { - return operations.GetAsync(resourceGroupName, labName, name, expand).GetAwaiter().GetResult(); + return operations.GetAsync(resourceGroupName, labName, name).GetAwaiter().GetResult(); } /// @@ -106,15 +103,12 @@ public static partial class CustomImagesOperationsExtensions /// /// The name of the custom image. /// - /// - /// Specify the $expand query. Example: 'properties($select=vm)' - /// /// /// The cancellation token. /// - public static async Task GetAsync(this ICustomImagesOperations operations, string resourceGroupName, string labName, string name, string expand = default(string), CancellationToken cancellationToken = default(CancellationToken)) + public static async Task GetAsync(this ICustomImagesOperations operations, string resourceGroupName, string labName, string name, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, labName, name, expand, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, labName, name, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } @@ -218,7 +212,8 @@ public static void Delete(this ICustomImagesOperations operations, string resour } /// - /// Modify properties of custom images. + /// Allows modifying tags of custom images. All other properties will be + /// ignored. /// /// /// The operations group for this extension method. @@ -233,7 +228,8 @@ public static void Delete(this ICustomImagesOperations operations, string resour /// The name of the custom image. /// /// - /// A custom image. + /// Allows modifying tags of custom images. All other properties will be + /// ignored. /// public static CustomImage Update(this ICustomImagesOperations operations, string resourceGroupName, string labName, string name, CustomImageFragment customImage) { @@ -241,7 +237,8 @@ public static CustomImage Update(this ICustomImagesOperations operations, string } /// - /// Modify properties of custom images. + /// Allows modifying tags of custom images. All other properties will be + /// ignored. /// /// /// The operations group for this extension method. @@ -256,7 +253,8 @@ public static CustomImage Update(this ICustomImagesOperations operations, string /// The name of the custom image. /// /// - /// A custom image. + /// Allows modifying tags of custom images. All other properties will be + /// ignored. /// /// /// The cancellation token. diff --git a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/DevTestLabsClient.cs b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/DevTestLabsClient.cs index 806b878deb1d..b52b08a6c9fc 100644 --- a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/DevTestLabsClient.cs +++ b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/DevTestLabsClient.cs @@ -56,6 +56,16 @@ public partial class DevTestLabsClient : ServiceClient, IDevT /// public string SubscriptionId { get; set; } + /// + /// The ID of the target subscription. + /// + public string SubscriptionId1 { get; set; } + + /// + /// The API version to use for this operation. + /// + public string ApiVersion1 { get; set; } + /// /// The preferred language for the response. /// @@ -149,11 +159,26 @@ public partial class DevTestLabsClient : ServiceClient, IDevT /// public virtual ISchedulesOperations Schedules { get; private set; } + /// + /// Gets the ILabSecretsOperations. + /// + public virtual ILabSecretsOperations LabSecrets { get; private set; } + /// /// Gets the IServiceRunnersOperations. /// public virtual IServiceRunnersOperations ServiceRunners { get; private set; } + /// + /// Gets the ISharedGalleriesOperations. + /// + public virtual ISharedGalleriesOperations SharedGalleries { get; private set; } + + /// + /// Gets the ISharedImagesOperations. + /// + public virtual ISharedImagesOperations SharedImages { get; private set; } + /// /// Gets the IUsersOperations. /// @@ -199,6 +224,11 @@ public partial class DevTestLabsClient : ServiceClient, IDevT /// public virtual IVirtualNetworksOperations VirtualNetworks { get; private set; } + /// + /// Gets the IBastionHostsOperations. + /// + public virtual IBastionHostsOperations BastionHosts { get; private set; } + /// /// Initializes a new instance of the DevTestLabsClient class. /// @@ -455,7 +485,10 @@ private void Initialize() PolicySets = new PolicySetsOperations(this); Policies = new PoliciesOperations(this); Schedules = new SchedulesOperations(this); + LabSecrets = new LabSecretsOperations(this); ServiceRunners = new ServiceRunnersOperations(this); + SharedGalleries = new SharedGalleriesOperations(this); + SharedImages = new SharedImagesOperations(this); Users = new UsersOperations(this); Disks = new DisksOperations(this); Environments = new EnvironmentsOperations(this); @@ -465,8 +498,9 @@ private void Initialize() VirtualMachines = new VirtualMachinesOperations(this); VirtualMachineSchedules = new VirtualMachineSchedulesOperations(this); VirtualNetworks = new VirtualNetworksOperations(this); + BastionHosts = new BastionHostsOperations(this); BaseUri = new System.Uri("https://management.azure.com"); - ApiVersion = "2018-09-15"; + ApiVersion = "2021-09-01"; AcceptLanguage = "en-US"; LongRunningOperationRetryTimeout = 30; GenerateClientRequestId = true; diff --git a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/DisksOperations.cs b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/DisksOperations.cs index 1f6e18917d74..6838e8e4471a 100644 --- a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/DisksOperations.cs +++ b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/DisksOperations.cs @@ -283,9 +283,6 @@ internal DisksOperations(DevTestLabsClient client) /// /// The name of the disk. /// - /// - /// Specify the $expand query. Example: 'properties($select=diskType)' - /// /// /// Headers that will be added to request. /// @@ -307,7 +304,7 @@ internal DisksOperations(DevTestLabsClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string labName, string userName, string name, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string labName, string userName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (Client.SubscriptionId == null) { @@ -344,7 +341,6 @@ internal DisksOperations(DevTestLabsClient client) tracingParameters.Add("labName", labName); tracingParameters.Add("userName", userName); tracingParameters.Add("name", name); - tracingParameters.Add("expand", expand); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } @@ -357,10 +353,6 @@ internal DisksOperations(DevTestLabsClient client) _url = _url.Replace("{userName}", System.Uri.EscapeDataString(userName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); List _queryParameters = new List(); - if (expand != null) - { - _queryParameters.Add(string.Format("$expand={0}", System.Uri.EscapeDataString(expand))); - } if (Client.ApiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); @@ -551,7 +543,7 @@ internal DisksOperations(DevTestLabsClient client) } /// - /// Modify properties of disks. + /// Allows modifying tags of disks. All other properties will be ignored. /// /// /// The name of the resource group. @@ -566,7 +558,7 @@ internal DisksOperations(DevTestLabsClient client) /// The name of the disk. /// /// - /// A Disk. + /// Allows modifying tags of disks. All other properties will be ignored. /// /// /// Headers that will be added to request. @@ -908,6 +900,10 @@ internal DisksOperations(DevTestLabsClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "disk"); } + if (disk != null) + { + disk.Validate(); + } if (Client.ApiVersion == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); @@ -1004,7 +1000,7 @@ internal DisksOperations(DevTestLabsClient client) System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 201) + if ((int)_statusCode != 200 && (int)_statusCode != 201 && (int)_statusCode != 202) { var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try diff --git a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/DisksOperationsExtensions.cs b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/DisksOperationsExtensions.cs index f2e41ff0a3ca..28e33951d591 100644 --- a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/DisksOperationsExtensions.cs +++ b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/DisksOperationsExtensions.cs @@ -92,12 +92,9 @@ public static partial class DisksOperationsExtensions /// /// The name of the disk. /// - /// - /// Specify the $expand query. Example: 'properties($select=diskType)' - /// - public static Disk Get(this IDisksOperations operations, string resourceGroupName, string labName, string userName, string name, string expand = default(string)) + public static Disk Get(this IDisksOperations operations, string resourceGroupName, string labName, string userName, string name) { - return operations.GetAsync(resourceGroupName, labName, userName, name, expand).GetAwaiter().GetResult(); + return operations.GetAsync(resourceGroupName, labName, userName, name).GetAwaiter().GetResult(); } /// @@ -118,15 +115,12 @@ public static partial class DisksOperationsExtensions /// /// The name of the disk. /// - /// - /// Specify the $expand query. Example: 'properties($select=diskType)' - /// /// /// The cancellation token. /// - public static async Task GetAsync(this IDisksOperations operations, string resourceGroupName, string labName, string userName, string name, string expand = default(string), CancellationToken cancellationToken = default(CancellationToken)) + public static async Task GetAsync(this IDisksOperations operations, string resourceGroupName, string labName, string userName, string name, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, labName, userName, name, expand, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, labName, userName, name, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } @@ -242,7 +236,7 @@ public static void Delete(this IDisksOperations operations, string resourceGroup } /// - /// Modify properties of disks. + /// Allows modifying tags of disks. All other properties will be ignored. /// /// /// The operations group for this extension method. @@ -260,7 +254,7 @@ public static void Delete(this IDisksOperations operations, string resourceGroup /// The name of the disk. /// /// - /// A Disk. + /// Allows modifying tags of disks. All other properties will be ignored. /// public static Disk Update(this IDisksOperations operations, string resourceGroupName, string labName, string userName, string name, DiskFragment disk) { @@ -268,7 +262,7 @@ public static Disk Update(this IDisksOperations operations, string resourceGroup } /// - /// Modify properties of disks. + /// Allows modifying tags of disks. All other properties will be ignored. /// /// /// The operations group for this extension method. @@ -286,7 +280,7 @@ public static Disk Update(this IDisksOperations operations, string resourceGroup /// The name of the disk. /// /// - /// A Disk. + /// Allows modifying tags of disks. All other properties will be ignored. /// /// /// The cancellation token. diff --git a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/EnvironmentsOperations.cs b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/EnvironmentsOperations.cs index 3febf1fb06d9..111c08734cde 100644 --- a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/EnvironmentsOperations.cs +++ b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/EnvironmentsOperations.cs @@ -283,10 +283,6 @@ internal EnvironmentsOperations(DevTestLabsClient client) /// /// The name of the environment. /// - /// - /// Specify the $expand query. Example: - /// 'properties($select=deploymentProperties)' - /// /// /// Headers that will be added to request. /// @@ -308,7 +304,7 @@ internal EnvironmentsOperations(DevTestLabsClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string labName, string userName, string name, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string labName, string userName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (Client.SubscriptionId == null) { @@ -345,7 +341,6 @@ internal EnvironmentsOperations(DevTestLabsClient client) tracingParameters.Add("labName", labName); tracingParameters.Add("userName", userName); tracingParameters.Add("name", name); - tracingParameters.Add("expand", expand); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } @@ -358,10 +353,6 @@ internal EnvironmentsOperations(DevTestLabsClient client) _url = _url.Replace("{userName}", System.Uri.EscapeDataString(userName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); List _queryParameters = new List(); - if (expand != null) - { - _queryParameters.Add(string.Format("$expand={0}", System.Uri.EscapeDataString(expand))); - } if (Client.ApiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); @@ -552,7 +543,8 @@ internal EnvironmentsOperations(DevTestLabsClient client) } /// - /// Modify properties of environments. + /// Allows modifying tags of environments. All other properties will be + /// ignored. /// /// /// The name of the resource group. @@ -567,7 +559,8 @@ internal EnvironmentsOperations(DevTestLabsClient client) /// The name of the environment. /// /// - /// An environment, which is essentially an ARM template deployment. + /// Allows modifying tags of environments. All other properties will be + /// ignored. /// /// /// Headers that will be added to request. @@ -845,6 +838,10 @@ internal EnvironmentsOperations(DevTestLabsClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "dtlEnvironment"); } + if (dtlEnvironment != null) + { + dtlEnvironment.Validate(); + } if (Client.ApiVersion == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); @@ -941,7 +938,7 @@ internal EnvironmentsOperations(DevTestLabsClient client) System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 201) + if ((int)_statusCode != 200 && (int)_statusCode != 201 && (int)_statusCode != 202) { var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try diff --git a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/EnvironmentsOperationsExtensions.cs b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/EnvironmentsOperationsExtensions.cs index 9869ea3e9494..93e4cd92ca8a 100644 --- a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/EnvironmentsOperationsExtensions.cs +++ b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/EnvironmentsOperationsExtensions.cs @@ -92,13 +92,9 @@ public static partial class EnvironmentsOperationsExtensions /// /// The name of the environment. /// - /// - /// Specify the $expand query. Example: - /// 'properties($select=deploymentProperties)' - /// - public static DtlEnvironment Get(this IEnvironmentsOperations operations, string resourceGroupName, string labName, string userName, string name, string expand = default(string)) + public static DtlEnvironment Get(this IEnvironmentsOperations operations, string resourceGroupName, string labName, string userName, string name) { - return operations.GetAsync(resourceGroupName, labName, userName, name, expand).GetAwaiter().GetResult(); + return operations.GetAsync(resourceGroupName, labName, userName, name).GetAwaiter().GetResult(); } /// @@ -119,16 +115,12 @@ public static partial class EnvironmentsOperationsExtensions /// /// The name of the environment. /// - /// - /// Specify the $expand query. Example: - /// 'properties($select=deploymentProperties)' - /// /// /// The cancellation token. /// - public static async Task GetAsync(this IEnvironmentsOperations operations, string resourceGroupName, string labName, string userName, string name, string expand = default(string), CancellationToken cancellationToken = default(CancellationToken)) + public static async Task GetAsync(this IEnvironmentsOperations operations, string resourceGroupName, string labName, string userName, string name, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, labName, userName, name, expand, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, labName, userName, name, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } @@ -244,7 +236,8 @@ public static void Delete(this IEnvironmentsOperations operations, string resour } /// - /// Modify properties of environments. + /// Allows modifying tags of environments. All other properties will be + /// ignored. /// /// /// The operations group for this extension method. @@ -262,7 +255,8 @@ public static void Delete(this IEnvironmentsOperations operations, string resour /// The name of the environment. /// /// - /// An environment, which is essentially an ARM template deployment. + /// Allows modifying tags of environments. All other properties will be + /// ignored. /// public static DtlEnvironment Update(this IEnvironmentsOperations operations, string resourceGroupName, string labName, string userName, string name, DtlEnvironmentFragment dtlEnvironment) { @@ -270,7 +264,8 @@ public static DtlEnvironment Update(this IEnvironmentsOperations operations, str } /// - /// Modify properties of environments. + /// Allows modifying tags of environments. All other properties will be + /// ignored. /// /// /// The operations group for this extension method. @@ -288,7 +283,8 @@ public static DtlEnvironment Update(this IEnvironmentsOperations operations, str /// The name of the environment. /// /// - /// An environment, which is essentially an ARM template deployment. + /// Allows modifying tags of environments. All other properties will be + /// ignored. /// /// /// The cancellation token. diff --git a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/FormulasOperations.cs b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/FormulasOperations.cs index 71ca5c312cf1..0aeb496e82e1 100644 --- a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/FormulasOperations.cs +++ b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/FormulasOperations.cs @@ -271,9 +271,6 @@ internal FormulasOperations(DevTestLabsClient client) /// /// The name of the formula. /// - /// - /// Specify the $expand query. Example: 'properties($select=description)' - /// /// /// Headers that will be added to request. /// @@ -295,7 +292,7 @@ internal FormulasOperations(DevTestLabsClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string labName, string name, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string labName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (Client.SubscriptionId == null) { @@ -327,7 +324,6 @@ internal FormulasOperations(DevTestLabsClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("labName", labName); tracingParameters.Add("name", name); - tracingParameters.Add("expand", expand); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } @@ -339,10 +335,6 @@ internal FormulasOperations(DevTestLabsClient client) _url = _url.Replace("{labName}", System.Uri.EscapeDataString(labName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); List _queryParameters = new List(); - if (expand != null) - { - _queryParameters.Add(string.Format("$expand={0}", System.Uri.EscapeDataString(expand))); - } if (Client.ApiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); @@ -686,7 +678,7 @@ internal FormulasOperations(DevTestLabsClient client) } /// - /// Modify properties of formulas. + /// Allows modifying tags of formulas. All other properties will be ignored. /// /// /// The name of the resource group. @@ -698,7 +690,7 @@ internal FormulasOperations(DevTestLabsClient client) /// The name of the formula. /// /// - /// A formula for creating a VM, specifying an image base and other parameters + /// Allows modifying tags of formulas. All other properties will be ignored. /// /// /// Headers that will be added to request. @@ -963,6 +955,10 @@ internal FormulasOperations(DevTestLabsClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "formula"); } + if (formula != null) + { + formula.Validate(); + } if (Client.ApiVersion == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); @@ -1057,7 +1053,7 @@ internal FormulasOperations(DevTestLabsClient client) System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 201) + if ((int)_statusCode != 200 && (int)_statusCode != 201 && (int)_statusCode != 202) { var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try diff --git a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/FormulasOperationsExtensions.cs b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/FormulasOperationsExtensions.cs index ff69f07d4986..7052dc623113 100644 --- a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/FormulasOperationsExtensions.cs +++ b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/FormulasOperationsExtensions.cs @@ -83,12 +83,9 @@ public static partial class FormulasOperationsExtensions /// /// The name of the formula. /// - /// - /// Specify the $expand query. Example: 'properties($select=description)' - /// - public static Formula Get(this IFormulasOperations operations, string resourceGroupName, string labName, string name, string expand = default(string)) + public static Formula Get(this IFormulasOperations operations, string resourceGroupName, string labName, string name) { - return operations.GetAsync(resourceGroupName, labName, name, expand).GetAwaiter().GetResult(); + return operations.GetAsync(resourceGroupName, labName, name).GetAwaiter().GetResult(); } /// @@ -106,15 +103,12 @@ public static partial class FormulasOperationsExtensions /// /// The name of the formula. /// - /// - /// Specify the $expand query. Example: 'properties($select=description)' - /// /// /// The cancellation token. /// - public static async Task GetAsync(this IFormulasOperations operations, string resourceGroupName, string labName, string name, string expand = default(string), CancellationToken cancellationToken = default(CancellationToken)) + public static async Task GetAsync(this IFormulasOperations operations, string resourceGroupName, string labName, string name, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, labName, name, expand, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, labName, name, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } @@ -218,7 +212,7 @@ public static void Delete(this IFormulasOperations operations, string resourceGr } /// - /// Modify properties of formulas. + /// Allows modifying tags of formulas. All other properties will be ignored. /// /// /// The operations group for this extension method. @@ -233,7 +227,7 @@ public static void Delete(this IFormulasOperations operations, string resourceGr /// The name of the formula. /// /// - /// A formula for creating a VM, specifying an image base and other parameters + /// Allows modifying tags of formulas. All other properties will be ignored. /// public static Formula Update(this IFormulasOperations operations, string resourceGroupName, string labName, string name, FormulaFragment formula) { @@ -241,7 +235,7 @@ public static Formula Update(this IFormulasOperations operations, string resourc } /// - /// Modify properties of formulas. + /// Allows modifying tags of formulas. All other properties will be ignored. /// /// /// The operations group for this extension method. @@ -256,7 +250,7 @@ public static Formula Update(this IFormulasOperations operations, string resourc /// The name of the formula. /// /// - /// A formula for creating a VM, specifying an image base and other parameters + /// Allows modifying tags of formulas. All other properties will be ignored. /// /// /// The cancellation token. diff --git a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/GalleryImagesOperations.cs b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/GalleryImagesOperations.cs index 3f528983dcb4..4663bfb4c693 100644 --- a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/GalleryImagesOperations.cs +++ b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/GalleryImagesOperations.cs @@ -259,6 +259,211 @@ internal GalleryImagesOperations(DevTestLabsClient client) return _result; } + /// + /// Get gallery image. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the lab. + /// + /// + /// The name of the gallery image. + /// + /// + /// 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> GetWithHttpMessagesAsync(string resourceGroupName, string labName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (labName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "labName"); + } + if (name == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "name"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("labName", labName); + tracingParameters.Add("name", name); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/galleryimages/{name}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{labName}", System.Uri.EscapeDataString(labName)); + _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + 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); + } + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + 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); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + /// /// List gallery images in a given lab. /// diff --git a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/GalleryImagesOperationsExtensions.cs b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/GalleryImagesOperationsExtensions.cs index 85502f30dd75..d8c4b91af415 100644 --- a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/GalleryImagesOperationsExtensions.cs +++ b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/GalleryImagesOperationsExtensions.cs @@ -68,6 +68,52 @@ public static partial class GalleryImagesOperationsExtensions } } + /// + /// Get gallery image. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the lab. + /// + /// + /// The name of the gallery image. + /// + public static GalleryImage Get(this IGalleryImagesOperations operations, string resourceGroupName, string labName, string name) + { + return operations.GetAsync(resourceGroupName, labName, name).GetAwaiter().GetResult(); + } + + /// + /// Get gallery image. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the lab. + /// + /// + /// The name of the gallery image. + /// + /// + /// The cancellation token. + /// + public static async Task GetAsync(this IGalleryImagesOperations operations, string resourceGroupName, string labName, string name, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, labName, name, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// /// List gallery images in a given lab. /// diff --git a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/GlobalSchedulesOperations.cs b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/GlobalSchedulesOperations.cs index 809227bb70c6..fc3677237085 100644 --- a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/GlobalSchedulesOperations.cs +++ b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/GlobalSchedulesOperations.cs @@ -449,9 +449,6 @@ internal GlobalSchedulesOperations(DevTestLabsClient client) /// /// The name of the schedule. /// - /// - /// Specify the $expand query. Example: 'properties($select=status)' - /// /// /// Headers that will be added to request. /// @@ -473,7 +470,7 @@ internal GlobalSchedulesOperations(DevTestLabsClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string name, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (Client.SubscriptionId == null) { @@ -500,7 +497,6 @@ internal GlobalSchedulesOperations(DevTestLabsClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("expand", expand); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } @@ -511,10 +507,6 @@ internal GlobalSchedulesOperations(DevTestLabsClient client) _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); List _queryParameters = new List(); - if (expand != null) - { - _queryParameters.Add(string.Format("$expand={0}", System.Uri.EscapeDataString(expand))); - } if (Client.ApiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); @@ -695,6 +687,10 @@ internal GlobalSchedulesOperations(DevTestLabsClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "schedule"); } + if (schedule != null) + { + schedule.Validate(); + } if (Client.ApiVersion == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); @@ -1048,7 +1044,7 @@ internal GlobalSchedulesOperations(DevTestLabsClient client) } /// - /// Modify properties of schedules. + /// Allows modifying tags of schedules. All other properties will be ignored. /// /// /// The name of the resource group. @@ -1057,7 +1053,7 @@ internal GlobalSchedulesOperations(DevTestLabsClient client) /// The name of the schedule. /// /// - /// A schedule. + /// Allows modifying tags of schedules. All other properties will be ignored. /// /// /// Headers that will be added to request. diff --git a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/GlobalSchedulesOperationsExtensions.cs b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/GlobalSchedulesOperationsExtensions.cs index 789917f7b6dd..433011fb10e3 100644 --- a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/GlobalSchedulesOperationsExtensions.cs +++ b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/GlobalSchedulesOperationsExtensions.cs @@ -108,12 +108,9 @@ public static partial class GlobalSchedulesOperationsExtensions /// /// The name of the schedule. /// - /// - /// Specify the $expand query. Example: 'properties($select=status)' - /// - public static Schedule Get(this IGlobalSchedulesOperations operations, string resourceGroupName, string name, string expand = default(string)) + public static Schedule Get(this IGlobalSchedulesOperations operations, string resourceGroupName, string name) { - return operations.GetAsync(resourceGroupName, name, expand).GetAwaiter().GetResult(); + return operations.GetAsync(resourceGroupName, name).GetAwaiter().GetResult(); } /// @@ -128,15 +125,12 @@ public static partial class GlobalSchedulesOperationsExtensions /// /// The name of the schedule. /// - /// - /// Specify the $expand query. Example: 'properties($select=status)' - /// /// /// The cancellation token. /// - public static async Task GetAsync(this IGlobalSchedulesOperations operations, string resourceGroupName, string name, string expand = default(string), CancellationToken cancellationToken = default(CancellationToken)) + public static async Task GetAsync(this IGlobalSchedulesOperations operations, string resourceGroupName, string name, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, name, expand, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, name, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } @@ -226,7 +220,7 @@ public static void Delete(this IGlobalSchedulesOperations operations, string res } /// - /// Modify properties of schedules. + /// Allows modifying tags of schedules. All other properties will be ignored. /// /// /// The operations group for this extension method. @@ -238,7 +232,7 @@ public static void Delete(this IGlobalSchedulesOperations operations, string res /// The name of the schedule. /// /// - /// A schedule. + /// Allows modifying tags of schedules. All other properties will be ignored. /// public static Schedule Update(this IGlobalSchedulesOperations operations, string resourceGroupName, string name, ScheduleFragment schedule) { @@ -246,7 +240,7 @@ public static Schedule Update(this IGlobalSchedulesOperations operations, string } /// - /// Modify properties of schedules. + /// Allows modifying tags of schedules. All other properties will be ignored. /// /// /// The operations group for this extension method. @@ -258,7 +252,7 @@ public static Schedule Update(this IGlobalSchedulesOperations operations, string /// The name of the schedule. /// /// - /// A schedule. + /// Allows modifying tags of schedules. All other properties will be ignored. /// /// /// The cancellation token. diff --git a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/IArmTemplatesOperations.cs b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/IArmTemplatesOperations.cs index 824bc0c14050..3e4e71bcb300 100644 --- a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/IArmTemplatesOperations.cs +++ b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/IArmTemplatesOperations.cs @@ -68,11 +68,7 @@ public partial interface IArmTemplatesOperations /// The name of the artifact source. /// /// - /// The name of the azure Resource Manager template. - /// - /// - /// Specify the $expand query. Example: - /// 'properties($select=displayName)' + /// The name of the azure resource manager template. /// /// /// The headers that will be added to request. @@ -89,7 +85,7 @@ public partial interface IArmTemplatesOperations /// /// Thrown when a required parameter is null /// - Task> GetWithHttpMessagesAsync(string resourceGroupName, string labName, string artifactSourceName, string name, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> GetWithHttpMessagesAsync(string resourceGroupName, string labName, string artifactSourceName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// List azure resource manager templates in a given artifact source. /// diff --git a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/IArtifactSourcesOperations.cs b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/IArtifactSourcesOperations.cs index 466cb9703b0f..91508c44519d 100644 --- a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/IArtifactSourcesOperations.cs +++ b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/IArtifactSourcesOperations.cs @@ -64,10 +64,6 @@ public partial interface IArtifactSourcesOperations /// /// The name of the artifact source. /// - /// - /// Specify the $expand query. Example: - /// 'properties($select=displayName)' - /// /// /// The headers that will be added to request. /// @@ -83,7 +79,7 @@ public partial interface IArtifactSourcesOperations /// /// Thrown when a required parameter is null /// - Task> GetWithHttpMessagesAsync(string resourceGroupName, string labName, string name, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> GetWithHttpMessagesAsync(string resourceGroupName, string labName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Create or replace an existing artifact source. /// @@ -141,7 +137,8 @@ public partial interface IArtifactSourcesOperations /// Task DeleteWithHttpMessagesAsync(string resourceGroupName, string labName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Modify properties of artifact sources. + /// Allows modifying tags of artifact sources. All other properties + /// will be ignored. /// /// /// The name of the resource group. @@ -153,7 +150,8 @@ public partial interface IArtifactSourcesOperations /// The name of the artifact source. /// /// - /// Properties of an artifact source. + /// Allows modifying tags of artifact sources. All other properties + /// will be ignored. /// /// /// The headers that will be added to request. diff --git a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/IArtifactsOperations.cs b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/IArtifactsOperations.cs index c32e03633389..f4b6f0248828 100644 --- a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/IArtifactsOperations.cs +++ b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/IArtifactsOperations.cs @@ -70,9 +70,6 @@ public partial interface IArtifactsOperations /// /// The name of the artifact. /// - /// - /// Specify the $expand query. Example: 'properties($select=title)' - /// /// /// The headers that will be added to request. /// @@ -88,7 +85,7 @@ public partial interface IArtifactsOperations /// /// Thrown when a required parameter is null /// - Task> GetWithHttpMessagesAsync(string resourceGroupName, string labName, string artifactSourceName, string name, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> GetWithHttpMessagesAsync(string resourceGroupName, string labName, string artifactSourceName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Generates an ARM template for the given artifact, uploads the /// required files to a storage account, and validates the generated diff --git a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/IBastionHostsOperations.cs b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/IBastionHostsOperations.cs new file mode 100644 index 000000000000..33000e5ac51f --- /dev/null +++ b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/IBastionHostsOperations.cs @@ -0,0 +1,274 @@ +// +// 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.DevTestLabs +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Microsoft.Rest.Azure.OData; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// BastionHostsOperations operations. + /// + public partial interface IBastionHostsOperations + { + /// + /// List bastionhosts in a given virtual network. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the lab. + /// + /// + /// The name of the virtual network. + /// + /// + /// OData parameters to apply to the operation. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> ListWithHttpMessagesAsync(string resourceGroupName, string labName, string virtualNetworkName, ODataQuery odataQuery = default(ODataQuery), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Get bastionhost. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the lab. + /// + /// + /// The name of the virtual network. + /// + /// + /// The name of the bastionhost. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> GetWithHttpMessagesAsync(string resourceGroupName, string labName, string virtualNetworkName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Create or replace an existing bastionHost. This operation can take + /// a while to complete. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the lab. + /// + /// + /// The name of the virtual network. + /// + /// + /// The name of the bastionhost. + /// + /// + /// Profile of a Bastion Host + /// + /// + /// 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> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string labName, string virtualNetworkName, string name, BastionHost bastionHost, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Delete bastionhost. This operation can take a while to complete. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the lab. + /// + /// + /// The name of the virtual network. + /// + /// + /// The name of the bastionhost. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task DeleteWithHttpMessagesAsync(string resourceGroupName, string labName, string virtualNetworkName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Allows modifying tags of bastionhosts. All other properties will be + /// ignored. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the lab. + /// + /// + /// The name of the virtual network. + /// + /// + /// The name of the bastionhost. + /// + /// + /// Allows modifying tags of bastionhosts. All other properties will be + /// ignored. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string labName, string virtualNetworkName, string name, BastionHostFragment bastionHost, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Create or replace an existing bastionHost. This operation can take + /// a while to complete. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the lab. + /// + /// + /// The name of the virtual network. + /// + /// + /// The name of the bastionhost. + /// + /// + /// Profile of a Bastion Host + /// + /// + /// 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> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string labName, string virtualNetworkName, string name, BastionHost bastionHost, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Delete bastionhost. This operation can take a while to complete. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the lab. + /// + /// + /// The name of the virtual network. + /// + /// + /// The name of the bastionhost. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string labName, string virtualNetworkName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// List bastionhosts in a given virtual network. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/ICostsOperations.cs b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/ICostsOperations.cs index ba5361f47180..c9fef662c15f 100644 --- a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/ICostsOperations.cs +++ b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/ICostsOperations.cs @@ -12,6 +12,7 @@ namespace Microsoft.Azure.Management.DevTestLabs { using Microsoft.Rest; using Microsoft.Rest.Azure; + using Microsoft.Rest.Azure.OData; using Models; using System.Collections; using System.Collections.Generic; @@ -23,6 +24,34 @@ namespace Microsoft.Azure.Management.DevTestLabs /// public partial interface ICostsOperations { + /// + /// List costs in a given lab. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the lab. + /// + /// + /// OData parameters to apply to the operation. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> ListWithHttpMessagesAsync(string resourceGroupName, string labName, ODataQuery odataQuery = default(ODataQuery), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Get cost. /// @@ -86,5 +115,27 @@ public partial interface ICostsOperations /// Thrown when a required parameter is null /// Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string labName, string name, LabCost labCost, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// List costs in a given lab. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); } } diff --git a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/ICustomImagesOperations.cs b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/ICustomImagesOperations.cs index fb56f74f7a86..6ca7544ebfa9 100644 --- a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/ICustomImagesOperations.cs +++ b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/ICustomImagesOperations.cs @@ -64,9 +64,6 @@ public partial interface ICustomImagesOperations /// /// The name of the custom image. /// - /// - /// Specify the $expand query. Example: 'properties($select=vm)' - /// /// /// The headers that will be added to request. /// @@ -82,7 +79,7 @@ public partial interface ICustomImagesOperations /// /// Thrown when a required parameter is null /// - Task> GetWithHttpMessagesAsync(string resourceGroupName, string labName, string name, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> GetWithHttpMessagesAsync(string resourceGroupName, string labName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Create or replace an existing custom image. This operation can take /// a while to complete. @@ -141,7 +138,8 @@ public partial interface ICustomImagesOperations /// Task DeleteWithHttpMessagesAsync(string resourceGroupName, string labName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Modify properties of custom images. + /// Allows modifying tags of custom images. All other properties will + /// be ignored. /// /// /// The name of the resource group. @@ -153,7 +151,8 @@ public partial interface ICustomImagesOperations /// The name of the custom image. /// /// - /// A custom image. + /// Allows modifying tags of custom images. All other properties will + /// be ignored. /// /// /// The headers that will be added to request. diff --git a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/IDevTestLabsClient.cs b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/IDevTestLabsClient.cs index ae1ff0889dc8..769faf879f57 100644 --- a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/IDevTestLabsClient.cs +++ b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/IDevTestLabsClient.cs @@ -50,6 +50,16 @@ public partial interface IDevTestLabsClient : System.IDisposable /// string SubscriptionId { get; set; } + /// + /// The ID of the target subscription. + /// + string SubscriptionId1 { get; set; } + + /// + /// The API version to use for this operation. + /// + string ApiVersion1 { get; set; } + /// /// The preferred language for the response. /// @@ -144,11 +154,26 @@ public partial interface IDevTestLabsClient : System.IDisposable /// ISchedulesOperations Schedules { get; } + /// + /// Gets the ILabSecretsOperations. + /// + ILabSecretsOperations LabSecrets { get; } + /// /// Gets the IServiceRunnersOperations. /// IServiceRunnersOperations ServiceRunners { get; } + /// + /// Gets the ISharedGalleriesOperations. + /// + ISharedGalleriesOperations SharedGalleries { get; } + + /// + /// Gets the ISharedImagesOperations. + /// + ISharedImagesOperations SharedImages { get; } + /// /// Gets the IUsersOperations. /// @@ -194,5 +219,10 @@ public partial interface IDevTestLabsClient : System.IDisposable /// IVirtualNetworksOperations VirtualNetworks { get; } + /// + /// Gets the IBastionHostsOperations. + /// + IBastionHostsOperations BastionHosts { get; } + } } diff --git a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/IDisksOperations.cs b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/IDisksOperations.cs index 52f70aa1a237..9d5c034b8050 100644 --- a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/IDisksOperations.cs +++ b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/IDisksOperations.cs @@ -70,9 +70,6 @@ public partial interface IDisksOperations /// /// The name of the disk. /// - /// - /// Specify the $expand query. Example: 'properties($select=diskType)' - /// /// /// The headers that will be added to request. /// @@ -88,7 +85,7 @@ public partial interface IDisksOperations /// /// Thrown when a required parameter is null /// - Task> GetWithHttpMessagesAsync(string resourceGroupName, string labName, string userName, string name, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> GetWithHttpMessagesAsync(string resourceGroupName, string labName, string userName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Create or replace an existing disk. This operation can take a while /// to complete. @@ -153,7 +150,8 @@ public partial interface IDisksOperations /// Task DeleteWithHttpMessagesAsync(string resourceGroupName, string labName, string userName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Modify properties of disks. + /// Allows modifying tags of disks. All other properties will be + /// ignored. /// /// /// The name of the resource group. @@ -168,7 +166,8 @@ public partial interface IDisksOperations /// The name of the disk. /// /// - /// A Disk. + /// Allows modifying tags of disks. All other properties will be + /// ignored. /// /// /// The headers that will be added to request. diff --git a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/IEnvironmentsOperations.cs b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/IEnvironmentsOperations.cs index 28d2384aa0bb..2de56eb9eb2b 100644 --- a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/IEnvironmentsOperations.cs +++ b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/IEnvironmentsOperations.cs @@ -70,10 +70,6 @@ public partial interface IEnvironmentsOperations /// /// The name of the environment. /// - /// - /// Specify the $expand query. Example: - /// 'properties($select=deploymentProperties)' - /// /// /// The headers that will be added to request. /// @@ -89,7 +85,7 @@ public partial interface IEnvironmentsOperations /// /// Thrown when a required parameter is null /// - Task> GetWithHttpMessagesAsync(string resourceGroupName, string labName, string userName, string name, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> GetWithHttpMessagesAsync(string resourceGroupName, string labName, string userName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Create or replace an existing environment. This operation can take /// a while to complete. @@ -154,7 +150,8 @@ public partial interface IEnvironmentsOperations /// Task DeleteWithHttpMessagesAsync(string resourceGroupName, string labName, string userName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Modify properties of environments. + /// Allows modifying tags of environments. All other properties will be + /// ignored. /// /// /// The name of the resource group. @@ -169,7 +166,8 @@ public partial interface IEnvironmentsOperations /// The name of the environment. /// /// - /// An environment, which is essentially an ARM template deployment. + /// Allows modifying tags of environments. All other properties will be + /// ignored. /// /// /// The headers that will be added to request. diff --git a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/IFormulasOperations.cs b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/IFormulasOperations.cs index 48864015c4dd..58d95aba85a1 100644 --- a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/IFormulasOperations.cs +++ b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/IFormulasOperations.cs @@ -64,10 +64,6 @@ public partial interface IFormulasOperations /// /// The name of the formula. /// - /// - /// Specify the $expand query. Example: - /// 'properties($select=description)' - /// /// /// The headers that will be added to request. /// @@ -83,7 +79,7 @@ public partial interface IFormulasOperations /// /// Thrown when a required parameter is null /// - Task> GetWithHttpMessagesAsync(string resourceGroupName, string labName, string name, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> GetWithHttpMessagesAsync(string resourceGroupName, string labName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Create or replace an existing Formula. This operation can take a /// while to complete. @@ -143,7 +139,8 @@ public partial interface IFormulasOperations /// Task DeleteWithHttpMessagesAsync(string resourceGroupName, string labName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Modify properties of formulas. + /// Allows modifying tags of formulas. All other properties will be + /// ignored. /// /// /// The name of the resource group. @@ -155,8 +152,8 @@ public partial interface IFormulasOperations /// The name of the formula. /// /// - /// A formula for creating a VM, specifying an image base and other - /// parameters + /// Allows modifying tags of formulas. All other properties will be + /// ignored. /// /// /// The headers that will be added to request. diff --git a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/IGalleryImagesOperations.cs b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/IGalleryImagesOperations.cs index aaf883380f59..fa1f206ebcb9 100644 --- a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/IGalleryImagesOperations.cs +++ b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/IGalleryImagesOperations.cs @@ -53,6 +53,34 @@ public partial interface IGalleryImagesOperations /// Task>> ListWithHttpMessagesAsync(string resourceGroupName, string labName, ODataQuery odataQuery = default(ODataQuery), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// + /// Get gallery image. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the lab. + /// + /// + /// The name of the gallery image. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> GetWithHttpMessagesAsync(string resourceGroupName, string labName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// /// List gallery images in a given lab. /// /// diff --git a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/IGlobalSchedulesOperations.cs b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/IGlobalSchedulesOperations.cs index dd2c73fc409b..548ea7593f84 100644 --- a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/IGlobalSchedulesOperations.cs +++ b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/IGlobalSchedulesOperations.cs @@ -80,9 +80,6 @@ public partial interface IGlobalSchedulesOperations /// /// The name of the schedule. /// - /// - /// Specify the $expand query. Example: 'properties($select=status)' - /// /// /// The headers that will be added to request. /// @@ -98,7 +95,7 @@ public partial interface IGlobalSchedulesOperations /// /// Thrown when a required parameter is null /// - Task> GetWithHttpMessagesAsync(string resourceGroupName, string name, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> GetWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Create or replace an existing schedule. /// @@ -150,7 +147,8 @@ public partial interface IGlobalSchedulesOperations /// Task DeleteWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Modify properties of schedules. + /// Allows modifying tags of schedules. All other properties will be + /// ignored. /// /// /// The name of the resource group. @@ -159,7 +157,8 @@ public partial interface IGlobalSchedulesOperations /// The name of the schedule. /// /// - /// A schedule. + /// Allows modifying tags of schedules. All other properties will be + /// ignored. /// /// /// The headers that will be added to request. diff --git a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/ILabSecretsOperations.cs b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/ILabSecretsOperations.cs new file mode 100644 index 000000000000..44392d3289b1 --- /dev/null +++ b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/ILabSecretsOperations.cs @@ -0,0 +1,253 @@ +// +// 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.DevTestLabs +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Microsoft.Rest.Azure.OData; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// LabSecretsOperations operations. + /// + public partial interface ILabSecretsOperations + { + /// + /// List lab secrets in a given lab. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the lab. + /// + /// + /// OData parameters to apply to the operation. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> ListWithHttpMessagesAsync(string resourceGroupName, string labName, ODataQuery odataQuery = default(ODataQuery), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Get lab secret. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the lab. + /// + /// + /// The name of the lab secret. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> GetWithHttpMessagesAsync(string resourceGroupName, string labName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Create or replace an existing Lab Secret. This operation can take a + /// while to complete. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the lab. + /// + /// + /// The name of the lab secret. + /// + /// + /// A shared secret in a lab. + /// + /// + /// 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> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string labName, string name, LabSecret labSecret, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Delete lab secret. This operation can take a while to complete. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the lab. + /// + /// + /// The name of the lab secret. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task DeleteWithHttpMessagesAsync(string resourceGroupName, string labName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Allows modifying tags of lab secrets. All other properties will be + /// ignored. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the lab. + /// + /// + /// The name of the lab secret. + /// + /// + /// Allows modifying tags of lab secrets. All other properties will be + /// ignored. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string labName, string name, SecretFragment secret, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Create or replace an existing Lab Secret. This operation can take a + /// while to complete. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the lab. + /// + /// + /// The name of the lab secret. + /// + /// + /// A shared secret in a lab. + /// + /// + /// 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> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string labName, string name, LabSecret labSecret, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Delete lab secret. This operation can take a while to complete. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the lab. + /// + /// + /// The name of the lab secret. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string labName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// List lab secrets in a given lab. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/ILabsOperations.cs b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/ILabsOperations.cs index 5caa37c63a5e..d6a82d4b0b54 100644 --- a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/ILabsOperations.cs +++ b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/ILabsOperations.cs @@ -80,10 +80,6 @@ public partial interface ILabsOperations /// /// The name of the lab. /// - /// - /// Specify the $expand query. Example: - /// 'properties($select=defaultStorageAccount)' - /// /// /// The headers that will be added to request. /// @@ -99,7 +95,7 @@ public partial interface ILabsOperations /// /// Thrown when a required parameter is null /// - Task> GetWithHttpMessagesAsync(string resourceGroupName, string name, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> GetWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Create or replace an existing lab. This operation can take a while /// to complete. @@ -152,7 +148,8 @@ public partial interface ILabsOperations /// Task DeleteWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Modify properties of labs. + /// Allows modifying tags of labs. All other properties will be + /// ignored. /// /// /// The name of the resource group. @@ -161,7 +158,8 @@ public partial interface ILabsOperations /// The name of the lab. /// /// - /// A lab. + /// Allows modifying tags of labs. All other properties will be + /// ignored. /// /// /// The headers that will be added to request. @@ -229,6 +227,28 @@ public partial interface ILabsOperations /// Task CreateEnvironmentWithHttpMessagesAsync(string resourceGroupName, string name, LabVirtualMachineCreationParameter labVirtualMachineCreationParameter, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// + /// Ensure the current user has a valid profile in the lab. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the lab. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task EnsureCurrentUserProfileWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// /// Exports the lab resource usage into a storage account This /// operation can take a while to complete. /// diff --git a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/INotificationChannelsOperations.cs b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/INotificationChannelsOperations.cs index b4b8dc3d17de..966858245113 100644 --- a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/INotificationChannelsOperations.cs +++ b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/INotificationChannelsOperations.cs @@ -25,7 +25,7 @@ namespace Microsoft.Azure.Management.DevTestLabs public partial interface INotificationChannelsOperations { /// - /// List notificationchannels in a given lab. + /// List notification channels in a given lab. /// /// /// The name of the resource group. @@ -53,7 +53,7 @@ public partial interface INotificationChannelsOperations /// Task>> ListWithHttpMessagesAsync(string resourceGroupName, string labName, ODataQuery odataQuery = default(ODataQuery), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Get notificationchannel. + /// Get notification channel. /// /// /// The name of the resource group. @@ -62,11 +62,7 @@ public partial interface INotificationChannelsOperations /// The name of the lab. /// /// - /// The name of the notificationChannel. - /// - /// - /// Specify the $expand query. Example: - /// 'properties($select=webHookUrl)' + /// The name of the notification channel. /// /// /// The headers that will be added to request. @@ -83,9 +79,9 @@ public partial interface INotificationChannelsOperations /// /// Thrown when a required parameter is null /// - Task> GetWithHttpMessagesAsync(string resourceGroupName, string labName, string name, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> GetWithHttpMessagesAsync(string resourceGroupName, string labName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Create or replace an existing notificationChannel. + /// Create or replace an existing Notification Channel. /// /// /// The name of the resource group. @@ -94,7 +90,7 @@ public partial interface INotificationChannelsOperations /// The name of the lab. /// /// - /// The name of the notificationChannel. + /// The name of the notification channel. /// /// /// A notification. @@ -116,7 +112,7 @@ public partial interface INotificationChannelsOperations /// Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string labName, string name, NotificationChannel notificationChannel, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Delete notificationchannel. + /// Delete notification channel. /// /// /// The name of the resource group. @@ -125,7 +121,7 @@ public partial interface INotificationChannelsOperations /// The name of the lab. /// /// - /// The name of the notificationChannel. + /// The name of the notification channel. /// /// /// The headers that will be added to request. @@ -141,7 +137,8 @@ public partial interface INotificationChannelsOperations /// Task DeleteWithHttpMessagesAsync(string resourceGroupName, string labName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Modify properties of notificationchannels. + /// Allows modifying tags of notification channels. All other + /// properties will be ignored. /// /// /// The name of the resource group. @@ -150,10 +147,11 @@ public partial interface INotificationChannelsOperations /// The name of the lab. /// /// - /// The name of the notificationChannel. + /// The name of the notification channel. /// /// - /// A notification. + /// Allows modifying tags of notification channels. All other + /// properties will be ignored. /// /// /// The headers that will be added to request. @@ -181,7 +179,7 @@ public partial interface INotificationChannelsOperations /// The name of the lab. /// /// - /// The name of the notificationChannel. + /// The name of the notification channel. /// /// /// Properties for generating a Notification. @@ -200,7 +198,7 @@ public partial interface INotificationChannelsOperations /// Task NotifyWithHttpMessagesAsync(string resourceGroupName, string labName, string name, NotifyParameters notifyParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// List notificationchannels in a given lab. + /// List notification channels in a given lab. /// /// /// The NextLink from the previous successful call to List operation. diff --git a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/IPoliciesOperations.cs b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/IPoliciesOperations.cs index 49cc0746565d..ec5e275c9b4e 100644 --- a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/IPoliciesOperations.cs +++ b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/IPoliciesOperations.cs @@ -70,10 +70,6 @@ public partial interface IPoliciesOperations /// /// The name of the policy. /// - /// - /// Specify the $expand query. Example: - /// 'properties($select=description)' - /// /// /// The headers that will be added to request. /// @@ -89,7 +85,7 @@ public partial interface IPoliciesOperations /// /// Thrown when a required parameter is null /// - Task> GetWithHttpMessagesAsync(string resourceGroupName, string labName, string policySetName, string name, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> GetWithHttpMessagesAsync(string resourceGroupName, string labName, string policySetName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Create or replace an existing policy. /// @@ -153,7 +149,8 @@ public partial interface IPoliciesOperations /// Task DeleteWithHttpMessagesAsync(string resourceGroupName, string labName, string policySetName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Modify properties of policies. + /// Allows modifying tags of policies. All other properties will be + /// ignored. /// /// /// The name of the resource group. @@ -168,7 +165,8 @@ public partial interface IPoliciesOperations /// The name of the policy. /// /// - /// A Policy. + /// Allows modifying tags of policies. All other properties will be + /// ignored. /// /// /// The headers that will be added to request. diff --git a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/IPolicySetsOperations.cs b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/IPolicySetsOperations.cs index 2edc6e6b823b..3b2af77bedf2 100644 --- a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/IPolicySetsOperations.cs +++ b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/IPolicySetsOperations.cs @@ -12,6 +12,7 @@ namespace Microsoft.Azure.Management.DevTestLabs { using Microsoft.Rest; using Microsoft.Rest.Azure; + using Microsoft.Rest.Azure.OData; using Models; using System.Collections; using System.Collections.Generic; @@ -23,6 +24,34 @@ namespace Microsoft.Azure.Management.DevTestLabs /// public partial interface IPolicySetsOperations { + /// + /// List policy sets in a given lab. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the lab. + /// + /// + /// OData parameters to apply to the operation. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> ListWithHttpMessagesAsync(string resourceGroupName, string labName, ODataQuery odataQuery = default(ODataQuery), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Evaluates lab policy. /// @@ -54,5 +83,27 @@ public partial interface IPolicySetsOperations /// Thrown when a required parameter is null /// Task> EvaluatePoliciesWithHttpMessagesAsync(string resourceGroupName, string labName, string name, EvaluatePoliciesRequest evaluatePoliciesRequest, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// List policy sets in a given lab. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); } } diff --git a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/ISchedulesOperations.cs b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/ISchedulesOperations.cs index 00111fe801a7..41501c9a4e3a 100644 --- a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/ISchedulesOperations.cs +++ b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/ISchedulesOperations.cs @@ -64,9 +64,6 @@ public partial interface ISchedulesOperations /// /// The name of the schedule. /// - /// - /// Specify the $expand query. Example: 'properties($select=status)' - /// /// /// The headers that will be added to request. /// @@ -82,7 +79,7 @@ public partial interface ISchedulesOperations /// /// Thrown when a required parameter is null /// - Task> GetWithHttpMessagesAsync(string resourceGroupName, string labName, string name, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> GetWithHttpMessagesAsync(string resourceGroupName, string labName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Create or replace an existing schedule. /// @@ -140,7 +137,8 @@ public partial interface ISchedulesOperations /// Task DeleteWithHttpMessagesAsync(string resourceGroupName, string labName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Modify properties of schedules. + /// Allows modifying tags of schedules. All other properties will be + /// ignored. /// /// /// The name of the resource group. @@ -152,7 +150,8 @@ public partial interface ISchedulesOperations /// The name of the schedule. /// /// - /// A schedule. + /// Allows modifying tags of schedules. All other properties will be + /// ignored. /// /// /// The headers that will be added to request. diff --git a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/ISecretsOperations.cs b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/ISecretsOperations.cs index ca5de78577c7..726b7ca762c8 100644 --- a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/ISecretsOperations.cs +++ b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/ISecretsOperations.cs @@ -70,9 +70,6 @@ public partial interface ISecretsOperations /// /// The name of the secret. /// - /// - /// Specify the $expand query. Example: 'properties($select=value)' - /// /// /// The headers that will be added to request. /// @@ -88,7 +85,7 @@ public partial interface ISecretsOperations /// /// Thrown when a required parameter is null /// - Task> GetWithHttpMessagesAsync(string resourceGroupName, string labName, string userName, string name, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> GetWithHttpMessagesAsync(string resourceGroupName, string labName, string userName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Create or replace an existing secret. This operation can take a /// while to complete. @@ -153,7 +150,8 @@ public partial interface ISecretsOperations /// Task DeleteWithHttpMessagesAsync(string resourceGroupName, string labName, string userName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Modify properties of secrets. + /// Allows modifying tags of secrets. All other properties will be + /// ignored. /// /// /// The name of the resource group. @@ -168,7 +166,8 @@ public partial interface ISecretsOperations /// The name of the secret. /// /// - /// A secret. + /// Allows modifying tags of secrets. All other properties will be + /// ignored. /// /// /// The headers that will be added to request. diff --git a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/IServiceFabricSchedulesOperations.cs b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/IServiceFabricSchedulesOperations.cs index 9f3da080eeca..8f4d31c3cac9 100644 --- a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/IServiceFabricSchedulesOperations.cs +++ b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/IServiceFabricSchedulesOperations.cs @@ -37,7 +37,7 @@ public partial interface IServiceFabricSchedulesOperations /// The name of the user profile. /// /// - /// The name of the service Fabric. + /// The name of the service fabric. /// /// /// OData parameters to apply to the operation. @@ -71,14 +71,11 @@ public partial interface IServiceFabricSchedulesOperations /// The name of the user profile. /// /// - /// The name of the service Fabric. + /// The name of the service fabric. /// /// /// The name of the schedule. /// - /// - /// Specify the $expand query. Example: 'properties($select=status)' - /// /// /// The headers that will be added to request. /// @@ -94,7 +91,7 @@ public partial interface IServiceFabricSchedulesOperations /// /// Thrown when a required parameter is null /// - Task> GetWithHttpMessagesAsync(string resourceGroupName, string labName, string userName, string serviceFabricName, string name, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> GetWithHttpMessagesAsync(string resourceGroupName, string labName, string userName, string serviceFabricName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Create or replace an existing schedule. /// @@ -108,7 +105,7 @@ public partial interface IServiceFabricSchedulesOperations /// The name of the user profile. /// /// - /// The name of the service Fabric. + /// The name of the service fabric. /// /// /// The name of the schedule. @@ -145,7 +142,7 @@ public partial interface IServiceFabricSchedulesOperations /// The name of the user profile. /// /// - /// The name of the service Fabric. + /// The name of the service fabric. /// /// /// The name of the schedule. @@ -164,7 +161,8 @@ public partial interface IServiceFabricSchedulesOperations /// Task DeleteWithHttpMessagesAsync(string resourceGroupName, string labName, string userName, string serviceFabricName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Modify properties of schedules. + /// Allows modifying tags of schedules. All other properties will be + /// ignored. /// /// /// The name of the resource group. @@ -176,13 +174,14 @@ public partial interface IServiceFabricSchedulesOperations /// The name of the user profile. /// /// - /// The name of the service Fabric. + /// The name of the service fabric. /// /// /// The name of the schedule. /// /// - /// A schedule. + /// Allows modifying tags of schedules. All other properties will be + /// ignored. /// /// /// The headers that will be added to request. @@ -213,7 +212,7 @@ public partial interface IServiceFabricSchedulesOperations /// The name of the user profile. /// /// - /// The name of the service Fabric. + /// The name of the service fabric. /// /// /// The name of the schedule. @@ -244,7 +243,7 @@ public partial interface IServiceFabricSchedulesOperations /// The name of the user profile. /// /// - /// The name of the service Fabric. + /// The name of the service fabric. /// /// /// The name of the schedule. diff --git a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/IServiceFabricsOperations.cs b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/IServiceFabricsOperations.cs index 01b54afaa2d9..a8266beb404b 100644 --- a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/IServiceFabricsOperations.cs +++ b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/IServiceFabricsOperations.cs @@ -68,7 +68,7 @@ public partial interface IServiceFabricsOperations /// The name of the user profile. /// /// - /// The name of the service Fabric. + /// The name of the service fabric. /// /// /// Specify the $expand query. Example: @@ -104,7 +104,7 @@ public partial interface IServiceFabricsOperations /// The name of the user profile. /// /// - /// The name of the service Fabric. + /// The name of the service fabric. /// /// /// A Service Fabric. @@ -138,7 +138,7 @@ public partial interface IServiceFabricsOperations /// The name of the user profile. /// /// - /// The name of the service Fabric. + /// The name of the service fabric. /// /// /// The headers that will be added to request. @@ -154,7 +154,8 @@ public partial interface IServiceFabricsOperations /// Task DeleteWithHttpMessagesAsync(string resourceGroupName, string labName, string userName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Modify properties of service fabrics. + /// Allows modifying tags of service fabrics. All other properties will + /// be ignored. /// /// /// The name of the resource group. @@ -166,10 +167,11 @@ public partial interface IServiceFabricsOperations /// The name of the user profile. /// /// - /// The name of the service Fabric. + /// The name of the service fabric. /// /// - /// A Service Fabric. + /// Allows modifying tags of service fabrics. All other properties will + /// be ignored. /// /// /// The headers that will be added to request. @@ -200,7 +202,7 @@ public partial interface IServiceFabricsOperations /// The name of the user profile. /// /// - /// The name of the service Fabric. + /// The name of the service fabric. /// /// /// The headers that will be added to request. @@ -232,7 +234,7 @@ public partial interface IServiceFabricsOperations /// The name of the user profile. /// /// - /// The name of the service Fabric. + /// The name of the service fabric. /// /// /// The headers that will be added to request. @@ -260,7 +262,7 @@ public partial interface IServiceFabricsOperations /// The name of the user profile. /// /// - /// The name of the service Fabric. + /// The name of the service fabric. /// /// /// The headers that will be added to request. @@ -289,7 +291,7 @@ public partial interface IServiceFabricsOperations /// The name of the user profile. /// /// - /// The name of the service Fabric. + /// The name of the service fabric. /// /// /// A Service Fabric. @@ -323,7 +325,7 @@ public partial interface IServiceFabricsOperations /// The name of the user profile. /// /// - /// The name of the service Fabric. + /// The name of the service fabric. /// /// /// The headers that will be added to request. @@ -352,7 +354,7 @@ public partial interface IServiceFabricsOperations /// The name of the user profile. /// /// - /// The name of the service Fabric. + /// The name of the service fabric. /// /// /// The headers that will be added to request. @@ -380,7 +382,7 @@ public partial interface IServiceFabricsOperations /// The name of the user profile. /// /// - /// The name of the service Fabric. + /// The name of the service fabric. /// /// /// The headers that will be added to request. diff --git a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/IServiceRunnersOperations.cs b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/IServiceRunnersOperations.cs index c05412a2c44d..90597b22a791 100644 --- a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/IServiceRunnersOperations.cs +++ b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/IServiceRunnersOperations.cs @@ -81,7 +81,8 @@ public partial interface IServiceRunnersOperations /// Task> GetWithHttpMessagesAsync(string resourceGroupName, string labName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Create or replace an existing Service runner. + /// Create or replace an existing Service runner. This operation can + /// take a while to complete. /// /// /// The name of the resource group. @@ -112,7 +113,7 @@ public partial interface IServiceRunnersOperations /// Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string labName, string name, ServiceRunner serviceRunner, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Delete service runner. + /// Delete service runner. This operation can take a while to complete. /// /// /// The name of the resource group. @@ -137,6 +138,63 @@ public partial interface IServiceRunnersOperations /// Task DeleteWithHttpMessagesAsync(string resourceGroupName, string labName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// + /// Create or replace an existing Service runner. This operation can + /// take a while to complete. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the lab. + /// + /// + /// The name of the service runner. + /// + /// + /// A container for a managed identity to execute DevTest lab services. + /// + /// + /// 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> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string labName, string name, ServiceRunner serviceRunner, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Delete service runner. This operation can take a while to complete. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the lab. + /// + /// + /// The name of the service runner. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string labName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// /// List service runners in a given lab. /// /// diff --git a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/ISharedGalleriesOperations.cs b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/ISharedGalleriesOperations.cs new file mode 100644 index 000000000000..4f29199a8eb0 --- /dev/null +++ b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/ISharedGalleriesOperations.cs @@ -0,0 +1,195 @@ +// +// 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.DevTestLabs +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Microsoft.Rest.Azure.OData; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// SharedGalleriesOperations operations. + /// + public partial interface ISharedGalleriesOperations + { + /// + /// List shared galleries in a given lab. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the lab. + /// + /// + /// OData parameters to apply to the operation. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> ListWithHttpMessagesAsync(string resourceGroupName, string labName, ODataQuery odataQuery = default(ODataQuery), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Get shared gallery. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the lab. + /// + /// + /// The name of the shared gallery. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> GetWithHttpMessagesAsync(string resourceGroupName, string labName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Create or replace an existing Shared Gallery. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the lab. + /// + /// + /// The name of the shared gallery. + /// + /// + /// Properties of a shared gallery + /// + /// + /// 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> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string labName, string name, SharedGallery sharedGallery, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Delete shared gallery. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the lab. + /// + /// + /// The name of the shared gallery. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task DeleteWithHttpMessagesAsync(string resourceGroupName, string labName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Allows modifying tags of shared galleries. All other properties + /// will be ignored. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the lab. + /// + /// + /// The name of the shared gallery. + /// + /// + /// Allows modifying tags of shared galleries. All other properties + /// will be ignored. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string labName, string name, SharedGalleryFragment sharedGallery, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// List shared galleries in a given lab. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/ISharedImagesOperations.cs b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/ISharedImagesOperations.cs new file mode 100644 index 000000000000..cded19b74d48 --- /dev/null +++ b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/ISharedImagesOperations.cs @@ -0,0 +1,213 @@ +// +// 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.DevTestLabs +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Microsoft.Rest.Azure.OData; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// SharedImagesOperations operations. + /// + public partial interface ISharedImagesOperations + { + /// + /// List shared images in a given shared gallery. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the lab. + /// + /// + /// The name of the shared gallery. + /// + /// + /// OData parameters to apply to the operation. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> ListWithHttpMessagesAsync(string resourceGroupName, string labName, string sharedGalleryName, ODataQuery odataQuery = default(ODataQuery), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Get shared image. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the lab. + /// + /// + /// The name of the shared gallery. + /// + /// + /// The name of the shared image. + /// + /// + /// Specify the $expand query. Example: 'properties($expand=versions)' + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> GetWithHttpMessagesAsync(string resourceGroupName, string labName, string sharedGalleryName, string name, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Create or replace an existing Shared Image. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the lab. + /// + /// + /// The name of the shared gallery. + /// + /// + /// The name of the shared image. + /// + /// + /// Properties of a shared image + /// + /// + /// 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> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string labName, string sharedGalleryName, string name, SharedImage sharedImage, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Delete shared image. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the lab. + /// + /// + /// The name of the shared gallery. + /// + /// + /// The name of the shared image. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task DeleteWithHttpMessagesAsync(string resourceGroupName, string labName, string sharedGalleryName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Allows modifying tags of shared images. All other properties will + /// be ignored. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the lab. + /// + /// + /// The name of the shared gallery. + /// + /// + /// The name of the shared image. + /// + /// + /// Allows modifying tags of shared images. All other properties will + /// be ignored. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string labName, string sharedGalleryName, string name, SharedImageFragment sharedImage, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// List shared images in a given shared gallery. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/IUsersOperations.cs b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/IUsersOperations.cs index 376f9a3b7e26..9dccada8fdd9 100644 --- a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/IUsersOperations.cs +++ b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/IUsersOperations.cs @@ -64,9 +64,6 @@ public partial interface IUsersOperations /// /// The name of the user profile. /// - /// - /// Specify the $expand query. Example: 'properties($select=identity)' - /// /// /// The headers that will be added to request. /// @@ -82,7 +79,7 @@ public partial interface IUsersOperations /// /// Thrown when a required parameter is null /// - Task> GetWithHttpMessagesAsync(string resourceGroupName, string labName, string name, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> GetWithHttpMessagesAsync(string resourceGroupName, string labName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Create or replace an existing user profile. This operation can take /// a while to complete. @@ -141,7 +138,8 @@ public partial interface IUsersOperations /// Task DeleteWithHttpMessagesAsync(string resourceGroupName, string labName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Modify properties of user profiles. + /// Allows modifying tags of user profiles. All other properties will + /// be ignored. /// /// /// The name of the resource group. @@ -153,7 +151,8 @@ public partial interface IUsersOperations /// The name of the user profile. /// /// - /// Profile of a lab user. + /// Allows modifying tags of user profiles. All other properties will + /// be ignored. /// /// /// The headers that will be added to request. diff --git a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/IVirtualMachineSchedulesOperations.cs b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/IVirtualMachineSchedulesOperations.cs index 8976e2e36d0b..6f445e717253 100644 --- a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/IVirtualMachineSchedulesOperations.cs +++ b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/IVirtualMachineSchedulesOperations.cs @@ -70,9 +70,6 @@ public partial interface IVirtualMachineSchedulesOperations /// /// The name of the schedule. /// - /// - /// Specify the $expand query. Example: 'properties($select=status)' - /// /// /// The headers that will be added to request. /// @@ -88,7 +85,7 @@ public partial interface IVirtualMachineSchedulesOperations /// /// Thrown when a required parameter is null /// - Task> GetWithHttpMessagesAsync(string resourceGroupName, string labName, string virtualMachineName, string name, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> GetWithHttpMessagesAsync(string resourceGroupName, string labName, string virtualMachineName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Create or replace an existing schedule. /// @@ -152,7 +149,8 @@ public partial interface IVirtualMachineSchedulesOperations /// Task DeleteWithHttpMessagesAsync(string resourceGroupName, string labName, string virtualMachineName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Modify properties of schedules. + /// Allows modifying tags of schedules. All other properties will be + /// ignored. /// /// /// The name of the resource group. @@ -167,7 +165,8 @@ public partial interface IVirtualMachineSchedulesOperations /// The name of the schedule. /// /// - /// A schedule. + /// Allows modifying tags of schedules. All other properties will be + /// ignored. /// /// /// The headers that will be added to request. diff --git a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/IVirtualMachinesOperations.cs b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/IVirtualMachinesOperations.cs index 495a0cbcbbe6..b36d074e0d21 100644 --- a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/IVirtualMachinesOperations.cs +++ b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/IVirtualMachinesOperations.cs @@ -143,7 +143,8 @@ public partial interface IVirtualMachinesOperations /// Task DeleteWithHttpMessagesAsync(string resourceGroupName, string labName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Modify properties of virtual machines. + /// Allows modifying tags of virtual machines. All other properties + /// will be ignored. /// /// /// The name of the resource group. @@ -155,7 +156,8 @@ public partial interface IVirtualMachinesOperations /// The name of the virtual machine. /// /// - /// A virtual machine. + /// Allows modifying tags of virtual machines. All other properties + /// will be ignored. /// /// /// The headers that will be added to request. @@ -259,6 +261,31 @@ public partial interface IVirtualMachinesOperations /// Task ClaimWithHttpMessagesAsync(string resourceGroupName, string labName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// + /// Clears the artifact results of the virtual machine. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the lab. + /// + /// + /// The name of the virtual machine. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task ClearArtifactResultsWithHttpMessagesAsync(string resourceGroupName, string labName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// /// Detach the specified disk from the virtual machine. This operation /// can take a while to complete. /// diff --git a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/IVirtualNetworksOperations.cs b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/IVirtualNetworksOperations.cs index 8a24a0dd1996..4529a1cc73e3 100644 --- a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/IVirtualNetworksOperations.cs +++ b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/IVirtualNetworksOperations.cs @@ -143,7 +143,8 @@ public partial interface IVirtualNetworksOperations /// Task DeleteWithHttpMessagesAsync(string resourceGroupName, string labName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Modify properties of virtual networks. + /// Allows modifying tags of virtual networks. All other properties + /// will be ignored. /// /// /// The name of the resource group. @@ -155,7 +156,8 @@ public partial interface IVirtualNetworksOperations /// The name of the virtual network. /// /// - /// A virtual network. + /// Allows modifying tags of virtual networks. All other properties + /// will be ignored. /// /// /// The headers that will be added to request. diff --git a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/LabSecretsOperations.cs b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/LabSecretsOperations.cs new file mode 100644 index 000000000000..0dafb9bf81b5 --- /dev/null +++ b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/LabSecretsOperations.cs @@ -0,0 +1,1340 @@ +// +// 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.DevTestLabs +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Microsoft.Rest.Azure.OData; + using Models; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + using System.Net; + using System.Net.Http; + using System.Threading; + using System.Threading.Tasks; + + /// + /// LabSecretsOperations operations. + /// + internal partial class LabSecretsOperations : IServiceOperations, ILabSecretsOperations + { + /// + /// Initializes a new instance of the LabSecretsOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal LabSecretsOperations(DevTestLabsClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the DevTestLabsClient + /// + public DevTestLabsClient Client { get; private set; } + + /// + /// List lab secrets in a given lab. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the lab. + /// + /// + /// OData parameters to apply to the 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>> ListWithHttpMessagesAsync(string resourceGroupName, string labName, ODataQuery odataQuery = default(ODataQuery), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (labName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "labName"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("odataQuery", odataQuery); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("labName", labName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/secrets").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{labName}", System.Uri.EscapeDataString(labName)); + List _queryParameters = new List(); + if (odataQuery != null) + { + var _odataFilter = odataQuery.ToString(); + if (!string.IsNullOrEmpty(_odataFilter)) + { + _queryParameters.Add(_odataFilter); + } + } + 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); + } + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + 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); + } + _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; + } + + /// + /// Get lab secret. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the lab. + /// + /// + /// The name of the lab secret. + /// + /// + /// 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> GetWithHttpMessagesAsync(string resourceGroupName, string labName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (labName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "labName"); + } + if (name == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "name"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("labName", labName); + tracingParameters.Add("name", name); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/secrets/{name}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{labName}", System.Uri.EscapeDataString(labName)); + _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + 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); + } + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + 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); + } + _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; + } + + /// + /// Create or replace an existing Lab Secret. This operation can take a while + /// to complete. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the lab. + /// + /// + /// The name of the lab secret. + /// + /// + /// A shared secret in a lab. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string labName, string name, LabSecret labSecret, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send Request + AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, labName, name, labSecret, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Delete lab secret. This operation can take a while to complete. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the lab. + /// + /// + /// The name of the lab secret. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string labName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, labName, name, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Allows modifying tags of lab secrets. All other properties will be ignored. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the lab. + /// + /// + /// The name of the lab secret. + /// + /// + /// Allows modifying tags of lab secrets. All other properties will be ignored. + /// + /// + /// 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> UpdateWithHttpMessagesAsync(string resourceGroupName, string labName, string name, SecretFragment secret, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (labName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "labName"); + } + if (name == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "name"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (secret == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "secret"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("labName", labName); + tracingParameters.Add("name", name); + tracingParameters.Add("secret", secret); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "Update", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/secrets/{name}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{labName}", System.Uri.EscapeDataString(labName)); + _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + 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("PATCH"); + _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; + if(secret != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(secret, Client.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 (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); + } + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + 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); + } + _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; + } + + /// + /// Create or replace an existing Lab Secret. This operation can take a while + /// to complete. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the lab. + /// + /// + /// The name of the lab secret. + /// + /// + /// A shared secret in a lab. + /// + /// + /// 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> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string labName, string name, LabSecret labSecret, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (labName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "labName"); + } + if (name == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "name"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (labSecret == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "labSecret"); + } + if (labSecret != null) + { + labSecret.Validate(); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("labName", labName); + tracingParameters.Add("name", name); + tracingParameters.Add("labSecret", labSecret); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/secrets/{name}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{labName}", System.Uri.EscapeDataString(labName)); + _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + 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("PUT"); + _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; + if(labSecret != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(labSecret, Client.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 (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); + } + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 201 && (int)_statusCode != 202) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + 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); + } + _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); + } + } + // 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); + } + return _result; + } + + /// + /// Delete lab secret. This operation can take a while to complete. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the lab. + /// + /// + /// The name of the lab secret. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string labName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (labName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "labName"); + } + if (name == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "name"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("labName", labName); + tracingParameters.Add("name", name); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/secrets/{name}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{labName}", System.Uri.EscapeDataString(labName)); + _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + 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("DELETE"); + _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); + } + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 204) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + 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); + } + _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(); + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// List lab secrets in a given lab. + /// + /// + /// 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>> ListNextWithHttpMessagesAsync(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, "ListNext", 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); + } + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + 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); + } + _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; + } + + } +} diff --git a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/LabSecretsOperationsExtensions.cs b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/LabSecretsOperationsExtensions.cs new file mode 100644 index 000000000000..dd201268a056 --- /dev/null +++ b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/LabSecretsOperationsExtensions.cs @@ -0,0 +1,398 @@ +// +// 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.DevTestLabs +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Microsoft.Rest.Azure.OData; + using Models; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for LabSecretsOperations. + /// + public static partial class LabSecretsOperationsExtensions + { + /// + /// List lab secrets in a given lab. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the lab. + /// + /// + /// OData parameters to apply to the operation. + /// + public static IPage List(this ILabSecretsOperations operations, string resourceGroupName, string labName, ODataQuery odataQuery = default(ODataQuery)) + { + return operations.ListAsync(resourceGroupName, labName, odataQuery).GetAwaiter().GetResult(); + } + + /// + /// List lab secrets in a given lab. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the lab. + /// + /// + /// OData parameters to apply to the operation. + /// + /// + /// The cancellation token. + /// + public static async Task> ListAsync(this ILabSecretsOperations operations, string resourceGroupName, string labName, ODataQuery odataQuery = default(ODataQuery), CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, labName, odataQuery, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Get lab secret. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the lab. + /// + /// + /// The name of the lab secret. + /// + public static LabSecret Get(this ILabSecretsOperations operations, string resourceGroupName, string labName, string name) + { + return operations.GetAsync(resourceGroupName, labName, name).GetAwaiter().GetResult(); + } + + /// + /// Get lab secret. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the lab. + /// + /// + /// The name of the lab secret. + /// + /// + /// The cancellation token. + /// + public static async Task GetAsync(this ILabSecretsOperations operations, string resourceGroupName, string labName, string name, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, labName, name, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Create or replace an existing Lab Secret. This operation can take a while + /// to complete. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the lab. + /// + /// + /// The name of the lab secret. + /// + /// + /// A shared secret in a lab. + /// + public static LabSecret CreateOrUpdate(this ILabSecretsOperations operations, string resourceGroupName, string labName, string name, LabSecret labSecret) + { + return operations.CreateOrUpdateAsync(resourceGroupName, labName, name, labSecret).GetAwaiter().GetResult(); + } + + /// + /// Create or replace an existing Lab Secret. This operation can take a while + /// to complete. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the lab. + /// + /// + /// The name of the lab secret. + /// + /// + /// A shared secret in a lab. + /// + /// + /// The cancellation token. + /// + public static async Task CreateOrUpdateAsync(this ILabSecretsOperations operations, string resourceGroupName, string labName, string name, LabSecret labSecret, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, labName, name, labSecret, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Delete lab secret. This operation can take a while to complete. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the lab. + /// + /// + /// The name of the lab secret. + /// + public static void Delete(this ILabSecretsOperations operations, string resourceGroupName, string labName, string name) + { + operations.DeleteAsync(resourceGroupName, labName, name).GetAwaiter().GetResult(); + } + + /// + /// Delete lab secret. This operation can take a while to complete. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the lab. + /// + /// + /// The name of the lab secret. + /// + /// + /// The cancellation token. + /// + public static async Task DeleteAsync(this ILabSecretsOperations operations, string resourceGroupName, string labName, string name, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, labName, name, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// Allows modifying tags of lab secrets. All other properties will be ignored. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the lab. + /// + /// + /// The name of the lab secret. + /// + /// + /// Allows modifying tags of lab secrets. All other properties will be ignored. + /// + public static LabSecret Update(this ILabSecretsOperations operations, string resourceGroupName, string labName, string name, SecretFragment secret) + { + return operations.UpdateAsync(resourceGroupName, labName, name, secret).GetAwaiter().GetResult(); + } + + /// + /// Allows modifying tags of lab secrets. All other properties will be ignored. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the lab. + /// + /// + /// The name of the lab secret. + /// + /// + /// Allows modifying tags of lab secrets. All other properties will be ignored. + /// + /// + /// The cancellation token. + /// + public static async Task UpdateAsync(this ILabSecretsOperations operations, string resourceGroupName, string labName, string name, SecretFragment secret, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.UpdateWithHttpMessagesAsync(resourceGroupName, labName, name, secret, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Create or replace an existing Lab Secret. This operation can take a while + /// to complete. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the lab. + /// + /// + /// The name of the lab secret. + /// + /// + /// A shared secret in a lab. + /// + public static LabSecret BeginCreateOrUpdate(this ILabSecretsOperations operations, string resourceGroupName, string labName, string name, LabSecret labSecret) + { + return operations.BeginCreateOrUpdateAsync(resourceGroupName, labName, name, labSecret).GetAwaiter().GetResult(); + } + + /// + /// Create or replace an existing Lab Secret. This operation can take a while + /// to complete. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the lab. + /// + /// + /// The name of the lab secret. + /// + /// + /// A shared secret in a lab. + /// + /// + /// The cancellation token. + /// + public static async Task BeginCreateOrUpdateAsync(this ILabSecretsOperations operations, string resourceGroupName, string labName, string name, LabSecret labSecret, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, labName, name, labSecret, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Delete lab secret. This operation can take a while to complete. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the lab. + /// + /// + /// The name of the lab secret. + /// + public static void BeginDelete(this ILabSecretsOperations operations, string resourceGroupName, string labName, string name) + { + operations.BeginDeleteAsync(resourceGroupName, labName, name).GetAwaiter().GetResult(); + } + + /// + /// Delete lab secret. This operation can take a while to complete. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the lab. + /// + /// + /// The name of the lab secret. + /// + /// + /// The cancellation token. + /// + public static async Task BeginDeleteAsync(this ILabSecretsOperations operations, string resourceGroupName, string labName, string name, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, labName, name, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// List lab secrets in a given lab. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage ListNext(this ILabSecretsOperations operations, string nextPageLink) + { + return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// List lab secrets in a given lab. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async Task> ListNextAsync(this ILabSecretsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +} diff --git a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/LabsOperations.cs b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/LabsOperations.cs index 6eae66d5ed00..9ee75c6fe6c4 100644 --- a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/LabsOperations.cs +++ b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/LabsOperations.cs @@ -449,10 +449,6 @@ internal LabsOperations(DevTestLabsClient client) /// /// The name of the lab. /// - /// - /// Specify the $expand query. Example: - /// 'properties($select=defaultStorageAccount)' - /// /// /// Headers that will be added to request. /// @@ -474,7 +470,7 @@ internal LabsOperations(DevTestLabsClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string name, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (Client.SubscriptionId == null) { @@ -501,7 +497,6 @@ internal LabsOperations(DevTestLabsClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("expand", expand); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } @@ -512,10 +507,6 @@ internal LabsOperations(DevTestLabsClient client) _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); List _queryParameters = new List(); - if (expand != null) - { - _queryParameters.Add(string.Format("$expand={0}", System.Uri.EscapeDataString(expand))); - } if (Client.ApiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); @@ -694,7 +685,7 @@ internal LabsOperations(DevTestLabsClient client) } /// - /// Modify properties of labs. + /// Allows modifying tags of labs. All other properties will be ignored. /// /// /// The name of the resource group. @@ -703,7 +694,7 @@ internal LabsOperations(DevTestLabsClient client) /// The name of the lab. /// /// - /// A lab. + /// Allows modifying tags of labs. All other properties will be ignored. /// /// /// Headers that will be added to request. @@ -952,6 +943,181 @@ internal LabsOperations(DevTestLabsClient client) return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } + /// + /// Ensure the current user has a valid profile in the lab. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the lab. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task EnsureCurrentUserProfileWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (name == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "name"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("name", name); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "EnsureCurrentUserProfile", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{name}/ensureCurrentUserProfile").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + 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("POST"); + _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); + } + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + 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); + } + _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(); + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + /// /// Exports the lab resource usage into a storage account This operation can /// take a while to complete. @@ -1463,6 +1629,10 @@ internal LabsOperations(DevTestLabsClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "lab"); } + if (lab != null) + { + lab.Validate(); + } if (Client.ApiVersion == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); @@ -1555,7 +1725,7 @@ internal LabsOperations(DevTestLabsClient client) System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 201) + if ((int)_statusCode != 200 && (int)_statusCode != 201 && (int)_statusCode != 202) { var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -2040,6 +2210,10 @@ internal LabsOperations(DevTestLabsClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "labVirtualMachineCreationParameter"); } + if (labVirtualMachineCreationParameter != null) + { + labVirtualMachineCreationParameter.Validate(); + } if (Client.ApiVersion == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); diff --git a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/LabsOperationsExtensions.cs b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/LabsOperationsExtensions.cs index b3a79f39d9f2..aa638aef56f0 100644 --- a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/LabsOperationsExtensions.cs +++ b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/LabsOperationsExtensions.cs @@ -108,13 +108,9 @@ public static partial class LabsOperationsExtensions /// /// The name of the lab. /// - /// - /// Specify the $expand query. Example: - /// 'properties($select=defaultStorageAccount)' - /// - public static Lab Get(this ILabsOperations operations, string resourceGroupName, string name, string expand = default(string)) + public static Lab Get(this ILabsOperations operations, string resourceGroupName, string name) { - return operations.GetAsync(resourceGroupName, name, expand).GetAwaiter().GetResult(); + return operations.GetAsync(resourceGroupName, name).GetAwaiter().GetResult(); } /// @@ -129,16 +125,12 @@ public static partial class LabsOperationsExtensions /// /// The name of the lab. /// - /// - /// Specify the $expand query. Example: - /// 'properties($select=defaultStorageAccount)' - /// /// /// The cancellation token. /// - public static async Task GetAsync(this ILabsOperations operations, string resourceGroupName, string name, string expand = default(string), CancellationToken cancellationToken = default(CancellationToken)) + public static async Task GetAsync(this ILabsOperations operations, string resourceGroupName, string name, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, name, expand, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, name, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } @@ -230,7 +222,7 @@ public static void Delete(this ILabsOperations operations, string resourceGroupN } /// - /// Modify properties of labs. + /// Allows modifying tags of labs. All other properties will be ignored. /// /// /// The operations group for this extension method. @@ -242,7 +234,7 @@ public static void Delete(this ILabsOperations operations, string resourceGroupN /// The name of the lab. /// /// - /// A lab. + /// Allows modifying tags of labs. All other properties will be ignored. /// public static Lab Update(this ILabsOperations operations, string resourceGroupName, string name, LabFragment lab) { @@ -250,7 +242,7 @@ public static Lab Update(this ILabsOperations operations, string resourceGroupNa } /// - /// Modify properties of labs. + /// Allows modifying tags of labs. All other properties will be ignored. /// /// /// The operations group for this extension method. @@ -262,7 +254,7 @@ public static Lab Update(this ILabsOperations operations, string resourceGroupNa /// The name of the lab. /// /// - /// A lab. + /// Allows modifying tags of labs. All other properties will be ignored. /// /// /// The cancellation token. @@ -359,6 +351,43 @@ public static void CreateEnvironment(this ILabsOperations operations, string res (await operations.CreateEnvironmentWithHttpMessagesAsync(resourceGroupName, name, labVirtualMachineCreationParameter, null, cancellationToken).ConfigureAwait(false)).Dispose(); } + /// + /// Ensure the current user has a valid profile in the lab. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the lab. + /// + public static void EnsureCurrentUserProfile(this ILabsOperations operations, string resourceGroupName, string name) + { + operations.EnsureCurrentUserProfileAsync(resourceGroupName, name).GetAwaiter().GetResult(); + } + + /// + /// Ensure the current user has a valid profile in the lab. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the lab. + /// + /// + /// The cancellation token. + /// + public static async Task EnsureCurrentUserProfileAsync(this ILabsOperations operations, string resourceGroupName, string name, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.EnsureCurrentUserProfileWithHttpMessagesAsync(resourceGroupName, name, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// /// Exports the lab resource usage into a storage account This operation can /// take a while to complete. diff --git a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/ActionType.cs b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/ActionType.cs new file mode 100644 index 000000000000..8367dda6ae51 --- /dev/null +++ b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/ActionType.cs @@ -0,0 +1,21 @@ +// +// 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.DevTestLabs.Models +{ + + /// + /// Defines values for ActionType. + /// + public static class ActionType + { + public const string Internal = "Internal"; + } +} diff --git a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/ApplicableSchedule.cs b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/ApplicableSchedule.cs index c8b5d196a75e..acbf08c12212 100644 --- a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/ApplicableSchedule.cs +++ b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/ApplicableSchedule.cs @@ -11,7 +11,6 @@ namespace Microsoft.Azure.Management.DevTestLabs.Models { using Microsoft.Rest; - using Microsoft.Rest.Serialization; using Newtonsoft.Json; using System.Collections; using System.Collections.Generic; @@ -21,8 +20,7 @@ namespace Microsoft.Azure.Management.DevTestLabs.Models /// Schedules applicable to a virtual machine. The schedules may have been /// defined on a VM or on lab level. /// - [Rest.Serialization.JsonTransformation] - public partial class ApplicableSchedule : Resource + public partial class ApplicableSchedule : Tags { /// /// Initializes a new instance of the ApplicableSchedule class. @@ -35,20 +33,15 @@ public ApplicableSchedule() /// /// Initializes a new instance of the ApplicableSchedule class. /// - /// The identifier of the resource. - /// The name of the resource. - /// The type of the resource. - /// The location of the resource. - /// The tags of the resource. - /// The auto-shutdown schedule, if one has - /// been set at the lab or lab resource level. - /// The auto-startup schedule, if one has - /// been set at the lab or lab resource level. - public ApplicableSchedule(string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), Schedule labVmsShutdown = default(Schedule), Schedule labVmsStartup = default(Schedule)) - : base(id, name, type, location, tags) + /// The properties of the resource. + /// Resource tags + /// The system metadata relating to this + /// resource + public ApplicableSchedule(ApplicableScheduleProperties properties, IDictionary tagsProperty = default(IDictionary), SystemData systemData = default(SystemData)) + : base(tagsProperty) { - LabVmsShutdown = labVmsShutdown; - LabVmsStartup = labVmsStartup; + Properties = properties; + SystemData = systemData; CustomInit(); } @@ -58,18 +51,33 @@ public ApplicableSchedule() partial void CustomInit(); /// - /// Gets or sets the auto-shutdown schedule, if one has been set at the - /// lab or lab resource level. + /// Gets or sets the properties of the resource. /// - [JsonProperty(PropertyName = "properties.labVmsShutdown")] - public Schedule LabVmsShutdown { get; set; } + [JsonProperty(PropertyName = "properties")] + public ApplicableScheduleProperties Properties { get; set; } /// - /// Gets or sets the auto-startup schedule, if one has been set at the - /// lab or lab resource level. + /// Gets the system metadata relating to this resource /// - [JsonProperty(PropertyName = "properties.labVmsStartup")] - public Schedule LabVmsStartup { get; set; } + [JsonProperty(PropertyName = "systemData")] + public SystemData SystemData { get; private set; } + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (Properties == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Properties"); + } + if (Properties != null) + { + Properties.Validate(); + } + } } } diff --git a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/ApplicableScheduleFragment.cs b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/ApplicableScheduleFragment.cs deleted file mode 100644 index e456a95130d5..000000000000 --- a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/ApplicableScheduleFragment.cs +++ /dev/null @@ -1,71 +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.DevTestLabs.Models -{ - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - - /// - /// Schedules applicable to a virtual machine. The schedules may have been - /// defined on a VM or on lab level. - /// - [Rest.Serialization.JsonTransformation] - public partial class ApplicableScheduleFragment : UpdateResource - { - /// - /// Initializes a new instance of the ApplicableScheduleFragment class. - /// - public ApplicableScheduleFragment() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the ApplicableScheduleFragment class. - /// - /// The tags of the resource. - /// The auto-shutdown schedule, if one has - /// been set at the lab or lab resource level. - /// The auto-startup schedule, if one has - /// been set at the lab or lab resource level. - public ApplicableScheduleFragment(IDictionary tags = default(IDictionary), ScheduleFragment labVmsShutdown = default(ScheduleFragment), ScheduleFragment labVmsStartup = default(ScheduleFragment)) - : base(tags) - { - LabVmsShutdown = labVmsShutdown; - LabVmsStartup = labVmsStartup; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the auto-shutdown schedule, if one has been set at the - /// lab or lab resource level. - /// - [JsonProperty(PropertyName = "properties.labVmsShutdown")] - public ScheduleFragment LabVmsShutdown { get; set; } - - /// - /// Gets or sets the auto-startup schedule, if one has been set at the - /// lab or lab resource level. - /// - [JsonProperty(PropertyName = "properties.labVmsStartup")] - public ScheduleFragment LabVmsStartup { get; set; } - - } -} diff --git a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/ArmTemplate.cs b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/ArmTemplate.cs index 2c7de5897125..a394a7a30d28 100644 --- a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/ArmTemplate.cs +++ b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/ArmTemplate.cs @@ -34,11 +34,12 @@ public ArmTemplate() /// /// Initializes a new instance of the ArmTemplate class. /// - /// The identifier of the resource. - /// The name of the resource. - /// The type of the resource. - /// The location of the resource. - /// The tags of the resource. + /// Fully qualified resource ID for the resource. Ex - + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + /// The name of the resource + /// The type of the resource. E.g. + /// "Microsoft.Compute/virtualMachines" or + /// "Microsoft.Storage/storageAccounts" /// The display name of the ARM /// template. /// The description of the ARM @@ -53,8 +54,10 @@ public ArmTemplate() /// ARM template. /// Whether or not ARM template is enabled for /// use by lab user. - public ArmTemplate(string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), string displayName = default(string), string description = default(string), string publisher = default(string), string icon = default(string), object contents = default(object), System.DateTime? createdDate = default(System.DateTime?), IList parametersValueFilesInfo = default(IList), bool? enabled = default(bool?)) - : base(id, name, type, location, tags) + /// The system metadata relating to this + /// resource + public ArmTemplate(string id = default(string), string name = default(string), string type = default(string), string displayName = default(string), string description = default(string), string publisher = default(string), string icon = default(string), object contents = default(object), System.DateTime? createdDate = default(System.DateTime?), IList parametersValueFilesInfo = default(IList), bool? enabled = default(bool?), SystemData systemData = default(SystemData)) + : base(id, name, type) { DisplayName = displayName; Description = description; @@ -64,6 +67,7 @@ public ArmTemplate() CreatedDate = createdDate; ParametersValueFilesInfo = parametersValueFilesInfo; Enabled = enabled; + SystemData = systemData; CustomInit(); } @@ -121,5 +125,11 @@ public ArmTemplate() [JsonProperty(PropertyName = "properties.enabled")] public bool? Enabled { get; private set; } + /// + /// Gets the system metadata relating to this resource + /// + [JsonProperty(PropertyName = "systemData")] + public SystemData SystemData { get; private set; } + } } diff --git a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/ArmTemplateParameterPropertiesFragment.cs b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/ArmTemplateParameterPropertiesFragment.cs deleted file mode 100644 index 404902a83d4c..000000000000 --- a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/ArmTemplateParameterPropertiesFragment.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.DevTestLabs.Models -{ - using Newtonsoft.Json; - using System.Linq; - - /// - /// Properties of an Azure Resource Manager template parameter. - /// - public partial class ArmTemplateParameterPropertiesFragment - { - /// - /// Initializes a new instance of the - /// ArmTemplateParameterPropertiesFragment class. - /// - public ArmTemplateParameterPropertiesFragment() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the - /// ArmTemplateParameterPropertiesFragment class. - /// - /// The name of the template parameter. - /// The value of the template parameter. - public ArmTemplateParameterPropertiesFragment(string name = default(string), string value = default(string)) - { - Name = name; - Value = value; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the name of the template parameter. - /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } - - /// - /// Gets or sets the value of the template parameter. - /// - [JsonProperty(PropertyName = "value")] - public string Value { get; set; } - - } -} diff --git a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/Artifact.cs b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/Artifact.cs index 348308a7d0f9..c5a0fbf63675 100644 --- a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/Artifact.cs +++ b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/Artifact.cs @@ -13,8 +13,6 @@ namespace Microsoft.Azure.Management.DevTestLabs.Models using Microsoft.Rest; using Microsoft.Rest.Serialization; using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -34,11 +32,12 @@ public Artifact() /// /// Initializes a new instance of the Artifact class. /// - /// The identifier of the resource. - /// The name of the resource. - /// The type of the resource. - /// The location of the resource. - /// The tags of the resource. + /// Fully qualified resource ID for the resource. Ex - + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + /// The name of the resource + /// The type of the resource. E.g. + /// "Microsoft.Compute/virtualMachines" or + /// "Microsoft.Storage/storageAccounts" /// The artifact's title. /// The artifact's description. /// The artifact's publisher. @@ -47,8 +46,10 @@ public Artifact() /// The artifact's target OS. /// The artifact's parameters. /// The artifact's creation date. - public Artifact(string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), string title = default(string), string description = default(string), string publisher = default(string), string filePath = default(string), string icon = default(string), string targetOsType = default(string), object parameters = default(object), System.DateTime? createdDate = default(System.DateTime?)) - : base(id, name, type, location, tags) + /// The system metadata relating to this + /// resource + public Artifact(string id = default(string), string name = default(string), string type = default(string), string title = default(string), string description = default(string), string publisher = default(string), string filePath = default(string), string icon = default(string), string targetOsType = default(string), object parameters = default(object), System.DateTime? createdDate = default(System.DateTime?), SystemData systemData = default(SystemData)) + : base(id, name, type) { Title = title; Description = description; @@ -58,6 +59,7 @@ public Artifact() TargetOsType = targetOsType; Parameters = parameters; CreatedDate = createdDate; + SystemData = systemData; CustomInit(); } @@ -114,5 +116,11 @@ public Artifact() [JsonProperty(PropertyName = "properties.createdDate")] public System.DateTime? CreatedDate { get; private set; } + /// + /// Gets the system metadata relating to this resource + /// + [JsonProperty(PropertyName = "systemData")] + public SystemData SystemData { get; private set; } + } } diff --git a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/ArtifactDeploymentStatusProperties.cs b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/ArtifactDeploymentStatusProperties.cs deleted file mode 100644 index 608decf38634..000000000000 --- a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/ArtifactDeploymentStatusProperties.cs +++ /dev/null @@ -1,74 +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.DevTestLabs.Models -{ - using Newtonsoft.Json; - using System.Linq; - - /// - /// Properties of an artifact deployment. - /// - public partial class ArtifactDeploymentStatusProperties - { - /// - /// Initializes a new instance of the - /// ArtifactDeploymentStatusProperties class. - /// - public ArtifactDeploymentStatusProperties() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the - /// ArtifactDeploymentStatusProperties class. - /// - /// The deployment status of the - /// artifact. - /// The total count of the artifacts - /// that were successfully applied. - /// The total count of the artifacts that - /// were tentatively applied. - public ArtifactDeploymentStatusProperties(string deploymentStatus = default(string), int? artifactsApplied = default(int?), int? totalArtifacts = default(int?)) - { - DeploymentStatus = deploymentStatus; - ArtifactsApplied = artifactsApplied; - TotalArtifacts = totalArtifacts; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the deployment status of the artifact. - /// - [JsonProperty(PropertyName = "deploymentStatus")] - public string DeploymentStatus { get; set; } - - /// - /// Gets or sets the total count of the artifacts that were - /// successfully applied. - /// - [JsonProperty(PropertyName = "artifactsApplied")] - public int? ArtifactsApplied { get; set; } - - /// - /// Gets or sets the total count of the artifacts that were tentatively - /// applied. - /// - [JsonProperty(PropertyName = "totalArtifacts")] - public int? TotalArtifacts { get; set; } - - } -} diff --git a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/ArtifactDeploymentStatusPropertiesFragment.cs b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/ArtifactDeploymentStatusPropertiesFragment.cs deleted file mode 100644 index 6e4e03c72765..000000000000 --- a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/ArtifactDeploymentStatusPropertiesFragment.cs +++ /dev/null @@ -1,74 +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.DevTestLabs.Models -{ - using Newtonsoft.Json; - using System.Linq; - - /// - /// Properties of an artifact deployment. - /// - public partial class ArtifactDeploymentStatusPropertiesFragment - { - /// - /// Initializes a new instance of the - /// ArtifactDeploymentStatusPropertiesFragment class. - /// - public ArtifactDeploymentStatusPropertiesFragment() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the - /// ArtifactDeploymentStatusPropertiesFragment class. - /// - /// The deployment status of the - /// artifact. - /// The total count of the artifacts - /// that were successfully applied. - /// The total count of the artifacts that - /// were tentatively applied. - public ArtifactDeploymentStatusPropertiesFragment(string deploymentStatus = default(string), int? artifactsApplied = default(int?), int? totalArtifacts = default(int?)) - { - DeploymentStatus = deploymentStatus; - ArtifactsApplied = artifactsApplied; - TotalArtifacts = totalArtifacts; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the deployment status of the artifact. - /// - [JsonProperty(PropertyName = "deploymentStatus")] - public string DeploymentStatus { get; set; } - - /// - /// Gets or sets the total count of the artifacts that were - /// successfully applied. - /// - [JsonProperty(PropertyName = "artifactsApplied")] - public int? ArtifactsApplied { get; set; } - - /// - /// Gets or sets the total count of the artifacts that were tentatively - /// applied. - /// - [JsonProperty(PropertyName = "totalArtifacts")] - public int? TotalArtifacts { get; set; } - - } -} diff --git a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/ArtifactInstallPropertiesFragment.cs b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/ArtifactInstallPropertiesFragment.cs deleted file mode 100644 index 8968c44e8fb3..000000000000 --- a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/ArtifactInstallPropertiesFragment.cs +++ /dev/null @@ -1,107 +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.DevTestLabs.Models -{ - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - - /// - /// Properties of an artifact. - /// - public partial class ArtifactInstallPropertiesFragment - { - /// - /// Initializes a new instance of the ArtifactInstallPropertiesFragment - /// class. - /// - public ArtifactInstallPropertiesFragment() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the ArtifactInstallPropertiesFragment - /// class. - /// - /// The artifact's identifier. - /// The artifact's title. - /// The parameters of the artifact. - /// The status of the artifact. - /// The status message from the - /// deployment. - /// The status message from the - /// virtual machine extension. - /// The time that the artifact starts to - /// install on the virtual machine. - public ArtifactInstallPropertiesFragment(string artifactId = default(string), string artifactTitle = default(string), IList parameters = default(IList), string status = default(string), string deploymentStatusMessage = default(string), string vmExtensionStatusMessage = default(string), System.DateTime? installTime = default(System.DateTime?)) - { - ArtifactId = artifactId; - ArtifactTitle = artifactTitle; - Parameters = parameters; - Status = status; - DeploymentStatusMessage = deploymentStatusMessage; - VmExtensionStatusMessage = vmExtensionStatusMessage; - InstallTime = installTime; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the artifact's identifier. - /// - [JsonProperty(PropertyName = "artifactId")] - public string ArtifactId { get; set; } - - /// - /// Gets or sets the artifact's title. - /// - [JsonProperty(PropertyName = "artifactTitle")] - public string ArtifactTitle { get; set; } - - /// - /// Gets or sets the parameters of the artifact. - /// - [JsonProperty(PropertyName = "parameters")] - public IList Parameters { get; set; } - - /// - /// Gets or sets the status of the artifact. - /// - [JsonProperty(PropertyName = "status")] - public string Status { get; set; } - - /// - /// Gets or sets the status message from the deployment. - /// - [JsonProperty(PropertyName = "deploymentStatusMessage")] - public string DeploymentStatusMessage { get; set; } - - /// - /// Gets or sets the status message from the virtual machine extension. - /// - [JsonProperty(PropertyName = "vmExtensionStatusMessage")] - public string VmExtensionStatusMessage { get; set; } - - /// - /// Gets or sets the time that the artifact starts to install on the - /// virtual machine. - /// - [JsonProperty(PropertyName = "installTime")] - public System.DateTime? InstallTime { get; set; } - - } -} diff --git a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/ArtifactSource.cs b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/ArtifactSource.cs index 85b0622e561a..50a9700b6af9 100644 --- a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/ArtifactSource.cs +++ b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/ArtifactSource.cs @@ -21,7 +21,7 @@ namespace Microsoft.Azure.Management.DevTestLabs.Models /// Properties of an artifact source. /// [Rest.Serialization.JsonTransformation] - public partial class ArtifactSource : Resource + public partial class ArtifactSource : TrackedResource { /// /// Initializes a new instance of the ArtifactSource class. @@ -34,16 +34,20 @@ public ArtifactSource() /// /// Initializes a new instance of the ArtifactSource class. /// - /// The identifier of the resource. - /// The name of the resource. - /// The type of the resource. - /// The location of the resource. - /// The tags of the resource. + /// The geo-location where the resource + /// lives + /// Fully qualified resource ID for the resource. Ex - + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + /// The name of the resource + /// The type of the resource. E.g. + /// "Microsoft.Compute/virtualMachines" or + /// "Microsoft.Storage/storageAccounts" + /// Resource tags. /// The artifact source's display /// name. /// The artifact source's URI. /// The artifact source's type. Possible - /// values include: 'VsoGit', 'GitHub' + /// values include: 'VsoGit', 'GitHub', 'StorageAccount' /// The folder containing artifacts. /// The folder containing Azure /// Resource Manager templates. @@ -60,8 +64,10 @@ public ArtifactSource() /// resource. /// The unique immutable identifier of a /// resource (Guid). - public ArtifactSource(string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), string displayName = default(string), string uri = default(string), string sourceType = default(string), string folderPath = default(string), string armTemplateFolderPath = default(string), string branchRef = default(string), string securityToken = default(string), string status = default(string), System.DateTime? createdDate = default(System.DateTime?), string provisioningState = default(string), string uniqueIdentifier = default(string)) - : base(id, name, type, location, tags) + /// The system metadata relating to this + /// resource + public ArtifactSource(string location, string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), string displayName = default(string), string uri = default(string), string sourceType = default(string), string folderPath = default(string), string armTemplateFolderPath = default(string), string branchRef = default(string), string securityToken = default(string), string status = default(string), System.DateTime? createdDate = default(System.DateTime?), string provisioningState = default(string), string uniqueIdentifier = default(string), SystemData systemData = default(SystemData)) + : base(location, id, name, type, tags) { DisplayName = displayName; Uri = uri; @@ -74,6 +80,7 @@ public ArtifactSource() CreatedDate = createdDate; ProvisioningState = provisioningState; UniqueIdentifier = uniqueIdentifier; + SystemData = systemData; CustomInit(); } @@ -96,7 +103,7 @@ public ArtifactSource() /// /// Gets or sets the artifact source's type. Possible values include: - /// 'VsoGit', 'GitHub' + /// 'VsoGit', 'GitHub', 'StorageAccount' /// [JsonProperty(PropertyName = "properties.sourceType")] public string SourceType { get; set; } @@ -152,5 +159,21 @@ public ArtifactSource() [JsonProperty(PropertyName = "properties.uniqueIdentifier")] public string UniqueIdentifier { get; private set; } + /// + /// Gets the system metadata relating to this resource + /// + [JsonProperty(PropertyName = "systemData")] + public SystemData SystemData { get; private set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public override void Validate() + { + base.Validate(); + } } } diff --git a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/ArtifactSourceFragment.cs b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/ArtifactSourceFragment.cs index 4a7bd416782d..b27ab3a8859f 100644 --- a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/ArtifactSourceFragment.cs +++ b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/ArtifactSourceFragment.cs @@ -10,18 +10,14 @@ namespace Microsoft.Azure.Management.DevTestLabs.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; using System.Collections; using System.Collections.Generic; using System.Linq; /// - /// Properties of an artifact source. + /// Patch /// - [Rest.Serialization.JsonTransformation] - public partial class ArtifactSourceFragment : UpdateResource + public partial class ArtifactSourceFragment : Tags { /// /// Initializes a new instance of the ArtifactSourceFragment class. @@ -34,33 +30,10 @@ public ArtifactSourceFragment() /// /// Initializes a new instance of the ArtifactSourceFragment class. /// - /// The tags of the resource. - /// The artifact source's display - /// name. - /// The artifact source's URI. - /// The artifact source's type. Possible - /// values include: 'VsoGit', 'GitHub' - /// The folder containing artifacts. - /// The folder containing Azure - /// Resource Manager templates. - /// The artifact source's branch - /// reference. - /// The security token to authenticate to - /// the artifact source. - /// Indicates if the artifact source is enabled - /// (values: Enabled, Disabled). Possible values include: 'Enabled', - /// 'Disabled' - public ArtifactSourceFragment(IDictionary tags = default(IDictionary), string displayName = default(string), string uri = default(string), string sourceType = default(string), string folderPath = default(string), string armTemplateFolderPath = default(string), string branchRef = default(string), string securityToken = default(string), string status = default(string)) - : base(tags) + /// Resource tags + public ArtifactSourceFragment(IDictionary tagsProperty = default(IDictionary)) + : base(tagsProperty) { - DisplayName = displayName; - Uri = uri; - SourceType = sourceType; - FolderPath = folderPath; - ArmTemplateFolderPath = armTemplateFolderPath; - BranchRef = branchRef; - SecurityToken = securityToken; - Status = status; CustomInit(); } @@ -69,57 +42,5 @@ public ArtifactSourceFragment() /// partial void CustomInit(); - /// - /// Gets or sets the artifact source's display name. - /// - [JsonProperty(PropertyName = "properties.displayName")] - public string DisplayName { get; set; } - - /// - /// Gets or sets the artifact source's URI. - /// - [JsonProperty(PropertyName = "properties.uri")] - public string Uri { get; set; } - - /// - /// Gets or sets the artifact source's type. Possible values include: - /// 'VsoGit', 'GitHub' - /// - [JsonProperty(PropertyName = "properties.sourceType")] - public string SourceType { get; set; } - - /// - /// Gets or sets the folder containing artifacts. - /// - [JsonProperty(PropertyName = "properties.folderPath")] - public string FolderPath { get; set; } - - /// - /// Gets or sets the folder containing Azure Resource Manager - /// templates. - /// - [JsonProperty(PropertyName = "properties.armTemplateFolderPath")] - public string ArmTemplateFolderPath { get; set; } - - /// - /// Gets or sets the artifact source's branch reference. - /// - [JsonProperty(PropertyName = "properties.branchRef")] - public string BranchRef { get; set; } - - /// - /// Gets or sets the security token to authenticate to the artifact - /// source. - /// - [JsonProperty(PropertyName = "properties.securityToken")] - public string SecurityToken { get; set; } - - /// - /// Gets or sets indicates if the artifact source is enabled (values: - /// Enabled, Disabled). Possible values include: 'Enabled', 'Disabled' - /// - [JsonProperty(PropertyName = "properties.status")] - public string Status { get; set; } - } } diff --git a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/AttachNewDataDiskOptions.cs b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/AttachNewDataDiskOptions.cs deleted file mode 100644 index f2e0d234a8b7..000000000000 --- a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/AttachNewDataDiskOptions.cs +++ /dev/null @@ -1,71 +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.DevTestLabs.Models -{ - using Newtonsoft.Json; - using System.Linq; - - /// - /// Properties to attach new disk to the Virtual Machine. - /// - public partial class AttachNewDataDiskOptions - { - /// - /// Initializes a new instance of the AttachNewDataDiskOptions class. - /// - public AttachNewDataDiskOptions() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the AttachNewDataDiskOptions class. - /// - /// Size of the disk to be attached in - /// GibiBytes. - /// The name of the disk to be attached. - /// The storage type for the disk (i.e. - /// Standard, Premium). Possible values include: 'Standard', - /// 'Premium' - public AttachNewDataDiskOptions(int? diskSizeGiB = default(int?), string diskName = default(string), string diskType = default(string)) - { - DiskSizeGiB = diskSizeGiB; - DiskName = diskName; - DiskType = diskType; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets size of the disk to be attached in GibiBytes. - /// - [JsonProperty(PropertyName = "diskSizeGiB")] - public int? DiskSizeGiB { get; set; } - - /// - /// Gets or sets the name of the disk to be attached. - /// - [JsonProperty(PropertyName = "diskName")] - public string DiskName { get; set; } - - /// - /// Gets or sets the storage type for the disk (i.e. Standard, - /// Premium). Possible values include: 'Standard', 'Premium' - /// - [JsonProperty(PropertyName = "diskType")] - public string DiskType { get; set; } - - } -} diff --git a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/AttachNewDataDiskOptionsFragment.cs b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/AttachNewDataDiskOptionsFragment.cs deleted file mode 100644 index 33926cf4fa1e..000000000000 --- a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/AttachNewDataDiskOptionsFragment.cs +++ /dev/null @@ -1,73 +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.DevTestLabs.Models -{ - using Newtonsoft.Json; - using System.Linq; - - /// - /// Properties to attach new disk to the Virtual Machine. - /// - public partial class AttachNewDataDiskOptionsFragment - { - /// - /// Initializes a new instance of the AttachNewDataDiskOptionsFragment - /// class. - /// - public AttachNewDataDiskOptionsFragment() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the AttachNewDataDiskOptionsFragment - /// class. - /// - /// Size of the disk to be attached in - /// GibiBytes. - /// The name of the disk to be attached. - /// The storage type for the disk (i.e. - /// Standard, Premium). Possible values include: 'Standard', - /// 'Premium' - public AttachNewDataDiskOptionsFragment(int? diskSizeGiB = default(int?), string diskName = default(string), string diskType = default(string)) - { - DiskSizeGiB = diskSizeGiB; - DiskName = diskName; - DiskType = diskType; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets size of the disk to be attached in GibiBytes. - /// - [JsonProperty(PropertyName = "diskSizeGiB")] - public int? DiskSizeGiB { get; set; } - - /// - /// Gets or sets the name of the disk to be attached. - /// - [JsonProperty(PropertyName = "diskName")] - public string DiskName { get; set; } - - /// - /// Gets or sets the storage type for the disk (i.e. Standard, - /// Premium). Possible values include: 'Standard', 'Premium' - /// - [JsonProperty(PropertyName = "diskType")] - public string DiskType { get; set; } - - } -} diff --git a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/AzureEntityResource.cs b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/AzureEntityResource.cs new file mode 100644 index 000000000000..1a7a563b48a2 --- /dev/null +++ b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/AzureEntityResource.cs @@ -0,0 +1,62 @@ +// +// 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.DevTestLabs.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Entity Resource + /// + /// + /// The resource model definition for an Azure Resource Manager resource + /// with an etag. + /// + public partial class AzureEntityResource : Resource + { + /// + /// Initializes a new instance of the AzureEntityResource class. + /// + public AzureEntityResource() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the AzureEntityResource class. + /// + /// Fully qualified resource ID for the resource. Ex - + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + /// The name of the resource + /// The type of the resource. E.g. + /// "Microsoft.Compute/virtualMachines" or + /// "Microsoft.Storage/storageAccounts" + /// Resource Etag. + public AzureEntityResource(string id = default(string), string name = default(string), string type = default(string), string etag = default(string)) + : base(id, name, type) + { + Etag = etag; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets resource Etag. + /// + [JsonProperty(PropertyName = "etag")] + public string Etag { get; private set; } + + } +} diff --git a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/BastionHost.cs b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/BastionHost.cs new file mode 100644 index 000000000000..e35916d88b5b --- /dev/null +++ b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/BastionHost.cs @@ -0,0 +1,116 @@ +// +// 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.DevTestLabs.Models +{ + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Profile of a Bastion Host + /// + [Rest.Serialization.JsonTransformation] + public partial class BastionHost : TrackedResource + { + /// + /// Initializes a new instance of the BastionHost class. + /// + public BastionHost() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the BastionHost class. + /// + /// The geo-location where the resource + /// lives + /// Fully qualified resource ID for the resource. Ex - + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + /// The name of the resource + /// The type of the resource. E.g. + /// "Microsoft.Compute/virtualMachines" or + /// "Microsoft.Storage/storageAccounts" + /// Resource tags. + /// The ID of the external + /// BastionHost resource that corresponds to this DTL + /// BastionHost + /// The ID of the PublicIpAddress resource + /// that is created by and paired with this BastionHost + /// The provisioning status of the + /// resource. + /// The unique immutable identifier of a + /// resource (Guid). + /// The system metadata relating to this + /// resource + public BastionHost(string location, string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), string externalBastionHostId = default(string), string ipAddressId = default(string), string provisioningState = default(string), string uniqueIdentifier = default(string), SystemData systemData = default(SystemData)) + : base(location, id, name, type, tags) + { + ExternalBastionHostId = externalBastionHostId; + IpAddressId = ipAddressId; + ProvisioningState = provisioningState; + UniqueIdentifier = uniqueIdentifier; + SystemData = systemData; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets the ID of the external BastionHost resource that corresponds + /// to this DTL BastionHost + /// + [JsonProperty(PropertyName = "properties.externalBastionHostId")] + public string ExternalBastionHostId { get; private set; } + + /// + /// Gets the ID of the PublicIpAddress resource that is created by and + /// paired with this BastionHost + /// + [JsonProperty(PropertyName = "properties.ipAddressId")] + public string IpAddressId { get; private set; } + + /// + /// Gets the provisioning status of the resource. + /// + [JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState { get; private set; } + + /// + /// Gets the unique immutable identifier of a resource (Guid). + /// + [JsonProperty(PropertyName = "properties.uniqueIdentifier")] + public string UniqueIdentifier { get; private set; } + + /// + /// Gets the system metadata relating to this resource + /// + [JsonProperty(PropertyName = "systemData")] + public SystemData SystemData { get; private set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public override void Validate() + { + base.Validate(); + } + } +} diff --git a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/HourDetails.cs b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/BastionHostFragment.cs similarity index 56% rename from sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/HourDetails.cs rename to sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/BastionHostFragment.cs index 46baab3647c3..b07345845fd8 100644 --- a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/HourDetails.cs +++ b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/BastionHostFragment.cs @@ -10,30 +10,30 @@ namespace Microsoft.Azure.Management.DevTestLabs.Models { - using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; using System.Linq; /// - /// Properties of an hourly schedule. + /// Patch /// - public partial class HourDetails + public partial class BastionHostFragment : Tags { /// - /// Initializes a new instance of the HourDetails class. + /// Initializes a new instance of the BastionHostFragment class. /// - public HourDetails() + public BastionHostFragment() { CustomInit(); } /// - /// Initializes a new instance of the HourDetails class. + /// Initializes a new instance of the BastionHostFragment class. /// - /// Minutes of the hour the schedule will - /// run. - public HourDetails(int? minute = default(int?)) + /// Resource tags + public BastionHostFragment(IDictionary tagsProperty = default(IDictionary)) + : base(tagsProperty) { - Minute = minute; CustomInit(); } @@ -42,11 +42,5 @@ public HourDetails() /// partial void CustomInit(); - /// - /// Gets or sets minutes of the hour the schedule will run. - /// - [JsonProperty(PropertyName = "minute")] - public int? Minute { get; set; } - } } diff --git a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/BulkCreationParametersFragment.cs b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/BulkCreationParametersFragment.cs deleted file mode 100644 index 77f9e4ef715d..000000000000 --- a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/BulkCreationParametersFragment.cs +++ /dev/null @@ -1,54 +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.DevTestLabs.Models -{ - using Newtonsoft.Json; - using System.Linq; - - /// - /// Parameters for creating multiple virtual machines as a single action. - /// - public partial class BulkCreationParametersFragment - { - /// - /// Initializes a new instance of the BulkCreationParametersFragment - /// class. - /// - public BulkCreationParametersFragment() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the BulkCreationParametersFragment - /// class. - /// - /// The number of virtual machine instances - /// to create. - public BulkCreationParametersFragment(int? instanceCount = default(int?)) - { - InstanceCount = instanceCount; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the number of virtual machine instances to create. - /// - [JsonProperty(PropertyName = "instanceCount")] - public int? InstanceCount { get; set; } - - } -} diff --git a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/CheckNameAvailabilityReason.cs b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/CheckNameAvailabilityReason.cs new file mode 100644 index 000000000000..4aa0a55b19fe --- /dev/null +++ b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/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.DevTestLabs.Models +{ + + /// + /// Defines values for CheckNameAvailabilityReason. + /// + public static class CheckNameAvailabilityReason + { + public const string Invalid = "Invalid"; + public const string AlreadyExists = "AlreadyExists"; + } +} diff --git a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/ArtifactParameterPropertiesFragment.cs b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/CheckNameAvailabilityRequest.cs similarity index 54% rename from sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/ArtifactParameterPropertiesFragment.cs rename to sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/CheckNameAvailabilityRequest.cs index 991965a21d01..b0c709120bf6 100644 --- a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/ArtifactParameterPropertiesFragment.cs +++ b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/CheckNameAvailabilityRequest.cs @@ -14,29 +14,30 @@ namespace Microsoft.Azure.Management.DevTestLabs.Models using System.Linq; /// - /// Properties of an artifact parameter. + /// The check availability request body. /// - public partial class ArtifactParameterPropertiesFragment + public partial class CheckNameAvailabilityRequest { /// - /// Initializes a new instance of the - /// ArtifactParameterPropertiesFragment class. + /// Initializes a new instance of the CheckNameAvailabilityRequest + /// class. /// - public ArtifactParameterPropertiesFragment() + public CheckNameAvailabilityRequest() { CustomInit(); } /// - /// Initializes a new instance of the - /// ArtifactParameterPropertiesFragment class. + /// Initializes a new instance of the CheckNameAvailabilityRequest + /// class. /// - /// The name of the artifact parameter. - /// The value of the artifact parameter. - public ArtifactParameterPropertiesFragment(string name = default(string), string value = default(string)) + /// 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; - Value = value; + Type = type; CustomInit(); } @@ -46,16 +47,17 @@ public ArtifactParameterPropertiesFragment() partial void CustomInit(); /// - /// Gets or sets the name of the artifact parameter. + /// 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 value of the artifact parameter. + /// Gets or sets the resource type. /// - [JsonProperty(PropertyName = "value")] - public string Value { get; set; } + [JsonProperty(PropertyName = "type")] + public string Type { get; set; } } } diff --git a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/CheckNameAvailabilityResponse.cs b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/CheckNameAvailabilityResponse.cs new file mode 100644 index 000000000000..b719576f8575 --- /dev/null +++ b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/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.DevTestLabs.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/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/ComputeDataDiskFragment.cs b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/ComputeDataDiskFragment.cs deleted file mode 100644 index e027e1d58dc1..000000000000 --- a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/ComputeDataDiskFragment.cs +++ /dev/null @@ -1,78 +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.DevTestLabs.Models -{ - using Newtonsoft.Json; - using System.Linq; - - /// - /// A data disks attached to a virtual machine. - /// - public partial class ComputeDataDiskFragment - { - /// - /// Initializes a new instance of the ComputeDataDiskFragment class. - /// - public ComputeDataDiskFragment() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the ComputeDataDiskFragment class. - /// - /// Gets data disk name. - /// When backed by a blob, the URI of underlying - /// blob. - /// When backed by managed disk, this is - /// the ID of the compute disk resource. - /// Gets data disk size in GiB. - public ComputeDataDiskFragment(string name = default(string), string diskUri = default(string), string managedDiskId = default(string), int? diskSizeGiB = default(int?)) - { - Name = name; - DiskUri = diskUri; - ManagedDiskId = managedDiskId; - DiskSizeGiB = diskSizeGiB; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets data disk name. - /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } - - /// - /// Gets or sets when backed by a blob, the URI of underlying blob. - /// - [JsonProperty(PropertyName = "diskUri")] - public string DiskUri { get; set; } - - /// - /// Gets or sets when backed by managed disk, this is the ID of the - /// compute disk resource. - /// - [JsonProperty(PropertyName = "managedDiskId")] - public string ManagedDiskId { get; set; } - - /// - /// Gets data disk size in GiB. - /// - [JsonProperty(PropertyName = "diskSizeGiB")] - public int? DiskSizeGiB { get; set; } - - } -} diff --git a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/ComputeVmInstanceViewStatusFragment.cs b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/ComputeVmInstanceViewStatusFragment.cs deleted file mode 100644 index bfebdc27f087..000000000000 --- a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/ComputeVmInstanceViewStatusFragment.cs +++ /dev/null @@ -1,71 +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.DevTestLabs.Models -{ - using Newtonsoft.Json; - using System.Linq; - - /// - /// Status information about a virtual machine. - /// - public partial class ComputeVmInstanceViewStatusFragment - { - /// - /// Initializes a new instance of the - /// ComputeVmInstanceViewStatusFragment class. - /// - public ComputeVmInstanceViewStatusFragment() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the - /// ComputeVmInstanceViewStatusFragment class. - /// - /// Gets the status Code. - /// Gets the short localizable label for - /// the status. - /// Gets the message associated with the - /// status. - public ComputeVmInstanceViewStatusFragment(string code = default(string), string displayStatus = default(string), string message = default(string)) - { - Code = code; - DisplayStatus = displayStatus; - Message = message; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets the status Code. - /// - [JsonProperty(PropertyName = "code")] - public string Code { get; set; } - - /// - /// Gets the short localizable label for the status. - /// - [JsonProperty(PropertyName = "displayStatus")] - public string DisplayStatus { get; set; } - - /// - /// Gets the message associated with the status. - /// - [JsonProperty(PropertyName = "message")] - public string Message { get; set; } - - } -} diff --git a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/ComputeVmProperties.cs b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/ComputeVmProperties.cs deleted file mode 100644 index 70ea07a87f87..000000000000 --- a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/ComputeVmProperties.cs +++ /dev/null @@ -1,107 +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.DevTestLabs.Models -{ - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - - /// - /// Properties of a virtual machine returned by the Microsoft.Compute API. - /// - public partial class ComputeVmProperties - { - /// - /// Initializes a new instance of the ComputeVmProperties class. - /// - public ComputeVmProperties() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the ComputeVmProperties class. - /// - /// Gets the statuses of the virtual - /// machine. - /// Gets the OS type of the virtual - /// machine. - /// Gets the size of the virtual machine. - /// Gets the network interface ID of - /// the virtual machine. - /// Gets OS disk blob uri for the virtual - /// machine. - /// Gets data disks blob uri for the virtual - /// machine. - /// Gets all data disks attached to the virtual - /// machine. - public ComputeVmProperties(IList statuses = default(IList), string osType = default(string), string vmSize = default(string), string networkInterfaceId = default(string), string osDiskId = default(string), IList dataDiskIds = default(IList), IList dataDisks = default(IList)) - { - Statuses = statuses; - OsType = osType; - VmSize = vmSize; - NetworkInterfaceId = networkInterfaceId; - OsDiskId = osDiskId; - DataDiskIds = dataDiskIds; - DataDisks = dataDisks; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets the statuses of the virtual machine. - /// - [JsonProperty(PropertyName = "statuses")] - public IList Statuses { get; set; } - - /// - /// Gets the OS type of the virtual machine. - /// - [JsonProperty(PropertyName = "osType")] - public string OsType { get; set; } - - /// - /// Gets the size of the virtual machine. - /// - [JsonProperty(PropertyName = "vmSize")] - public string VmSize { get; set; } - - /// - /// Gets the network interface ID of the virtual machine. - /// - [JsonProperty(PropertyName = "networkInterfaceId")] - public string NetworkInterfaceId { get; set; } - - /// - /// Gets OS disk blob uri for the virtual machine. - /// - [JsonProperty(PropertyName = "osDiskId")] - public string OsDiskId { get; set; } - - /// - /// Gets data disks blob uri for the virtual machine. - /// - [JsonProperty(PropertyName = "dataDiskIds")] - public IList DataDiskIds { get; set; } - - /// - /// Gets all data disks attached to the virtual machine. - /// - [JsonProperty(PropertyName = "dataDisks")] - public IList DataDisks { get; set; } - - } -} diff --git a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/ComputeVmPropertiesFragment.cs b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/ComputeVmPropertiesFragment.cs deleted file mode 100644 index 6d1ca72339ed..000000000000 --- a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/ComputeVmPropertiesFragment.cs +++ /dev/null @@ -1,109 +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.DevTestLabs.Models -{ - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - - /// - /// Properties of a virtual machine returned by the Microsoft.Compute API. - /// - public partial class ComputeVmPropertiesFragment - { - /// - /// Initializes a new instance of the ComputeVmPropertiesFragment - /// class. - /// - public ComputeVmPropertiesFragment() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the ComputeVmPropertiesFragment - /// class. - /// - /// Gets the statuses of the virtual - /// machine. - /// Gets the OS type of the virtual - /// machine. - /// Gets the size of the virtual machine. - /// Gets the network interface ID of - /// the virtual machine. - /// Gets OS disk blob uri for the virtual - /// machine. - /// Gets data disks blob uri for the virtual - /// machine. - /// Gets all data disks attached to the virtual - /// machine. - public ComputeVmPropertiesFragment(IList statuses = default(IList), string osType = default(string), string vmSize = default(string), string networkInterfaceId = default(string), string osDiskId = default(string), IList dataDiskIds = default(IList), IList dataDisks = default(IList)) - { - Statuses = statuses; - OsType = osType; - VmSize = vmSize; - NetworkInterfaceId = networkInterfaceId; - OsDiskId = osDiskId; - DataDiskIds = dataDiskIds; - DataDisks = dataDisks; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets the statuses of the virtual machine. - /// - [JsonProperty(PropertyName = "statuses")] - public IList Statuses { get; set; } - - /// - /// Gets the OS type of the virtual machine. - /// - [JsonProperty(PropertyName = "osType")] - public string OsType { get; set; } - - /// - /// Gets the size of the virtual machine. - /// - [JsonProperty(PropertyName = "vmSize")] - public string VmSize { get; set; } - - /// - /// Gets the network interface ID of the virtual machine. - /// - [JsonProperty(PropertyName = "networkInterfaceId")] - public string NetworkInterfaceId { get; set; } - - /// - /// Gets OS disk blob uri for the virtual machine. - /// - [JsonProperty(PropertyName = "osDiskId")] - public string OsDiskId { get; set; } - - /// - /// Gets data disks blob uri for the virtual machine. - /// - [JsonProperty(PropertyName = "dataDiskIds")] - public IList DataDiskIds { get; set; } - - /// - /// Gets all data disks attached to the virtual machine. - /// - [JsonProperty(PropertyName = "dataDisks")] - public IList DataDisks { get; set; } - - } -} diff --git a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/Cost.cs b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/Cost.cs new file mode 100644 index 000000000000..40f3b67c9eb2 --- /dev/null +++ b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/Cost.cs @@ -0,0 +1,195 @@ +// +// 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.DevTestLabs.Models +{ + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// A cost item. + /// + [Rest.Serialization.JsonTransformation] + public partial class Cost : Resource + { + /// + /// Initializes a new instance of the Cost class. + /// + public Cost() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the Cost class. + /// + /// Fully qualified resource ID for the resource. Ex - + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + /// The name of the resource + /// The type of the resource. E.g. + /// "Microsoft.Compute/virtualMachines" or + /// "Microsoft.Storage/storageAccounts" + /// Target cost status. Possible values include: + /// 'Enabled', 'Disabled' + /// Lab target cost + /// Cost thresholds. + /// Reporting cycle start + /// date. + /// Reporting cycle end date. + /// Reporting cycle type. Possible values + /// include: 'CalendarMonth', 'Custom' + /// The cost component of the cost + /// item. + /// The lab cost details component of the + /// cost data. + /// The resource cost component of the cost + /// data. + /// The currency code of the cost. + /// The start time of the cost + /// data. + /// The end time of the cost data. + /// The creation date of the cost. + /// The provisioning status of the + /// resource. + /// The unique immutable identifier of a + /// resource (Guid). + /// The system metadata relating to this + /// resource + public Cost(string id = default(string), string name = default(string), string type = default(string), string status = default(string), int? target = default(int?), IList costThresholds = default(IList), System.DateTime? cycleStartDateTime = default(System.DateTime?), System.DateTime? cycleEndDateTime = default(System.DateTime?), string cycleType = default(string), double? estimatedLabCost = default(double?), IList labCostDetails = default(IList), IList resourceCosts = default(IList), string currencyCode = default(string), System.DateTime? startDateTime = default(System.DateTime?), System.DateTime? endDateTime = default(System.DateTime?), System.DateTime? createdDate = default(System.DateTime?), string provisioningState = default(string), string uniqueIdentifier = default(string), SystemData systemData = default(SystemData)) + : base(id, name, type) + { + Status = status; + Target = target; + CostThresholds = costThresholds; + CycleStartDateTime = cycleStartDateTime; + CycleEndDateTime = cycleEndDateTime; + CycleType = cycleType; + EstimatedLabCost = estimatedLabCost; + LabCostDetails = labCostDetails; + ResourceCosts = resourceCosts; + CurrencyCode = currencyCode; + StartDateTime = startDateTime; + EndDateTime = endDateTime; + CreatedDate = createdDate; + ProvisioningState = provisioningState; + UniqueIdentifier = uniqueIdentifier; + SystemData = systemData; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets target cost status. Possible values include: + /// 'Enabled', 'Disabled' + /// + [JsonProperty(PropertyName = "properties.targetCost.status")] + public string Status { get; set; } + + /// + /// Gets or sets lab target cost + /// + [JsonProperty(PropertyName = "properties.targetCost.target")] + public int? Target { get; set; } + + /// + /// Gets or sets cost thresholds. + /// + [JsonProperty(PropertyName = "properties.targetCost.costThresholds")] + public IList CostThresholds { get; set; } + + /// + /// Gets or sets reporting cycle start date. + /// + [JsonProperty(PropertyName = "properties.targetCost.cycleStartDateTime")] + public System.DateTime? CycleStartDateTime { get; set; } + + /// + /// Gets or sets reporting cycle end date. + /// + [JsonProperty(PropertyName = "properties.targetCost.cycleEndDateTime")] + public System.DateTime? CycleEndDateTime { get; set; } + + /// + /// Gets or sets reporting cycle type. Possible values include: + /// 'CalendarMonth', 'Custom' + /// + [JsonProperty(PropertyName = "properties.targetCost.cycleType")] + public string CycleType { get; set; } + + /// + /// Gets or sets the cost component of the cost item. + /// + [JsonProperty(PropertyName = "properties.labCostSummary.estimatedLabCost")] + public double? EstimatedLabCost { get; set; } + + /// + /// Gets the lab cost details component of the cost data. + /// + [JsonProperty(PropertyName = "properties.labCostDetails")] + public IList LabCostDetails { get; private set; } + + /// + /// Gets the resource cost component of the cost data. + /// + [JsonProperty(PropertyName = "properties.resourceCosts")] + public IList ResourceCosts { get; private set; } + + /// + /// Gets or sets the currency code of the cost. + /// + [JsonProperty(PropertyName = "properties.currencyCode")] + public string CurrencyCode { get; set; } + + /// + /// Gets or sets the start time of the cost data. + /// + [JsonProperty(PropertyName = "properties.startDateTime")] + public System.DateTime? StartDateTime { get; set; } + + /// + /// Gets or sets the end time of the cost data. + /// + [JsonProperty(PropertyName = "properties.endDateTime")] + public System.DateTime? EndDateTime { get; set; } + + /// + /// Gets or sets the creation date of the cost. + /// + [JsonProperty(PropertyName = "properties.createdDate")] + public System.DateTime? CreatedDate { get; set; } + + /// + /// Gets the provisioning status of the resource. + /// + [JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState { get; private set; } + + /// + /// Gets the unique immutable identifier of a resource (Guid). + /// + [JsonProperty(PropertyName = "properties.uniqueIdentifier")] + public string UniqueIdentifier { get; private set; } + + /// + /// Gets the system metadata relating to this resource + /// + [JsonProperty(PropertyName = "systemData")] + public SystemData SystemData { get; private set; } + + } +} diff --git a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/CostThresholdProperties.cs b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/CostThresholdProperties.cs index 7c224fcdc91d..70023506a61e 100644 --- a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/CostThresholdProperties.cs +++ b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/CostThresholdProperties.cs @@ -10,12 +10,15 @@ namespace Microsoft.Azure.Management.DevTestLabs.Models { + using Microsoft.Rest; + using Microsoft.Rest.Serialization; using Newtonsoft.Json; using System.Linq; /// /// Properties of a cost threshold item. /// + [Rest.Serialization.JsonTransformation] public partial class CostThresholdProperties { /// @@ -31,8 +34,7 @@ public CostThresholdProperties() /// /// The ID of the cost threshold /// item. - /// The value of the percentage cost - /// threshold. + /// The cost threshold value. /// Indicates whether this threshold will /// be displayed on cost charts. Possible values include: 'Enabled', /// 'Disabled' @@ -41,10 +43,10 @@ public CostThresholdProperties() /// Possible values include: 'Enabled', 'Disabled' /// Indicates the datetime when /// notifications were last sent for this threshold. - public CostThresholdProperties(string thresholdId = default(string), PercentageCostThresholdProperties percentageThreshold = default(PercentageCostThresholdProperties), string displayOnChart = default(string), string sendNotificationWhenExceeded = default(string), string notificationSent = default(string)) + public CostThresholdProperties(string thresholdId = default(string), double? thresholdValue = default(double?), string displayOnChart = default(string), string sendNotificationWhenExceeded = default(string), string notificationSent = default(string)) { ThresholdId = thresholdId; - PercentageThreshold = percentageThreshold; + ThresholdValue = thresholdValue; DisplayOnChart = displayOnChart; SendNotificationWhenExceeded = sendNotificationWhenExceeded; NotificationSent = notificationSent; @@ -63,10 +65,10 @@ public CostThresholdProperties() public string ThresholdId { get; set; } /// - /// Gets or sets the value of the percentage cost threshold. + /// Gets or sets the cost threshold value. /// - [JsonProperty(PropertyName = "percentageThreshold")] - public PercentageCostThresholdProperties PercentageThreshold { get; set; } + [JsonProperty(PropertyName = "percentageThreshold.thresholdValue")] + public double? ThresholdValue { get; set; } /// /// Gets or sets indicates whether this threshold will be displayed on diff --git a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/CreatedByType.cs b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/CreatedByType.cs new file mode 100644 index 000000000000..6a73f89acf1d --- /dev/null +++ b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/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.DevTestLabs.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/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/CustomImage.cs b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/CustomImage.cs index 483d2b76f030..7c1226dbd8ce 100644 --- a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/CustomImage.cs +++ b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/CustomImage.cs @@ -21,7 +21,7 @@ namespace Microsoft.Azure.Management.DevTestLabs.Models /// A custom image. /// [Rest.Serialization.JsonTransformation] - public partial class CustomImage : Resource + public partial class CustomImage : TrackedResource { /// /// Initializes a new instance of the CustomImage class. @@ -34,15 +34,29 @@ public CustomImage() /// /// Initializes a new instance of the CustomImage class. /// - /// The identifier of the resource. - /// The name of the resource. - /// The type of the resource. - /// The location of the resource. - /// The tags of the resource. - /// The virtual machine from which the image is to be - /// created. - /// The VHD from which the image is to be - /// created. + /// The geo-location where the resource + /// lives + /// The OS type of the custom image (i.e. Windows, + /// Linux). Possible values include: 'Windows', 'Linux', 'None' + /// Fully qualified resource ID for the resource. Ex - + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + /// The name of the resource + /// The type of the resource. E.g. + /// "Microsoft.Compute/virtualMachines" or + /// "Microsoft.Storage/storageAccounts" + /// Resource tags. + /// The source vm identifier. + /// The state of the Windows OS (i.e. + /// NonSysprepped, SysprepRequested, SysprepApplied). Possible values + /// include: 'NonSysprepped', 'SysprepRequested', + /// 'SysprepApplied' + /// The state of the Linux OS (i.e. + /// NonDeprovisioned, DeprovisionRequested, DeprovisionApplied). + /// Possible values include: 'NonDeprovisioned', + /// 'DeprovisionRequested', 'DeprovisionApplied' + /// The image name. + /// Indicates whether sysprep has been run on the + /// VHD. /// The description of the custom /// image. /// The author of the custom image. @@ -54,8 +68,12 @@ public CustomImage() /// custom image. /// Storage information about the /// data disks present in the custom image - /// Storage information about the plan - /// related to this custom image + /// The id of the plan, equivalent to name + /// of the plan + /// The publisher for the plan from the + /// marketplace image the custom image is derived from + /// The offer for the plan from the marketplace + /// image the custom image is derived from /// Whether or not the custom images /// underlying offer/plan has been enabled for programmatic /// deployment @@ -63,21 +81,30 @@ public CustomImage() /// resource. /// The unique immutable identifier of a /// resource (Guid). - public CustomImage(string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), CustomImagePropertiesFromVm vm = default(CustomImagePropertiesFromVm), CustomImagePropertiesCustom vhd = default(CustomImagePropertiesCustom), string description = default(string), string author = default(string), System.DateTime? creationDate = default(System.DateTime?), string managedImageId = default(string), string managedSnapshotId = default(string), IList dataDiskStorageInfo = default(IList), CustomImagePropertiesFromPlan customImagePlan = default(CustomImagePropertiesFromPlan), bool? isPlanAuthorized = default(bool?), string provisioningState = default(string), string uniqueIdentifier = default(string)) - : base(id, name, type, location, tags) + /// The system metadata relating to this + /// resource + public CustomImage(string location, string osType, string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), string sourceVmId = default(string), string windowsOsState = default(string), string linuxOsState = default(string), string imageName = default(string), bool? sysPrep = default(bool?), string description = default(string), string author = default(string), System.DateTime? creationDate = default(System.DateTime?), string managedImageId = default(string), string managedSnapshotId = default(string), IList dataDiskStorageInfo = default(IList), string customImageId = default(string), string publisher = default(string), string offer = default(string), bool? isPlanAuthorized = default(bool?), string provisioningState = default(string), string uniqueIdentifier = default(string), SystemData systemData = default(SystemData)) + : base(location, id, name, type, tags) { - Vm = vm; - Vhd = vhd; + SourceVmId = sourceVmId; + WindowsOsState = windowsOsState; + LinuxOsState = linuxOsState; + ImageName = imageName; + SysPrep = sysPrep; + OsType = osType; Description = description; Author = author; CreationDate = creationDate; ManagedImageId = managedImageId; ManagedSnapshotId = managedSnapshotId; DataDiskStorageInfo = dataDiskStorageInfo; - CustomImagePlan = customImagePlan; + CustomImageId = customImageId; + Publisher = publisher; + Offer = offer; IsPlanAuthorized = isPlanAuthorized; ProvisioningState = provisioningState; UniqueIdentifier = uniqueIdentifier; + SystemData = systemData; CustomInit(); } @@ -87,17 +114,45 @@ public CustomImage() partial void CustomInit(); /// - /// Gets or sets the virtual machine from which the image is to be - /// created. + /// Gets or sets the source vm identifier. /// - [JsonProperty(PropertyName = "properties.vm")] - public CustomImagePropertiesFromVm Vm { get; set; } + [JsonProperty(PropertyName = "properties.vm.sourceVmId")] + public string SourceVmId { get; set; } /// - /// Gets or sets the VHD from which the image is to be created. + /// Gets or sets the state of the Windows OS (i.e. NonSysprepped, + /// SysprepRequested, SysprepApplied). Possible values include: + /// 'NonSysprepped', 'SysprepRequested', 'SysprepApplied' /// - [JsonProperty(PropertyName = "properties.vhd")] - public CustomImagePropertiesCustom Vhd { get; set; } + [JsonProperty(PropertyName = "properties.vm.windowsOsInfo.windowsOsState")] + public string WindowsOsState { get; set; } + + /// + /// Gets or sets the state of the Linux OS (i.e. NonDeprovisioned, + /// DeprovisionRequested, DeprovisionApplied). Possible values include: + /// 'NonDeprovisioned', 'DeprovisionRequested', 'DeprovisionApplied' + /// + [JsonProperty(PropertyName = "properties.vm.linuxOsInfo.linuxOsState")] + public string LinuxOsState { get; set; } + + /// + /// Gets or sets the image name. + /// + [JsonProperty(PropertyName = "properties.vhd.imageName")] + public string ImageName { get; set; } + + /// + /// Gets or sets indicates whether sysprep has been run on the VHD. + /// + [JsonProperty(PropertyName = "properties.vhd.sysPrep")] + public bool? SysPrep { get; set; } + + /// + /// Gets or sets the OS type of the custom image (i.e. Windows, Linux). + /// Possible values include: 'Windows', 'Linux', 'None' + /// + [JsonProperty(PropertyName = "properties.vhd.osType")] + public string OsType { get; set; } /// /// Gets or sets the description of the custom image. @@ -137,11 +192,24 @@ public CustomImage() public IList DataDiskStorageInfo { get; set; } /// - /// Gets or sets storage information about the plan related to this - /// custom image + /// Gets or sets the id of the plan, equivalent to name of the plan + /// + [JsonProperty(PropertyName = "properties.customImagePlan.id")] + public string CustomImageId { get; set; } + + /// + /// Gets or sets the publisher for the plan from the marketplace image + /// the custom image is derived from + /// + [JsonProperty(PropertyName = "properties.customImagePlan.publisher")] + public string Publisher { get; set; } + + /// + /// Gets or sets the offer for the plan from the marketplace image the + /// custom image is derived from /// - [JsonProperty(PropertyName = "properties.customImagePlan")] - public CustomImagePropertiesFromPlan CustomImagePlan { get; set; } + [JsonProperty(PropertyName = "properties.customImagePlan.offer")] + public string Offer { get; set; } /// /// Gets or sets whether or not the custom images underlying offer/plan @@ -162,17 +230,24 @@ public CustomImage() [JsonProperty(PropertyName = "properties.uniqueIdentifier")] public string UniqueIdentifier { get; private set; } + /// + /// Gets the system metadata relating to this resource + /// + [JsonProperty(PropertyName = "systemData")] + public SystemData SystemData { get; private set; } + /// /// Validate the object. /// /// /// Thrown if validation fails /// - public virtual void Validate() + public override void Validate() { - if (Vhd != null) + base.Validate(); + if (OsType == null) { - Vhd.Validate(); + throw new ValidationException(ValidationRules.CannotBeNull, "OsType"); } } } diff --git a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/CustomImageFragment.cs b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/CustomImageFragment.cs index 38b0d9ac682b..530a1cf542fe 100644 --- a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/CustomImageFragment.cs +++ b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/CustomImageFragment.cs @@ -10,18 +10,14 @@ namespace Microsoft.Azure.Management.DevTestLabs.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; using System.Collections; using System.Collections.Generic; using System.Linq; /// - /// A custom image. + /// Patch /// - [Rest.Serialization.JsonTransformation] - public partial class CustomImageFragment : UpdateResource + public partial class CustomImageFragment : Tags { /// /// Initializes a new instance of the CustomImageFragment class. @@ -34,37 +30,10 @@ public CustomImageFragment() /// /// Initializes a new instance of the CustomImageFragment class. /// - /// The tags of the resource. - /// The virtual machine from which the image is to be - /// created. - /// The VHD from which the image is to be - /// created. - /// The description of the custom - /// image. - /// The author of the custom image. - /// The Managed Image Id backing the - /// custom image. - /// The Managed Snapshot Id backing the - /// custom image. - /// Storage information about the - /// data disks present in the custom image - /// Storage information about the plan - /// related to this custom image - /// Whether or not the custom images - /// underlying offer/plan has been enabled for programmatic - /// deployment - public CustomImageFragment(IDictionary tags = default(IDictionary), CustomImagePropertiesFromVmFragment vm = default(CustomImagePropertiesFromVmFragment), CustomImagePropertiesCustomFragment vhd = default(CustomImagePropertiesCustomFragment), string description = default(string), string author = default(string), string managedImageId = default(string), string managedSnapshotId = default(string), IList dataDiskStorageInfo = default(IList), CustomImagePropertiesFromPlanFragment customImagePlan = default(CustomImagePropertiesFromPlanFragment), bool? isPlanAuthorized = default(bool?)) - : base(tags) + /// Resource tags + public CustomImageFragment(IDictionary tagsProperty = default(IDictionary)) + : base(tagsProperty) { - Vm = vm; - Vhd = vhd; - Description = description; - Author = author; - ManagedImageId = managedImageId; - ManagedSnapshotId = managedSnapshotId; - DataDiskStorageInfo = dataDiskStorageInfo; - CustomImagePlan = customImagePlan; - IsPlanAuthorized = isPlanAuthorized; CustomInit(); } @@ -73,63 +42,5 @@ public CustomImageFragment() /// partial void CustomInit(); - /// - /// Gets or sets the virtual machine from which the image is to be - /// created. - /// - [JsonProperty(PropertyName = "properties.vm")] - public CustomImagePropertiesFromVmFragment Vm { get; set; } - - /// - /// Gets or sets the VHD from which the image is to be created. - /// - [JsonProperty(PropertyName = "properties.vhd")] - public CustomImagePropertiesCustomFragment Vhd { get; set; } - - /// - /// Gets or sets the description of the custom image. - /// - [JsonProperty(PropertyName = "properties.description")] - public string Description { get; set; } - - /// - /// Gets or sets the author of the custom image. - /// - [JsonProperty(PropertyName = "properties.author")] - public string Author { get; set; } - - /// - /// Gets or sets the Managed Image Id backing the custom image. - /// - [JsonProperty(PropertyName = "properties.managedImageId")] - public string ManagedImageId { get; set; } - - /// - /// Gets or sets the Managed Snapshot Id backing the custom image. - /// - [JsonProperty(PropertyName = "properties.managedSnapshotId")] - public string ManagedSnapshotId { get; set; } - - /// - /// Gets or sets storage information about the data disks present in - /// the custom image - /// - [JsonProperty(PropertyName = "properties.dataDiskStorageInfo")] - public IList DataDiskStorageInfo { get; set; } - - /// - /// Gets or sets storage information about the plan related to this - /// custom image - /// - [JsonProperty(PropertyName = "properties.customImagePlan")] - public CustomImagePropertiesFromPlanFragment CustomImagePlan { get; set; } - - /// - /// Gets or sets whether or not the custom images underlying offer/plan - /// has been enabled for programmatic deployment - /// - [JsonProperty(PropertyName = "properties.isPlanAuthorized")] - public bool? IsPlanAuthorized { get; set; } - } } diff --git a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/CustomImagePropertiesCustom.cs b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/CustomImagePropertiesCustom.cs deleted file mode 100644 index fe22d2fbf1d7..000000000000 --- a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/CustomImagePropertiesCustom.cs +++ /dev/null @@ -1,86 +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.DevTestLabs.Models -{ - using Microsoft.Rest; - using Newtonsoft.Json; - using System.Linq; - - /// - /// Properties for creating a custom image from a VHD. - /// - public partial class CustomImagePropertiesCustom - { - /// - /// Initializes a new instance of the CustomImagePropertiesCustom - /// class. - /// - public CustomImagePropertiesCustom() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the CustomImagePropertiesCustom - /// class. - /// - /// The OS type of the custom image (i.e. Windows, - /// Linux). Possible values include: 'Windows', 'Linux', 'None' - /// The image name. - /// Indicates whether sysprep has been run on the - /// VHD. - public CustomImagePropertiesCustom(string osType, string imageName = default(string), bool? sysPrep = default(bool?)) - { - ImageName = imageName; - SysPrep = sysPrep; - OsType = osType; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the image name. - /// - [JsonProperty(PropertyName = "imageName")] - public string ImageName { get; set; } - - /// - /// Gets or sets indicates whether sysprep has been run on the VHD. - /// - [JsonProperty(PropertyName = "sysPrep")] - public bool? SysPrep { get; set; } - - /// - /// Gets or sets the OS type of the custom image (i.e. Windows, Linux). - /// Possible values include: 'Windows', 'Linux', 'None' - /// - [JsonProperty(PropertyName = "osType")] - public string OsType { get; set; } - - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (OsType == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "OsType"); - } - } - } -} diff --git a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/CustomImagePropertiesCustomFragment.cs b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/CustomImagePropertiesCustomFragment.cs deleted file mode 100644 index 69a57595e5d7..000000000000 --- a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/CustomImagePropertiesCustomFragment.cs +++ /dev/null @@ -1,72 +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.DevTestLabs.Models -{ - using Newtonsoft.Json; - using System.Linq; - - /// - /// Properties for creating a custom image from a VHD. - /// - public partial class CustomImagePropertiesCustomFragment - { - /// - /// Initializes a new instance of the - /// CustomImagePropertiesCustomFragment class. - /// - public CustomImagePropertiesCustomFragment() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the - /// CustomImagePropertiesCustomFragment class. - /// - /// The image name. - /// Indicates whether sysprep has been run on the - /// VHD. - /// The OS type of the custom image (i.e. Windows, - /// Linux). Possible values include: 'Windows', 'Linux', 'None' - public CustomImagePropertiesCustomFragment(string imageName = default(string), bool? sysPrep = default(bool?), string osType = default(string)) - { - ImageName = imageName; - SysPrep = sysPrep; - OsType = osType; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the image name. - /// - [JsonProperty(PropertyName = "imageName")] - public string ImageName { get; set; } - - /// - /// Gets or sets indicates whether sysprep has been run on the VHD. - /// - [JsonProperty(PropertyName = "sysPrep")] - public bool? SysPrep { get; set; } - - /// - /// Gets or sets the OS type of the custom image (i.e. Windows, Linux). - /// Possible values include: 'Windows', 'Linux', 'None' - /// - [JsonProperty(PropertyName = "osType")] - public string OsType { get; set; } - - } -} diff --git a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/CustomImagePropertiesFromPlan.cs b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/CustomImagePropertiesFromPlan.cs deleted file mode 100644 index dee8539454bc..000000000000 --- a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/CustomImagePropertiesFromPlan.cs +++ /dev/null @@ -1,74 +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.DevTestLabs.Models -{ - using Newtonsoft.Json; - using System.Linq; - - /// - /// Properties for plan on a custom image. - /// - public partial class CustomImagePropertiesFromPlan - { - /// - /// Initializes a new instance of the CustomImagePropertiesFromPlan - /// class. - /// - public CustomImagePropertiesFromPlan() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the CustomImagePropertiesFromPlan - /// class. - /// - /// The id of the plan, equivalent to name of the - /// plan - /// The publisher for the plan from the - /// marketplace image the custom image is derived from - /// The offer for the plan from the marketplace - /// image the custom image is derived from - public CustomImagePropertiesFromPlan(string id = default(string), string publisher = default(string), string offer = default(string)) - { - Id = id; - Publisher = publisher; - Offer = offer; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the id of the plan, equivalent to name of the plan - /// - [JsonProperty(PropertyName = "id")] - public string Id { get; set; } - - /// - /// Gets or sets the publisher for the plan from the marketplace image - /// the custom image is derived from - /// - [JsonProperty(PropertyName = "publisher")] - public string Publisher { get; set; } - - /// - /// Gets or sets the offer for the plan from the marketplace image the - /// custom image is derived from - /// - [JsonProperty(PropertyName = "offer")] - public string Offer { get; set; } - - } -} diff --git a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/CustomImagePropertiesFromVm.cs b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/CustomImagePropertiesFromVm.cs deleted file mode 100644 index 08b8fdce4707..000000000000 --- a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/CustomImagePropertiesFromVm.cs +++ /dev/null @@ -1,71 +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.DevTestLabs.Models -{ - using Newtonsoft.Json; - using System.Linq; - - /// - /// Properties for creating a custom image from a virtual machine. - /// - public partial class CustomImagePropertiesFromVm - { - /// - /// Initializes a new instance of the CustomImagePropertiesFromVm - /// class. - /// - public CustomImagePropertiesFromVm() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the CustomImagePropertiesFromVm - /// class. - /// - /// The source vm identifier. - /// The Windows OS information of the - /// VM. - /// The Linux OS information of the - /// VM. - public CustomImagePropertiesFromVm(string sourceVmId = default(string), WindowsOsInfo windowsOsInfo = default(WindowsOsInfo), LinuxOsInfo linuxOsInfo = default(LinuxOsInfo)) - { - SourceVmId = sourceVmId; - WindowsOsInfo = windowsOsInfo; - LinuxOsInfo = linuxOsInfo; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the source vm identifier. - /// - [JsonProperty(PropertyName = "sourceVmId")] - public string SourceVmId { get; set; } - - /// - /// Gets or sets the Windows OS information of the VM. - /// - [JsonProperty(PropertyName = "windowsOsInfo")] - public WindowsOsInfo WindowsOsInfo { get; set; } - - /// - /// Gets or sets the Linux OS information of the VM. - /// - [JsonProperty(PropertyName = "linuxOsInfo")] - public LinuxOsInfo LinuxOsInfo { get; set; } - - } -} diff --git a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/CustomImagePropertiesFromVmFragment.cs b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/CustomImagePropertiesFromVmFragment.cs deleted file mode 100644 index ab699cbe6464..000000000000 --- a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/CustomImagePropertiesFromVmFragment.cs +++ /dev/null @@ -1,71 +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.DevTestLabs.Models -{ - using Newtonsoft.Json; - using System.Linq; - - /// - /// Properties for creating a custom image from a virtual machine. - /// - public partial class CustomImagePropertiesFromVmFragment - { - /// - /// Initializes a new instance of the - /// CustomImagePropertiesFromVmFragment class. - /// - public CustomImagePropertiesFromVmFragment() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the - /// CustomImagePropertiesFromVmFragment class. - /// - /// The source vm identifier. - /// The Windows OS information of the - /// VM. - /// The Linux OS information of the - /// VM. - public CustomImagePropertiesFromVmFragment(string sourceVmId = default(string), WindowsOsInfoFragment windowsOsInfo = default(WindowsOsInfoFragment), LinuxOsInfoFragment linuxOsInfo = default(LinuxOsInfoFragment)) - { - SourceVmId = sourceVmId; - WindowsOsInfo = windowsOsInfo; - LinuxOsInfo = linuxOsInfo; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the source vm identifier. - /// - [JsonProperty(PropertyName = "sourceVmId")] - public string SourceVmId { get; set; } - - /// - /// Gets or sets the Windows OS information of the VM. - /// - [JsonProperty(PropertyName = "windowsOsInfo")] - public WindowsOsInfoFragment WindowsOsInfo { get; set; } - - /// - /// Gets or sets the Linux OS information of the VM. - /// - [JsonProperty(PropertyName = "linuxOsInfo")] - public LinuxOsInfoFragment LinuxOsInfo { get; set; } - - } -} diff --git a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/DataDiskProperties.cs b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/DataDiskProperties.cs index 20cb65e6a8dc..07e5852f12d9 100644 --- a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/DataDiskProperties.cs +++ b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/DataDiskProperties.cs @@ -10,6 +10,8 @@ namespace Microsoft.Azure.Management.DevTestLabs.Models { + using Microsoft.Rest; + using Microsoft.Rest.Serialization; using Newtonsoft.Json; using System.Linq; @@ -17,6 +19,7 @@ namespace Microsoft.Azure.Management.DevTestLabs.Models /// Request body for adding a new or existing data disk to a virtual /// machine. /// + [Rest.Serialization.JsonTransformation] public partial class DataDiskProperties { /// @@ -30,16 +33,22 @@ public DataDiskProperties() /// /// Initializes a new instance of the DataDiskProperties class. /// - /// Specifies options to attach - /// a new disk to the virtual machine. + /// Size of the disk to be attached in + /// Gibibytes. + /// The name of the disk to be attached. + /// The storage type for the disk (i.e. + /// Standard, Premium). Possible values include: 'Standard', 'Premium', + /// 'StandardSSD' /// Specifies the existing lab disk id /// to attach to virtual machine. /// Caching option for a data disk (i.e. /// None, ReadOnly, ReadWrite). Possible values include: 'None', /// 'ReadOnly', 'ReadWrite' - public DataDiskProperties(AttachNewDataDiskOptions attachNewDataDiskOptions = default(AttachNewDataDiskOptions), string existingLabDiskId = default(string), string hostCaching = default(string)) + public DataDiskProperties(int? diskSizeGiB = default(int?), string diskName = default(string), string diskType = default(string), string existingLabDiskId = default(string), string hostCaching = default(string)) { - AttachNewDataDiskOptions = attachNewDataDiskOptions; + DiskSizeGiB = diskSizeGiB; + DiskName = diskName; + DiskType = diskType; ExistingLabDiskId = existingLabDiskId; HostCaching = hostCaching; CustomInit(); @@ -51,11 +60,24 @@ public DataDiskProperties() partial void CustomInit(); /// - /// Gets or sets specifies options to attach a new disk to the virtual - /// machine. + /// Gets or sets size of the disk to be attached in Gibibytes. /// - [JsonProperty(PropertyName = "attachNewDataDiskOptions")] - public AttachNewDataDiskOptions AttachNewDataDiskOptions { get; set; } + [JsonProperty(PropertyName = "attachNewDataDiskOptions.diskSizeGiB")] + public int? DiskSizeGiB { get; set; } + + /// + /// Gets or sets the name of the disk to be attached. + /// + [JsonProperty(PropertyName = "attachNewDataDiskOptions.diskName")] + public string DiskName { get; set; } + + /// + /// Gets or sets the storage type for the disk (i.e. Standard, + /// Premium). Possible values include: 'Standard', 'Premium', + /// 'StandardSSD' + /// + [JsonProperty(PropertyName = "attachNewDataDiskOptions.diskType")] + public string DiskType { get; set; } /// /// Gets or sets specifies the existing lab disk id to attach to diff --git a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/DataDiskPropertiesFragment.cs b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/DataDiskPropertiesFragment.cs deleted file mode 100644 index d1b8c1a11dd8..000000000000 --- a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/DataDiskPropertiesFragment.cs +++ /dev/null @@ -1,76 +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.DevTestLabs.Models -{ - using Newtonsoft.Json; - using System.Linq; - - /// - /// Request body for adding a new or existing data disk to a virtual - /// machine. - /// - public partial class DataDiskPropertiesFragment - { - /// - /// Initializes a new instance of the DataDiskPropertiesFragment class. - /// - public DataDiskPropertiesFragment() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the DataDiskPropertiesFragment class. - /// - /// Specifies options to attach - /// a new disk to the virtual machine. - /// Specifies the existing lab disk id - /// to attach to virtual machine. - /// Caching option for a data disk (i.e. - /// None, ReadOnly, ReadWrite). Possible values include: 'None', - /// 'ReadOnly', 'ReadWrite' - public DataDiskPropertiesFragment(AttachNewDataDiskOptionsFragment attachNewDataDiskOptions = default(AttachNewDataDiskOptionsFragment), string existingLabDiskId = default(string), string hostCaching = default(string)) - { - AttachNewDataDiskOptions = attachNewDataDiskOptions; - ExistingLabDiskId = existingLabDiskId; - HostCaching = hostCaching; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets specifies options to attach a new disk to the virtual - /// machine. - /// - [JsonProperty(PropertyName = "attachNewDataDiskOptions")] - public AttachNewDataDiskOptionsFragment AttachNewDataDiskOptions { get; set; } - - /// - /// Gets or sets specifies the existing lab disk id to attach to - /// virtual machine. - /// - [JsonProperty(PropertyName = "existingLabDiskId")] - public string ExistingLabDiskId { get; set; } - - /// - /// Gets or sets caching option for a data disk (i.e. None, ReadOnly, - /// ReadWrite). Possible values include: 'None', 'ReadOnly', - /// 'ReadWrite' - /// - [JsonProperty(PropertyName = "hostCaching")] - public string HostCaching { get; set; } - - } -} diff --git a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/DataDiskStorageTypeInfo.cs b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/DataDiskStorageTypeInfo.cs index 71d238bd6573..1eb0a385b1fb 100644 --- a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/DataDiskStorageTypeInfo.cs +++ b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/DataDiskStorageTypeInfo.cs @@ -31,7 +31,7 @@ public DataDiskStorageTypeInfo() /// /// Disk Lun /// Disk Storage Type. Possible values - /// include: 'Standard', 'Premium' + /// include: 'Standard', 'Premium', 'StandardSSD' public DataDiskStorageTypeInfo(string lun = default(string), string storageType = default(string)) { Lun = lun; @@ -52,7 +52,7 @@ public DataDiskStorageTypeInfo() /// /// Gets or sets disk Storage Type. Possible values include: - /// 'Standard', 'Premium' + /// 'Standard', 'Premium', 'StandardSSD' /// [JsonProperty(PropertyName = "storageType")] public string StorageType { get; set; } diff --git a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/DataDiskStorageTypeInfoFragment.cs b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/DataDiskStorageTypeInfoFragment.cs deleted file mode 100644 index e5bf351eb416..000000000000 --- a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/DataDiskStorageTypeInfoFragment.cs +++ /dev/null @@ -1,63 +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.DevTestLabs.Models -{ - using Newtonsoft.Json; - using System.Linq; - - /// - /// Storage information about the data disks present in the custom image - /// - public partial class DataDiskStorageTypeInfoFragment - { - /// - /// Initializes a new instance of the DataDiskStorageTypeInfoFragment - /// class. - /// - public DataDiskStorageTypeInfoFragment() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the DataDiskStorageTypeInfoFragment - /// class. - /// - /// Disk Lun - /// Disk Storage Type. Possible values - /// include: 'Standard', 'Premium' - public DataDiskStorageTypeInfoFragment(string lun = default(string), string storageType = default(string)) - { - Lun = lun; - StorageType = storageType; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets disk Lun - /// - [JsonProperty(PropertyName = "lun")] - public string Lun { get; set; } - - /// - /// Gets or sets disk Storage Type. Possible values include: - /// 'Standard', 'Premium' - /// - [JsonProperty(PropertyName = "storageType")] - public string StorageType { get; set; } - - } -} diff --git a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/Disk.cs b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/Disk.cs index 0402b2481089..eed7ad9c21bc 100644 --- a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/Disk.cs +++ b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/Disk.cs @@ -21,7 +21,7 @@ namespace Microsoft.Azure.Management.DevTestLabs.Models /// A Disk. /// [Rest.Serialization.JsonTransformation] - public partial class Disk : Resource + public partial class Disk : TrackedResource { /// /// Initializes a new instance of the Disk class. @@ -34,22 +34,28 @@ public Disk() /// /// Initializes a new instance of the Disk class. /// - /// The identifier of the resource. - /// The name of the resource. - /// The type of the resource. - /// The location of the resource. - /// The tags of the resource. + /// The geo-location where the resource + /// lives + /// Fully qualified resource ID for the resource. Ex - + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + /// The name of the resource + /// The type of the resource. E.g. + /// "Microsoft.Compute/virtualMachines" or + /// "Microsoft.Storage/storageAccounts" + /// Resource tags. /// The storage type for the disk (i.e. - /// Standard, Premium). Possible values include: 'Standard', - /// 'Premium' + /// Standard, Premium). Possible values include: 'Standard', 'Premium', + /// 'StandardSSD' /// The size of the disk in - /// GibiBytes. + /// Gibibytes. /// The resource ID of the VM to which /// this disk is leased. /// When backed by a blob, the name of the /// VHD blob without extension. /// When backed by a blob, the URI of underlying /// blob. + /// When backed by a blob, the storage + /// account where the blob is. /// The creation date of the disk. /// The host caching policy of the disk (i.e. /// None, ReadOnly, ReadWrite). @@ -59,19 +65,23 @@ public Disk() /// resource. /// The unique immutable identifier of a /// resource (Guid). - public Disk(string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), string diskType = default(string), int? diskSizeGiB = default(int?), string leasedByLabVmId = default(string), string diskBlobName = default(string), string diskUri = default(string), System.DateTime? createdDate = default(System.DateTime?), string hostCaching = default(string), string managedDiskId = default(string), string provisioningState = default(string), string uniqueIdentifier = default(string)) - : base(id, name, type, location, tags) + /// The system metadata relating to this + /// resource + public Disk(string location, string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), string diskType = default(string), int? diskSizeGiB = default(int?), string leasedByLabVmId = default(string), string diskBlobName = default(string), string diskUri = default(string), string storageAccountId = default(string), System.DateTime? createdDate = default(System.DateTime?), string hostCaching = default(string), string managedDiskId = default(string), string provisioningState = default(string), string uniqueIdentifier = default(string), SystemData systemData = default(SystemData)) + : base(location, id, name, type, tags) { DiskType = diskType; DiskSizeGiB = diskSizeGiB; LeasedByLabVmId = leasedByLabVmId; DiskBlobName = diskBlobName; DiskUri = diskUri; + StorageAccountId = storageAccountId; CreatedDate = createdDate; HostCaching = hostCaching; ManagedDiskId = managedDiskId; ProvisioningState = provisioningState; UniqueIdentifier = uniqueIdentifier; + SystemData = systemData; CustomInit(); } @@ -82,13 +92,14 @@ public Disk() /// /// Gets or sets the storage type for the disk (i.e. Standard, - /// Premium). Possible values include: 'Standard', 'Premium' + /// Premium). Possible values include: 'Standard', 'Premium', + /// 'StandardSSD' /// [JsonProperty(PropertyName = "properties.diskType")] public string DiskType { get; set; } /// - /// Gets or sets the size of the disk in GibiBytes. + /// Gets or sets the size of the disk in Gibibytes. /// [JsonProperty(PropertyName = "properties.diskSizeGiB")] public int? DiskSizeGiB { get; set; } @@ -113,6 +124,13 @@ public Disk() [JsonProperty(PropertyName = "properties.diskUri")] public string DiskUri { get; set; } + /// + /// Gets or sets when backed by a blob, the storage account where the + /// blob is. + /// + [JsonProperty(PropertyName = "properties.storageAccountId")] + public string StorageAccountId { get; set; } + /// /// Gets the creation date of the disk. /// @@ -145,5 +163,21 @@ public Disk() [JsonProperty(PropertyName = "properties.uniqueIdentifier")] public string UniqueIdentifier { get; private set; } + /// + /// Gets the system metadata relating to this resource + /// + [JsonProperty(PropertyName = "systemData")] + public SystemData SystemData { get; private set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public override void Validate() + { + base.Validate(); + } } } diff --git a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/DiskFragment.cs b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/DiskFragment.cs index ba04894b7820..1efff2b1c905 100644 --- a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/DiskFragment.cs +++ b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/DiskFragment.cs @@ -10,18 +10,14 @@ namespace Microsoft.Azure.Management.DevTestLabs.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; using System.Collections; using System.Collections.Generic; using System.Linq; /// - /// A Disk. + /// Patch /// - [Rest.Serialization.JsonTransformation] - public partial class DiskFragment : UpdateResource + public partial class DiskFragment : Tags { /// /// Initializes a new instance of the DiskFragment class. @@ -34,32 +30,10 @@ public DiskFragment() /// /// Initializes a new instance of the DiskFragment class. /// - /// The tags of the resource. - /// The storage type for the disk (i.e. - /// Standard, Premium). Possible values include: 'Standard', - /// 'Premium' - /// The size of the disk in - /// GibiBytes. - /// The resource ID of the VM to which - /// this disk is leased. - /// When backed by a blob, the name of the - /// VHD blob without extension. - /// When backed by a blob, the URI of underlying - /// blob. - /// The host caching policy of the disk (i.e. - /// None, ReadOnly, ReadWrite). - /// When backed by managed disk, this is - /// the ID of the compute disk resource. - public DiskFragment(IDictionary tags = default(IDictionary), string diskType = default(string), int? diskSizeGiB = default(int?), string leasedByLabVmId = default(string), string diskBlobName = default(string), string diskUri = default(string), string hostCaching = default(string), string managedDiskId = default(string)) - : base(tags) + /// Resource tags + public DiskFragment(IDictionary tagsProperty = default(IDictionary)) + : base(tagsProperty) { - DiskType = diskType; - DiskSizeGiB = diskSizeGiB; - LeasedByLabVmId = leasedByLabVmId; - DiskBlobName = diskBlobName; - DiskUri = diskUri; - HostCaching = hostCaching; - ManagedDiskId = managedDiskId; CustomInit(); } @@ -68,52 +42,5 @@ public DiskFragment() /// partial void CustomInit(); - /// - /// Gets or sets the storage type for the disk (i.e. Standard, - /// Premium). Possible values include: 'Standard', 'Premium' - /// - [JsonProperty(PropertyName = "properties.diskType")] - public string DiskType { get; set; } - - /// - /// Gets or sets the size of the disk in GibiBytes. - /// - [JsonProperty(PropertyName = "properties.diskSizeGiB")] - public int? DiskSizeGiB { get; set; } - - /// - /// Gets or sets the resource ID of the VM to which this disk is - /// leased. - /// - [JsonProperty(PropertyName = "properties.leasedByLabVmId")] - public string LeasedByLabVmId { get; set; } - - /// - /// Gets or sets when backed by a blob, the name of the VHD blob - /// without extension. - /// - [JsonProperty(PropertyName = "properties.diskBlobName")] - public string DiskBlobName { get; set; } - - /// - /// Gets or sets when backed by a blob, the URI of underlying blob. - /// - [JsonProperty(PropertyName = "properties.diskUri")] - public string DiskUri { get; set; } - - /// - /// Gets or sets the host caching policy of the disk (i.e. None, - /// ReadOnly, ReadWrite). - /// - [JsonProperty(PropertyName = "properties.hostCaching")] - public string HostCaching { get; set; } - - /// - /// Gets or sets when backed by managed disk, this is the ID of the - /// compute disk resource. - /// - [JsonProperty(PropertyName = "properties.managedDiskId")] - public string ManagedDiskId { get; set; } - } } diff --git a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/DtlEnvironment.cs b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/DtlEnvironment.cs index 7fe0ae7b08b1..f6772e054e9d 100644 --- a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/DtlEnvironment.cs +++ b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/DtlEnvironment.cs @@ -21,7 +21,7 @@ namespace Microsoft.Azure.Management.DevTestLabs.Models /// An environment, which is essentially an ARM template deployment. /// [Rest.Serialization.JsonTransformation] - public partial class DtlEnvironment : Resource + public partial class DtlEnvironment : TrackedResource { /// /// Initializes a new instance of the DtlEnvironment class. @@ -34,13 +34,19 @@ public DtlEnvironment() /// /// Initializes a new instance of the DtlEnvironment class. /// - /// The identifier of the resource. - /// The name of the resource. - /// The type of the resource. - /// The location of the resource. - /// The tags of the resource. - /// The deployment properties of the - /// environment. + /// The geo-location where the resource + /// lives + /// Fully qualified resource ID for the resource. Ex - + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + /// The name of the resource + /// The type of the resource. E.g. + /// "Microsoft.Compute/virtualMachines" or + /// "Microsoft.Storage/storageAccounts" + /// Resource tags. + /// The Azure Resource Manager template's + /// identifier. + /// The parameters of the Azure Resource + /// Manager template. /// The display name of the Azure /// Resource Manager template that produced the environment. /// The identifier of the resource group @@ -50,15 +56,19 @@ public DtlEnvironment() /// resource. /// The unique immutable identifier of a /// resource (Guid). - public DtlEnvironment(string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), EnvironmentDeploymentProperties deploymentProperties = default(EnvironmentDeploymentProperties), string armTemplateDisplayName = default(string), string resourceGroupId = default(string), string createdByUser = default(string), string provisioningState = default(string), string uniqueIdentifier = default(string)) - : base(id, name, type, location, tags) + /// The system metadata relating to this + /// resource + public DtlEnvironment(string location, string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), string armTemplateId = default(string), IList parameters = default(IList), string armTemplateDisplayName = default(string), string resourceGroupId = default(string), string createdByUser = default(string), string provisioningState = default(string), string uniqueIdentifier = default(string), SystemData systemData = default(SystemData)) + : base(location, id, name, type, tags) { - DeploymentProperties = deploymentProperties; + ArmTemplateId = armTemplateId; + Parameters = parameters; ArmTemplateDisplayName = armTemplateDisplayName; ResourceGroupId = resourceGroupId; CreatedByUser = createdByUser; ProvisioningState = provisioningState; UniqueIdentifier = uniqueIdentifier; + SystemData = systemData; CustomInit(); } @@ -68,10 +78,16 @@ public DtlEnvironment() partial void CustomInit(); /// - /// Gets or sets the deployment properties of the environment. + /// Gets or sets the Azure Resource Manager template's identifier. /// - [JsonProperty(PropertyName = "properties.deploymentProperties")] - public EnvironmentDeploymentProperties DeploymentProperties { get; set; } + [JsonProperty(PropertyName = "properties.deploymentProperties.armTemplateId")] + public string ArmTemplateId { get; set; } + + /// + /// Gets or sets the parameters of the Azure Resource Manager template. + /// + [JsonProperty(PropertyName = "properties.deploymentProperties.parameters")] + public IList Parameters { get; set; } /// /// Gets or sets the display name of the Azure Resource Manager @@ -105,5 +121,21 @@ public DtlEnvironment() [JsonProperty(PropertyName = "properties.uniqueIdentifier")] public string UniqueIdentifier { get; private set; } + /// + /// Gets the system metadata relating to this resource + /// + [JsonProperty(PropertyName = "systemData")] + public SystemData SystemData { get; private set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public override void Validate() + { + base.Validate(); + } } } diff --git a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/DtlEnvironmentFragment.cs b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/DtlEnvironmentFragment.cs index 935bd0aae51b..5576abd897e3 100644 --- a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/DtlEnvironmentFragment.cs +++ b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/DtlEnvironmentFragment.cs @@ -10,18 +10,14 @@ namespace Microsoft.Azure.Management.DevTestLabs.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; using System.Collections; using System.Collections.Generic; using System.Linq; /// - /// An environment, which is essentially an ARM template deployment. + /// Patch /// - [Rest.Serialization.JsonTransformation] - public partial class DtlEnvironmentFragment : UpdateResource + public partial class DtlEnvironmentFragment : Tags { /// /// Initializes a new instance of the DtlEnvironmentFragment class. @@ -34,16 +30,10 @@ public DtlEnvironmentFragment() /// /// Initializes a new instance of the DtlEnvironmentFragment class. /// - /// The tags of the resource. - /// The deployment properties of the - /// environment. - /// The display name of the Azure - /// Resource Manager template that produced the environment. - public DtlEnvironmentFragment(IDictionary tags = default(IDictionary), EnvironmentDeploymentPropertiesFragment deploymentProperties = default(EnvironmentDeploymentPropertiesFragment), string armTemplateDisplayName = default(string)) - : base(tags) + /// Resource tags + public DtlEnvironmentFragment(IDictionary tagsProperty = default(IDictionary)) + : base(tagsProperty) { - DeploymentProperties = deploymentProperties; - ArmTemplateDisplayName = armTemplateDisplayName; CustomInit(); } @@ -52,18 +42,5 @@ public DtlEnvironmentFragment() /// partial void CustomInit(); - /// - /// Gets or sets the deployment properties of the environment. - /// - [JsonProperty(PropertyName = "properties.deploymentProperties")] - public EnvironmentDeploymentPropertiesFragment DeploymentProperties { get; set; } - - /// - /// Gets or sets the display name of the Azure Resource Manager - /// template that produced the environment. - /// - [JsonProperty(PropertyName = "properties.armTemplateDisplayName")] - public string ArmTemplateDisplayName { get; set; } - } } diff --git a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/EnableState.cs b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/EnableState.cs new file mode 100644 index 000000000000..42c548ae3610 --- /dev/null +++ b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/EnableState.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.DevTestLabs.Models +{ + + /// + /// Defines values for EnableState. + /// + public static class EnableState + { + public const string Disabled = "Disabled"; + public const string Enabled = "Enabled"; + } +} diff --git a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/EncryptionProperties.cs b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/EncryptionProperties.cs new file mode 100644 index 000000000000..494576057c47 --- /dev/null +++ b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/EncryptionProperties.cs @@ -0,0 +1,62 @@ +// +// 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.DevTestLabs.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Configuration of key for data encryption + /// + public partial class EncryptionProperties + { + /// + /// Initializes a new instance of the EncryptionProperties class. + /// + public EncryptionProperties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the EncryptionProperties class. + /// + /// Indicates whether or not the encryption is + /// enabled for container registry. Possible values include: 'enabled', + /// 'disabled' + /// Key vault properties. + public EncryptionProperties(string status = default(string), KeyVaultProperties keyVaultProperties = default(KeyVaultProperties)) + { + Status = status; + KeyVaultProperties = keyVaultProperties; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets indicates whether or not the encryption is enabled for + /// container registry. Possible values include: 'enabled', 'disabled' + /// + [JsonProperty(PropertyName = "status")] + public string Status { get; set; } + + /// + /// Gets or sets key vault properties. + /// + [JsonProperty(PropertyName = "keyVaultProperties")] + public KeyVaultProperties KeyVaultProperties { get; set; } + + } +} diff --git a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/EncryptionStatus.cs b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/EncryptionStatus.cs new file mode 100644 index 000000000000..e585b89a57e4 --- /dev/null +++ b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/EncryptionStatus.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.DevTestLabs.Models +{ + + /// + /// Defines values for EncryptionStatus. + /// + public static class EncryptionStatus + { + public const string Enabled = "enabled"; + public const string Disabled = "disabled"; + } +} diff --git a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/EncryptionType.cs b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/EncryptionType.cs new file mode 100644 index 000000000000..5431c02aaaf9 --- /dev/null +++ b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/EncryptionType.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.DevTestLabs.Models +{ + + /// + /// Defines values for EncryptionType. + /// + public static class EncryptionType + { + public const string EncryptionAtRestWithPlatformKey = "EncryptionAtRestWithPlatformKey"; + public const string EncryptionAtRestWithCustomerKey = "EncryptionAtRestWithCustomerKey"; + } +} diff --git a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/EnvironmentDeploymentProperties.cs b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/EnvironmentDeploymentProperties.cs deleted file mode 100644 index 7f232051558b..000000000000 --- a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/EnvironmentDeploymentProperties.cs +++ /dev/null @@ -1,65 +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.DevTestLabs.Models -{ - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - - /// - /// Properties of an environment deployment. - /// - public partial class EnvironmentDeploymentProperties - { - /// - /// Initializes a new instance of the EnvironmentDeploymentProperties - /// class. - /// - public EnvironmentDeploymentProperties() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the EnvironmentDeploymentProperties - /// class. - /// - /// The Azure Resource Manager template's - /// identifier. - /// The parameters of the Azure Resource - /// Manager template. - public EnvironmentDeploymentProperties(string armTemplateId = default(string), IList parameters = default(IList)) - { - ArmTemplateId = armTemplateId; - Parameters = parameters; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the Azure Resource Manager template's identifier. - /// - [JsonProperty(PropertyName = "armTemplateId")] - public string ArmTemplateId { get; set; } - - /// - /// Gets or sets the parameters of the Azure Resource Manager template. - /// - [JsonProperty(PropertyName = "parameters")] - public IList Parameters { get; set; } - - } -} diff --git a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/EnvironmentDeploymentPropertiesFragment.cs b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/EnvironmentDeploymentPropertiesFragment.cs deleted file mode 100644 index 6e9038a43d85..000000000000 --- a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/EnvironmentDeploymentPropertiesFragment.cs +++ /dev/null @@ -1,65 +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.DevTestLabs.Models -{ - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - - /// - /// Properties of an environment deployment. - /// - public partial class EnvironmentDeploymentPropertiesFragment - { - /// - /// Initializes a new instance of the - /// EnvironmentDeploymentPropertiesFragment class. - /// - public EnvironmentDeploymentPropertiesFragment() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the - /// EnvironmentDeploymentPropertiesFragment class. - /// - /// The Azure Resource Manager template's - /// identifier. - /// The parameters of the Azure Resource - /// Manager template. - public EnvironmentDeploymentPropertiesFragment(string armTemplateId = default(string), IList parameters = default(IList)) - { - ArmTemplateId = armTemplateId; - Parameters = parameters; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the Azure Resource Manager template's identifier. - /// - [JsonProperty(PropertyName = "armTemplateId")] - public string ArmTemplateId { get; set; } - - /// - /// Gets or sets the parameters of the Azure Resource Manager template. - /// - [JsonProperty(PropertyName = "parameters")] - public IList Parameters { get; set; } - - } -} diff --git a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/ExternalSubnetFragment.cs b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/ErrorAdditionalInfo.cs similarity index 53% rename from sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/ExternalSubnetFragment.cs rename to sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/ErrorAdditionalInfo.cs index 63b781689d81..61c9399b7a6b 100644 --- a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/ExternalSubnetFragment.cs +++ b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/ErrorAdditionalInfo.cs @@ -14,27 +14,27 @@ namespace Microsoft.Azure.Management.DevTestLabs.Models using System.Linq; /// - /// Subnet information as returned by the Microsoft.Network API. + /// The resource management error additional info. /// - public partial class ExternalSubnetFragment + public partial class ErrorAdditionalInfo { /// - /// Initializes a new instance of the ExternalSubnetFragment class. + /// Initializes a new instance of the ErrorAdditionalInfo class. /// - public ExternalSubnetFragment() + public ErrorAdditionalInfo() { CustomInit(); } /// - /// Initializes a new instance of the ExternalSubnetFragment class. + /// Initializes a new instance of the ErrorAdditionalInfo class. /// - /// Gets or sets the identifier. - /// Gets or sets the name. - public ExternalSubnetFragment(string id = default(string), string name = default(string)) + /// The additional info type. + /// The additional info. + public ErrorAdditionalInfo(string type = default(string), object info = default(object)) { - Id = id; - Name = name; + Type = type; + Info = info; CustomInit(); } @@ -44,16 +44,16 @@ public ExternalSubnetFragment() partial void CustomInit(); /// - /// Gets or sets the identifier. + /// Gets the additional info type. /// - [JsonProperty(PropertyName = "id")] - public string Id { get; set; } + [JsonProperty(PropertyName = "type")] + public string Type { get; private set; } /// - /// Gets or sets the name. + /// Gets the additional info. /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } + [JsonProperty(PropertyName = "info")] + public object Info { get; private set; } } } diff --git a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/ErrorDetail.cs b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/ErrorDetail.cs new file mode 100644 index 000000000000..ae44c42a8acd --- /dev/null +++ b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/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.DevTestLabs.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/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/BulkCreationParameters.cs b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/ErrorResponse.cs similarity index 55% rename from sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/BulkCreationParameters.cs rename to sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/ErrorResponse.cs index 218660d8d138..fb20517fe0fc 100644 --- a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/BulkCreationParameters.cs +++ b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/ErrorResponse.cs @@ -14,26 +14,30 @@ namespace Microsoft.Azure.Management.DevTestLabs.Models using System.Linq; /// - /// Parameters for creating multiple virtual machines as a single action. + /// Error response /// - public partial class BulkCreationParameters + /// + /// Common error response for all Azure Resource Manager APIs to return + /// error details for failed operations. (This also follows the OData error + /// response format.). + /// + public partial class ErrorResponse { /// - /// Initializes a new instance of the BulkCreationParameters class. + /// Initializes a new instance of the ErrorResponse class. /// - public BulkCreationParameters() + public ErrorResponse() { CustomInit(); } /// - /// Initializes a new instance of the BulkCreationParameters class. + /// Initializes a new instance of the ErrorResponse class. /// - /// The number of virtual machine instances - /// to create. - public BulkCreationParameters(int? instanceCount = default(int?)) + /// The error object. + public ErrorResponse(ErrorDetail error = default(ErrorDetail)) { - InstanceCount = instanceCount; + Error = error; CustomInit(); } @@ -43,10 +47,10 @@ public BulkCreationParameters() partial void CustomInit(); /// - /// Gets or sets the number of virtual machine instances to create. + /// Gets or sets the error object. /// - [JsonProperty(PropertyName = "instanceCount")] - public int? InstanceCount { get; set; } + [JsonProperty(PropertyName = "error")] + public ErrorDetail Error { get; set; } } } diff --git a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/EventFragment.cs b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/EventFragment.cs deleted file mode 100644 index 70a246af5764..000000000000 --- a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/EventFragment.cs +++ /dev/null @@ -1,55 +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.DevTestLabs.Models -{ - using Newtonsoft.Json; - using System.Linq; - - /// - /// An event to be notified for. - /// - public partial class EventFragment - { - /// - /// Initializes a new instance of the EventFragment class. - /// - public EventFragment() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the EventFragment class. - /// - /// The event type for which this notification - /// is enabled (i.e. AutoShutdown, Cost). Possible values include: - /// 'AutoShutdown', 'Cost' - public EventFragment(string eventName = default(string)) - { - EventName = eventName; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the event type for which this notification is enabled - /// (i.e. AutoShutdown, Cost). Possible values include: 'AutoShutdown', - /// 'Cost' - /// - [JsonProperty(PropertyName = "eventName")] - public string EventName { get; set; } - - } -} diff --git a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/Formula.cs b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/Formula.cs index 7263423b236b..6db56cb6978c 100644 --- a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/Formula.cs +++ b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/Formula.cs @@ -22,7 +22,7 @@ namespace Microsoft.Azure.Management.DevTestLabs.Models /// parameters /// [Rest.Serialization.JsonTransformation] - public partial class Formula : Resource + public partial class Formula : TrackedResource { /// /// Initializes a new instance of the Formula class. @@ -35,34 +35,361 @@ public Formula() /// /// Initializes a new instance of the Formula class. /// - /// The identifier of the resource. - /// The name of the resource. - /// The type of the resource. - /// The location of the resource. - /// The tags of the resource. + /// The geo-location where the resource + /// lives + /// The geo-location where the resource + /// lives + /// The geo-location where the resource + /// lives + /// Fully qualified resource ID for the resource. Ex - + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + /// The name of the resource + /// The type of the resource. E.g. + /// "Microsoft.Compute/virtualMachines" or + /// "Microsoft.Storage/storageAccounts" + /// Resource tags. /// The description of the formula. /// The author of the formula. /// The OS type of the formula. /// The creation date of the /// formula. - /// The content of the formula. - /// Information about a VM from which a formula is to - /// be created. + /// The number of virtual machine instances + /// to create. + /// The notes of the virtual machine. + /// The object identifier of the owner of + /// the virtual machine. + /// The user principal name of the + /// virtual machine owner. + /// The object identifier of the creator + /// of the virtual machine. + /// The email address of creator of the + /// virtual machine. + /// The creation date of the virtual + /// machine. + /// The resource identifier (Microsoft.Compute) + /// of the virtual machine. + /// The custom image identifier of the + /// virtual machine. + /// The shared gallery image + /// version resource identifier of the virtual machine. + /// The shared image resource identifier of + /// the virtual machine. + /// The shared image version for the + /// specified shared image Id. Will use latest if not + /// specified. + /// The OS type of the virtual machine. + /// The size of the virtual machine. + /// The user name of the virtual + /// machine. + /// The password of the virtual machine + /// administrator. + /// The SSH key of the virtual machine + /// administrator. + /// Indicates whether this + /// virtual machine uses an SSH key for authentication. + /// The fully-qualified domain name of the virtual + /// machine. + /// The lab subnet name of the virtual + /// machine. + /// The lab virtual network + /// identifier of the virtual machine. + /// Indicates whether the virtual + /// machine is to be created without a public IP address. + /// The artifacts to be installed on the + /// virtual machine. + /// The deployment status of the + /// artifact. + /// The total count of the artifacts + /// that were successfully applied. + /// The total count of the artifacts that + /// were tentatively applied. + /// The offer of the gallery image. + /// The publisher of the gallery image. + /// The SKU of the gallery image. + /// The OS type of the gallery image. + /// The version of the gallery image. + /// The id of the plan associated with the virtual + /// machine image + /// Specifies the size of an empty data disk + /// in gigabytes. This element can be used to overwrite the size of the + /// disk in a virtual machine image. + /// Gets the statuses of the virtual + /// machine. + /// Gets the OS type of the virtual + /// machine. + /// Gets the size of the virtual machine. + /// Gets the network interface ID of + /// the virtual machine. + /// Gets OS disk blob uri for the virtual + /// machine. + /// Gets data disks blob uri for the virtual + /// machine. + /// Gets all data disks attached to the virtual + /// machine. + /// The resource ID of the virtual + /// network. + /// The resource ID of the sub net. + /// The resource ID of the public IP + /// address. + /// The public IP address. + /// The private IP address. + /// The DNS name. + /// The RdpAuthority property is a server + /// DNS host name or IP address followed by the service port number for + /// RDP (Remote Desktop Protocol). + /// The SshAuthority property is a server + /// DNS host name or IP address followed by the service port number for + /// SSH. + /// The incoming NAT rules + /// Resource tags + /// Fully qualified resource ID for the + /// resource. Ex - + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + /// The name of the resource + /// The type of the resource. E.g. + /// "Microsoft.Compute/virtualMachines" or + /// "Microsoft.Storage/storageAccounts" + /// Resource tags. + /// The status of the schedule (i.e. Enabled, + /// Disabled). Possible values include: 'Enabled', 'Disabled' + /// The task type of the schedule (e.g. + /// LabVmsShutdownTask, LabVmAutoStart). + /// The days of the week for which the schedule + /// is set (e.g. Sunday, Monday, Tuesday, etc.). + /// The time of the day the schedule will + /// occur. + /// The time of day the schedule will + /// occur. + /// Minutes of the hour the schedule will + /// run. + /// The time zone ID (e.g. Pacific Standard + /// time). + /// If notifications are enabled for this + /// schedule (i.e. Enabled, Disabled). Possible values include: + /// 'Enabled', 'Disabled' + /// Time in minutes before event at which + /// notification will be sent. + /// The webhook URL to which the notification + /// will be sent. + /// The email recipient to send + /// notifications to (can be a list of semi-colon separated email + /// addresses). + /// The locale to use when sending a + /// notification (fallback for unsupported languages is EN). + /// The creation date of the + /// schedule. + /// The resource ID to which the + /// schedule belongs /// The provisioning status of the /// resource. /// The unique immutable identifier of a /// resource (Guid). - public Formula(string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), string description = default(string), string author = default(string), string osType = default(string), System.DateTime? creationDate = default(System.DateTime?), LabVirtualMachineCreationParameter formulaContent = default(LabVirtualMachineCreationParameter), FormulaPropertiesFromVm vm = default(FormulaPropertiesFromVm), string provisioningState = default(string), string uniqueIdentifier = default(string)) - : base(id, name, type, location, tags) + /// The system metadata relating to + /// this resource + /// Fully qualified resource ID for the resource. Ex + /// - + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + /// The name of the resource + /// The type of the resource. E.g. + /// "Microsoft.Compute/virtualMachines" or + /// "Microsoft.Storage/storageAccounts" + /// Resource tags. + /// The status of the schedule (i.e. Enabled, + /// Disabled). Possible values include: 'Enabled', 'Disabled' + /// The task type of the schedule (e.g. + /// LabVmsShutdownTask, LabVmAutoStart). + /// The days of the week for which the schedule + /// is set (e.g. Sunday, Monday, Tuesday, etc.). + /// The time of the day the schedule will + /// occur. + /// The time of day the schedule will + /// occur. + /// Minutes of the hour the schedule will + /// run. + /// The time zone ID (e.g. Pacific Standard + /// time). + /// If notifications are enabled for this + /// schedule (i.e. Enabled, Disabled). Possible values include: + /// 'Enabled', 'Disabled' + /// Time in minutes before event at which + /// notification will be sent. + /// The webhook URL to which the notification + /// will be sent. + /// The email recipient to send + /// notifications to (can be a list of semi-colon separated email + /// addresses). + /// The locale to use when sending a + /// notification (fallback for unsupported languages is EN). + /// The creation date of the + /// schedule. + /// The resource ID to which the + /// schedule belongs + /// The provisioning status of the + /// resource. + /// The unique immutable identifier of + /// a resource (Guid). + /// The system metadata relating to this + /// resource + /// The system metadata relating to this + /// resource + /// The expiration date for VM. + /// Indicates whether another user can take + /// ownership of the virtual machine + /// Storage type to use for virtual machine + /// (i.e. Standard, Premium, StandardSSD). Possible values include: + /// 'Standard', 'Premium', 'StandardSSD' + /// Tells source of creation + /// of lab virtual machine. Output property only. Possible values + /// include: 'FromCustomImage', 'FromGalleryImage', + /// 'FromSharedGalleryImage' + /// The resource ID of the environment that + /// contains this virtual machine, if any. + /// New or existing data disks to + /// attach to the virtual machine after creation + /// Virtual Machine schedules to be + /// created + /// Last known compute power state + /// captured in DTL + /// Flag to determine if apply + /// artifacts can be triggered at the time of fetching the + /// document. + /// The provisioning status of the + /// resource. + /// The unique immutable identifier of + /// a resource (Guid). + /// The name of the virtual machine or + /// environment + /// The location of the new virtual machine or + /// environment + /// The tags of the resource. + /// The identifier of the VM from which a formula + /// is to be created. + /// The provisioning status of the + /// resource. + /// The unique immutable identifier of + /// a resource (Guid). + /// The system metadata relating to this + /// resource + public Formula(string location, string formulaLocation, string location1, string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), string description = default(string), string author = default(string), string osType = default(string), System.DateTime? creationDate = default(System.DateTime?), int? instanceCount = default(int?), string notes = default(string), string ownerObjectId = default(string), string ownerUserPrincipalName = default(string), string createdByUserId = default(string), string createdByUser = default(string), System.DateTime? createdDate = default(System.DateTime?), string computeId = default(string), string customImageId = default(string), string galleryImageVersionId = default(string), string sharedImageId = default(string), string sharedImageVersion = default(string), string osType1 = default(string), string size = default(string), string userName = default(string), string password = default(string), string sshKey = default(string), bool? isAuthenticationWithSshKey = default(bool?), string fqdn = default(string), string labSubnetName = default(string), string labVirtualNetworkId = default(string), bool? disallowPublicIpAddress = default(bool?), IList artifacts = default(IList), string deploymentStatus = default(string), int? artifactsApplied = default(int?), int? totalArtifacts = default(int?), string offer = default(string), string publisher = default(string), string sku = default(string), string osType2 = default(string), string version = default(string), string planId = default(string), int? osDiskSizeGb = default(int?), IList statuses = default(IList), string osType3 = default(string), string vmSize = default(string), string networkInterfaceId = default(string), string osDiskId = default(string), IList dataDiskIds = default(IList), IList dataDisks = default(IList), string virtualNetworkId = default(string), string subnetId = default(string), string publicIpAddressId = default(string), string publicIpAddress = default(string), string privateIpAddress = default(string), string dnsName = default(string), string rdpAuthority = default(string), string sshAuthority = default(string), IList inboundNatRules = default(IList), IDictionary tagsProperty = default(IDictionary), string formulaId = default(string), string formulaName = default(string), string formulaType = default(string), IDictionary formulaTags = default(IDictionary), string status = default(string), string taskType = default(string), IList weekdays = default(IList), string time = default(string), string time1 = default(string), int? minute = default(int?), string timeZoneId = default(string), string status1 = default(string), int? timeInMinutes = default(int?), string webhookUrl = default(string), string emailRecipient = default(string), string notificationLocale = default(string), System.DateTime? createdDate1 = default(System.DateTime?), string targetResourceId = default(string), string provisioningState = default(string), string uniqueIdentifier = default(string), SystemData scheduleSystemData = default(SystemData), string id1 = default(string), string name1 = default(string), string type1 = default(string), IDictionary tags1 = default(IDictionary), string status2 = default(string), string taskType1 = default(string), IList weekdays1 = default(IList), string time2 = default(string), string time3 = default(string), int? minute1 = default(int?), string timeZoneId1 = default(string), string status3 = default(string), int? timeInMinutes1 = default(int?), string webhookUrl1 = default(string), string emailRecipient1 = default(string), string notificationLocale1 = default(string), System.DateTime? createdDate2 = default(System.DateTime?), string targetResourceId1 = default(string), string provisioningState1 = default(string), string uniqueIdentifier1 = default(string), SystemData systemData1 = default(SystemData), SystemData systemData2 = default(SystemData), System.DateTime? expirationDate = default(System.DateTime?), bool? allowClaim = default(bool?), string storageType = default(string), string virtualMachineCreationSource = default(string), string environmentId = default(string), IList dataDiskParameters = default(IList), IList scheduleParameters = default(IList), string lastKnownPowerState = default(string), bool? canApplyArtifacts = default(bool?), string provisioningState2 = default(string), string uniqueIdentifier2 = default(string), string name2 = default(string), string location2 = default(string), IDictionary tags2 = default(IDictionary), string labVmId = default(string), string provisioningState3 = default(string), string uniqueIdentifier3 = default(string), SystemData systemData = default(SystemData)) + : base(location, id, name, type, tags) { Description = description; Author = author; OsType = osType; CreationDate = creationDate; - FormulaContent = formulaContent; - Vm = vm; + InstanceCount = instanceCount; + Notes = notes; + OwnerObjectId = ownerObjectId; + OwnerUserPrincipalName = ownerUserPrincipalName; + CreatedByUserId = createdByUserId; + CreatedByUser = createdByUser; + CreatedDate = createdDate; + ComputeId = computeId; + CustomImageId = customImageId; + GalleryImageVersionId = galleryImageVersionId; + SharedImageId = sharedImageId; + SharedImageVersion = sharedImageVersion; + OsType1 = osType1; + Size = size; + UserName = userName; + Password = password; + SshKey = sshKey; + IsAuthenticationWithSshKey = isAuthenticationWithSshKey; + Fqdn = fqdn; + LabSubnetName = labSubnetName; + LabVirtualNetworkId = labVirtualNetworkId; + DisallowPublicIpAddress = disallowPublicIpAddress; + Artifacts = artifacts; + DeploymentStatus = deploymentStatus; + ArtifactsApplied = artifactsApplied; + TotalArtifacts = totalArtifacts; + Offer = offer; + Publisher = publisher; + Sku = sku; + OsType2 = osType2; + Version = version; + PlanId = planId; + OsDiskSizeGb = osDiskSizeGb; + Statuses = statuses; + OsType3 = osType3; + VmSize = vmSize; + NetworkInterfaceId = networkInterfaceId; + OsDiskId = osDiskId; + DataDiskIds = dataDiskIds; + DataDisks = dataDisks; + VirtualNetworkId = virtualNetworkId; + SubnetId = subnetId; + PublicIpAddressId = publicIpAddressId; + PublicIpAddress = publicIpAddress; + PrivateIpAddress = privateIpAddress; + DnsName = dnsName; + RdpAuthority = rdpAuthority; + SshAuthority = sshAuthority; + InboundNatRules = inboundNatRules; + TagsProperty = tagsProperty; + FormulaId = formulaId; + FormulaName = formulaName; + FormulaType = formulaType; + FormulaTags = formulaTags; + FormulaLocation = formulaLocation; + Status = status; + TaskType = taskType; + Weekdays = weekdays; + Time = time; + Time1 = time1; + Minute = minute; + TimeZoneId = timeZoneId; + Status1 = status1; + TimeInMinutes = timeInMinutes; + WebhookUrl = webhookUrl; + EmailRecipient = emailRecipient; + NotificationLocale = notificationLocale; + CreatedDate1 = createdDate1; + TargetResourceId = targetResourceId; ProvisioningState = provisioningState; UniqueIdentifier = uniqueIdentifier; + ScheduleSystemData = scheduleSystemData; + Id1 = id1; + Name1 = name1; + Type1 = type1; + Tags1 = tags1; + Location1 = location1; + Status2 = status2; + TaskType1 = taskType1; + Weekdays1 = weekdays1; + Time2 = time2; + Time3 = time3; + Minute1 = minute1; + TimeZoneId1 = timeZoneId1; + Status3 = status3; + TimeInMinutes1 = timeInMinutes1; + WebhookUrl1 = webhookUrl1; + EmailRecipient1 = emailRecipient1; + NotificationLocale1 = notificationLocale1; + CreatedDate2 = createdDate2; + TargetResourceId1 = targetResourceId1; + ProvisioningState1 = provisioningState1; + UniqueIdentifier1 = uniqueIdentifier1; + SystemData1 = systemData1; + SystemData2 = systemData2; + ExpirationDate = expirationDate; + AllowClaim = allowClaim; + StorageType = storageType; + VirtualMachineCreationSource = virtualMachineCreationSource; + EnvironmentId = environmentId; + DataDiskParameters = dataDiskParameters; + ScheduleParameters = scheduleParameters; + LastKnownPowerState = lastKnownPowerState; + CanApplyArtifacts = canApplyArtifacts; + ProvisioningState2 = provisioningState2; + UniqueIdentifier2 = uniqueIdentifier2; + Name2 = name2; + Location2 = location2; + Tags2 = tags2; + LabVmId = labVmId; + ProvisioningState3 = provisioningState3; + UniqueIdentifier3 = uniqueIdentifier3; + SystemData = systemData; CustomInit(); } @@ -78,10 +405,10 @@ public Formula() public string Description { get; set; } /// - /// Gets or sets the author of the formula. + /// Gets the author of the formula. /// [JsonProperty(PropertyName = "properties.author")] - public string Author { get; set; } + public string Author { get; private set; } /// /// Gets or sets the OS type of the formula. @@ -96,29 +423,747 @@ public Formula() public System.DateTime? CreationDate { get; private set; } /// - /// Gets or sets the content of the formula. + /// Gets or sets the number of virtual machine instances to create. + /// + [JsonProperty(PropertyName = "properties.formulaContent.properties.bulkCreationParameters.instanceCount")] + public int? InstanceCount { get; set; } + + /// + /// Gets or sets the notes of the virtual machine. + /// + [JsonProperty(PropertyName = "properties.formulaContent.properties.notes")] + public string Notes { get; set; } + + /// + /// Gets or sets the object identifier of the owner of the virtual + /// machine. + /// + [JsonProperty(PropertyName = "properties.formulaContent.properties.ownerObjectId")] + public string OwnerObjectId { get; set; } + + /// + /// Gets or sets the user principal name of the virtual machine owner. + /// + [JsonProperty(PropertyName = "properties.formulaContent.properties.ownerUserPrincipalName")] + public string OwnerUserPrincipalName { get; set; } + + /// + /// Gets the object identifier of the creator of the virtual machine. + /// + [JsonProperty(PropertyName = "properties.formulaContent.properties.createdByUserId")] + public string CreatedByUserId { get; private set; } + + /// + /// Gets the email address of creator of the virtual machine. + /// + [JsonProperty(PropertyName = "properties.formulaContent.properties.createdByUser")] + public string CreatedByUser { get; private set; } + + /// + /// Gets or sets the creation date of the virtual machine. + /// + [JsonProperty(PropertyName = "properties.formulaContent.properties.createdDate")] + public System.DateTime? CreatedDate { get; set; } + + /// + /// Gets the resource identifier (Microsoft.Compute) of the virtual + /// machine. + /// + [JsonProperty(PropertyName = "properties.formulaContent.properties.computeId")] + public string ComputeId { get; private set; } + + /// + /// Gets or sets the custom image identifier of the virtual machine. + /// + [JsonProperty(PropertyName = "properties.formulaContent.properties.customImageId")] + public string CustomImageId { get; set; } + + /// + /// Gets or sets the shared gallery image version resource identifier + /// of the virtual machine. + /// + [JsonProperty(PropertyName = "properties.formulaContent.properties.galleryImageVersionId")] + public string GalleryImageVersionId { get; set; } + + /// + /// Gets or sets the shared image resource identifier of the virtual + /// machine. + /// + [JsonProperty(PropertyName = "properties.formulaContent.properties.sharedImageId")] + public string SharedImageId { get; set; } + + /// + /// Gets or sets the shared image version for the specified shared + /// image Id. Will use latest if not specified. + /// + [JsonProperty(PropertyName = "properties.formulaContent.properties.sharedImageVersion")] + public string SharedImageVersion { get; set; } + + /// + /// Gets the OS type of the virtual machine. + /// + [JsonProperty(PropertyName = "properties.formulaContent.properties.osType")] + public string OsType1 { get; private set; } + + /// + /// Gets or sets the size of the virtual machine. + /// + [JsonProperty(PropertyName = "properties.formulaContent.properties.size")] + public string Size { get; set; } + + /// + /// Gets or sets the user name of the virtual machine. + /// + [JsonProperty(PropertyName = "properties.formulaContent.properties.userName")] + public string UserName { get; set; } + + /// + /// Gets or sets the password of the virtual machine administrator. + /// + [JsonProperty(PropertyName = "properties.formulaContent.properties.password")] + public string Password { get; set; } + + /// + /// Gets or sets the SSH key of the virtual machine administrator. + /// + [JsonProperty(PropertyName = "properties.formulaContent.properties.sshKey")] + public string SshKey { get; set; } + + /// + /// Gets or sets indicates whether this virtual machine uses an SSH key + /// for authentication. + /// + [JsonProperty(PropertyName = "properties.formulaContent.properties.isAuthenticationWithSshKey")] + public bool? IsAuthenticationWithSshKey { get; set; } + + /// + /// Gets the fully-qualified domain name of the virtual machine. + /// + [JsonProperty(PropertyName = "properties.formulaContent.properties.fqdn")] + public string Fqdn { get; private set; } + + /// + /// Gets or sets the lab subnet name of the virtual machine. + /// + [JsonProperty(PropertyName = "properties.formulaContent.properties.labSubnetName")] + public string LabSubnetName { get; set; } + + /// + /// Gets or sets the lab virtual network identifier of the virtual + /// machine. + /// + [JsonProperty(PropertyName = "properties.formulaContent.properties.labVirtualNetworkId")] + public string LabVirtualNetworkId { get; set; } + + /// + /// Gets or sets indicates whether the virtual machine is to be created + /// without a public IP address. + /// + [JsonProperty(PropertyName = "properties.formulaContent.properties.disallowPublicIpAddress")] + public bool? DisallowPublicIpAddress { get; set; } + + /// + /// Gets or sets the artifacts to be installed on the virtual machine. + /// + [JsonProperty(PropertyName = "properties.formulaContent.properties.artifacts")] + public IList Artifacts { get; set; } + + /// + /// Gets or sets the deployment status of the artifact. + /// + [JsonProperty(PropertyName = "properties.formulaContent.properties.artifactDeploymentStatus.deploymentStatus")] + public string DeploymentStatus { get; set; } + + /// + /// Gets or sets the total count of the artifacts that were + /// successfully applied. + /// + [JsonProperty(PropertyName = "properties.formulaContent.properties.artifactDeploymentStatus.artifactsApplied")] + public int? ArtifactsApplied { get; set; } + + /// + /// Gets or sets the total count of the artifacts that were tentatively + /// applied. + /// + [JsonProperty(PropertyName = "properties.formulaContent.properties.artifactDeploymentStatus.totalArtifacts")] + public int? TotalArtifacts { get; set; } + + /// + /// Gets or sets the offer of the gallery image. + /// + [JsonProperty(PropertyName = "properties.formulaContent.properties.galleryImageReference.offer")] + public string Offer { get; set; } + + /// + /// Gets or sets the publisher of the gallery image. + /// + [JsonProperty(PropertyName = "properties.formulaContent.properties.galleryImageReference.publisher")] + public string Publisher { get; set; } + + /// + /// Gets or sets the SKU of the gallery image. + /// + [JsonProperty(PropertyName = "properties.formulaContent.properties.galleryImageReference.sku")] + public string Sku { get; set; } + + /// + /// Gets or sets the OS type of the gallery image. + /// + [JsonProperty(PropertyName = "properties.formulaContent.properties.galleryImageReference.osType")] + public string OsType2 { get; set; } + + /// + /// Gets or sets the version of the gallery image. + /// + [JsonProperty(PropertyName = "properties.formulaContent.properties.galleryImageReference.version")] + public string Version { get; set; } + + /// + /// Gets or sets the id of the plan associated with the virtual machine + /// image + /// + [JsonProperty(PropertyName = "properties.formulaContent.properties.planId")] + public string PlanId { get; set; } + + /// + /// Gets or sets specifies the size of an empty data disk in gigabytes. + /// This element can be used to overwrite the size of the disk in a + /// virtual machine image. + /// + [JsonProperty(PropertyName = "properties.formulaContent.properties.osDiskSizeGb")] + public int? OsDiskSizeGb { get; set; } + + /// + /// Gets the statuses of the virtual machine. + /// + [JsonProperty(PropertyName = "properties.formulaContent.properties.computeVm.statuses")] + public IList Statuses { get; set; } + + /// + /// Gets the OS type of the virtual machine. + /// + [JsonProperty(PropertyName = "properties.formulaContent.properties.computeVm.osType")] + public string OsType3 { get; set; } + + /// + /// Gets the size of the virtual machine. + /// + [JsonProperty(PropertyName = "properties.formulaContent.properties.computeVm.vmSize")] + public string VmSize { get; set; } + + /// + /// Gets the network interface ID of the virtual machine. + /// + [JsonProperty(PropertyName = "properties.formulaContent.properties.computeVm.networkInterfaceId")] + public string NetworkInterfaceId { get; set; } + + /// + /// Gets OS disk blob uri for the virtual machine. + /// + [JsonProperty(PropertyName = "properties.formulaContent.properties.computeVm.osDiskId")] + public string OsDiskId { get; set; } + + /// + /// Gets data disks blob uri for the virtual machine. + /// + [JsonProperty(PropertyName = "properties.formulaContent.properties.computeVm.dataDiskIds")] + public IList DataDiskIds { get; set; } + + /// + /// Gets all data disks attached to the virtual machine. + /// + [JsonProperty(PropertyName = "properties.formulaContent.properties.computeVm.dataDisks")] + public IList DataDisks { get; set; } + + /// + /// Gets or sets the resource ID of the virtual network. + /// + [JsonProperty(PropertyName = "properties.formulaContent.properties.networkInterface.virtualNetworkId")] + public string VirtualNetworkId { get; set; } + + /// + /// Gets or sets the resource ID of the sub net. + /// + [JsonProperty(PropertyName = "properties.formulaContent.properties.networkInterface.subnetId")] + public string SubnetId { get; set; } + + /// + /// Gets or sets the resource ID of the public IP address. + /// + [JsonProperty(PropertyName = "properties.formulaContent.properties.networkInterface.publicIpAddressId")] + public string PublicIpAddressId { get; set; } + + /// + /// Gets or sets the public IP address. + /// + [JsonProperty(PropertyName = "properties.formulaContent.properties.networkInterface.publicIpAddress")] + public string PublicIpAddress { get; set; } + + /// + /// Gets or sets the private IP address. + /// + [JsonProperty(PropertyName = "properties.formulaContent.properties.networkInterface.privateIpAddress")] + public string PrivateIpAddress { get; set; } + + /// + /// Gets or sets the DNS name. + /// + [JsonProperty(PropertyName = "properties.formulaContent.properties.networkInterface.dnsName")] + public string DnsName { get; set; } + + /// + /// Gets or sets the RdpAuthority property is a server DNS host name or + /// IP address followed by the service port number for RDP (Remote + /// Desktop Protocol). + /// + [JsonProperty(PropertyName = "properties.formulaContent.properties.networkInterface.rdpAuthority")] + public string RdpAuthority { get; set; } + + /// + /// Gets or sets the SshAuthority property is a server DNS host name or + /// IP address followed by the service port number for SSH. + /// + [JsonProperty(PropertyName = "properties.formulaContent.properties.networkInterface.sshAuthority")] + public string SshAuthority { get; set; } + + /// + /// Gets or sets the incoming NAT rules + /// + [JsonProperty(PropertyName = "properties.formulaContent.properties.networkInterface.sharedPublicIpAddressConfiguration.inboundNatRules")] + public IList InboundNatRules { get; set; } + + /// + /// Gets or sets resource tags + /// + [JsonProperty(PropertyName = "properties.formulaContent.properties.applicableSchedule.tags")] + public IDictionary TagsProperty { get; set; } + + /// + /// Gets fully qualified resource ID for the resource. Ex - + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + /// + [JsonProperty(PropertyName = "properties.formulaContent.properties.applicableSchedule.properties.labVmsShutdown.id")] + public string FormulaId { get; private set; } + + /// + /// Gets the name of the resource + /// + [JsonProperty(PropertyName = "properties.formulaContent.properties.applicableSchedule.properties.labVmsShutdown.name")] + public string FormulaName { get; private set; } + + /// + /// Gets the type of the resource. E.g. + /// "Microsoft.Compute/virtualMachines" or + /// "Microsoft.Storage/storageAccounts" + /// + [JsonProperty(PropertyName = "properties.formulaContent.properties.applicableSchedule.properties.labVmsShutdown.type")] + public string FormulaType { get; private set; } + + /// + /// Gets or sets resource tags. + /// + [JsonProperty(PropertyName = "properties.formulaContent.properties.applicableSchedule.properties.labVmsShutdown.tags")] + public IDictionary FormulaTags { get; set; } + + /// + /// Gets or sets the geo-location where the resource lives + /// + [JsonProperty(PropertyName = "properties.formulaContent.properties.applicableSchedule.properties.labVmsShutdown.location")] + public string FormulaLocation { get; set; } + + /// + /// Gets or sets the status of the schedule (i.e. Enabled, Disabled). + /// Possible values include: 'Enabled', 'Disabled' + /// + [JsonProperty(PropertyName = "properties.formulaContent.properties.applicableSchedule.properties.labVmsShutdown.properties.status")] + public string Status { get; set; } + + /// + /// Gets or sets the task type of the schedule (e.g. + /// LabVmsShutdownTask, LabVmAutoStart). + /// + [JsonProperty(PropertyName = "properties.formulaContent.properties.applicableSchedule.properties.labVmsShutdown.properties.taskType")] + public string TaskType { get; set; } + + /// + /// Gets or sets the days of the week for which the schedule is set + /// (e.g. Sunday, Monday, Tuesday, etc.). + /// + [JsonProperty(PropertyName = "properties.formulaContent.properties.applicableSchedule.properties.labVmsShutdown.properties.weeklyRecurrence.weekdays")] + public IList Weekdays { get; set; } + + /// + /// Gets or sets the time of the day the schedule will occur. + /// + [JsonProperty(PropertyName = "properties.formulaContent.properties.applicableSchedule.properties.labVmsShutdown.properties.weeklyRecurrence.time")] + public string Time { get; set; } + + /// + /// Gets or sets the time of day the schedule will occur. + /// + [JsonProperty(PropertyName = "properties.formulaContent.properties.applicableSchedule.properties.labVmsShutdown.properties.dailyRecurrence.time")] + public string Time1 { get; set; } + + /// + /// Gets or sets minutes of the hour the schedule will run. + /// + [JsonProperty(PropertyName = "properties.formulaContent.properties.applicableSchedule.properties.labVmsShutdown.properties.hourlyRecurrence.minute")] + public int? Minute { get; set; } + + /// + /// Gets or sets the time zone ID (e.g. Pacific Standard time). + /// + [JsonProperty(PropertyName = "properties.formulaContent.properties.applicableSchedule.properties.labVmsShutdown.properties.timeZoneId")] + public string TimeZoneId { get; set; } + + /// + /// Gets or sets if notifications are enabled for this schedule (i.e. + /// Enabled, Disabled). Possible values include: 'Enabled', 'Disabled' + /// + [JsonProperty(PropertyName = "properties.formulaContent.properties.applicableSchedule.properties.labVmsShutdown.properties.notificationSettings.status")] + public string Status1 { get; set; } + + /// + /// Gets or sets time in minutes before event at which notification + /// will be sent. + /// + [JsonProperty(PropertyName = "properties.formulaContent.properties.applicableSchedule.properties.labVmsShutdown.properties.notificationSettings.timeInMinutes")] + public int? TimeInMinutes { get; set; } + + /// + /// Gets or sets the webhook URL to which the notification will be + /// sent. + /// + [JsonProperty(PropertyName = "properties.formulaContent.properties.applicableSchedule.properties.labVmsShutdown.properties.notificationSettings.webhookUrl")] + public string WebhookUrl { get; set; } + + /// + /// Gets or sets the email recipient to send notifications to (can be a + /// list of semi-colon separated email addresses). + /// + [JsonProperty(PropertyName = "properties.formulaContent.properties.applicableSchedule.properties.labVmsShutdown.properties.notificationSettings.emailRecipient")] + public string EmailRecipient { get; set; } + + /// + /// Gets or sets the locale to use when sending a notification + /// (fallback for unsupported languages is EN). + /// + [JsonProperty(PropertyName = "properties.formulaContent.properties.applicableSchedule.properties.labVmsShutdown.properties.notificationSettings.notificationLocale")] + public string NotificationLocale { get; set; } + + /// + /// Gets the creation date of the schedule. + /// + [JsonProperty(PropertyName = "properties.formulaContent.properties.applicableSchedule.properties.labVmsShutdown.properties.createdDate")] + public System.DateTime? CreatedDate1 { get; private set; } + + /// + /// Gets or sets the resource ID to which the schedule belongs + /// + [JsonProperty(PropertyName = "properties.formulaContent.properties.applicableSchedule.properties.labVmsShutdown.properties.targetResourceId")] + public string TargetResourceId { get; set; } + + /// + /// Gets the provisioning status of the resource. + /// + [JsonProperty(PropertyName = "properties.formulaContent.properties.applicableSchedule.properties.labVmsShutdown.properties.provisioningState")] + public string ProvisioningState { get; private set; } + + /// + /// Gets the unique immutable identifier of a resource (Guid). + /// + [JsonProperty(PropertyName = "properties.formulaContent.properties.applicableSchedule.properties.labVmsShutdown.properties.uniqueIdentifier")] + public string UniqueIdentifier { get; private set; } + + /// + /// Gets the system metadata relating to this resource + /// + [JsonProperty(PropertyName = "properties.formulaContent.properties.applicableSchedule.properties.labVmsShutdown.systemData")] + public SystemData ScheduleSystemData { get; private set; } + + /// + /// Gets fully qualified resource ID for the resource. Ex - + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + /// + [JsonProperty(PropertyName = "properties.formulaContent.properties.applicableSchedule.properties.labVmsStartup.id")] + public string Id1 { get; private set; } + + /// + /// Gets the name of the resource + /// + [JsonProperty(PropertyName = "properties.formulaContent.properties.applicableSchedule.properties.labVmsStartup.name")] + public string Name1 { get; private set; } + + /// + /// Gets the type of the resource. E.g. + /// "Microsoft.Compute/virtualMachines" or + /// "Microsoft.Storage/storageAccounts" + /// + [JsonProperty(PropertyName = "properties.formulaContent.properties.applicableSchedule.properties.labVmsStartup.type")] + public string Type1 { get; private set; } + + /// + /// Gets or sets resource tags. + /// + [JsonProperty(PropertyName = "properties.formulaContent.properties.applicableSchedule.properties.labVmsStartup.tags")] + public IDictionary Tags1 { get; set; } + + /// + /// Gets or sets the geo-location where the resource lives + /// + [JsonProperty(PropertyName = "properties.formulaContent.properties.applicableSchedule.properties.labVmsStartup.location")] + public string Location1 { get; set; } + + /// + /// Gets or sets the status of the schedule (i.e. Enabled, Disabled). + /// Possible values include: 'Enabled', 'Disabled' + /// + [JsonProperty(PropertyName = "properties.formulaContent.properties.applicableSchedule.properties.labVmsStartup.properties.status")] + public string Status2 { get; set; } + + /// + /// Gets or sets the task type of the schedule (e.g. + /// LabVmsShutdownTask, LabVmAutoStart). + /// + [JsonProperty(PropertyName = "properties.formulaContent.properties.applicableSchedule.properties.labVmsStartup.properties.taskType")] + public string TaskType1 { get; set; } + + /// + /// Gets or sets the days of the week for which the schedule is set + /// (e.g. Sunday, Monday, Tuesday, etc.). + /// + [JsonProperty(PropertyName = "properties.formulaContent.properties.applicableSchedule.properties.labVmsStartup.properties.weeklyRecurrence.weekdays")] + public IList Weekdays1 { get; set; } + + /// + /// Gets or sets the time of the day the schedule will occur. + /// + [JsonProperty(PropertyName = "properties.formulaContent.properties.applicableSchedule.properties.labVmsStartup.properties.weeklyRecurrence.time")] + public string Time2 { get; set; } + + /// + /// Gets or sets the time of day the schedule will occur. + /// + [JsonProperty(PropertyName = "properties.formulaContent.properties.applicableSchedule.properties.labVmsStartup.properties.dailyRecurrence.time")] + public string Time3 { get; set; } + + /// + /// Gets or sets minutes of the hour the schedule will run. + /// + [JsonProperty(PropertyName = "properties.formulaContent.properties.applicableSchedule.properties.labVmsStartup.properties.hourlyRecurrence.minute")] + public int? Minute1 { get; set; } + + /// + /// Gets or sets the time zone ID (e.g. Pacific Standard time). + /// + [JsonProperty(PropertyName = "properties.formulaContent.properties.applicableSchedule.properties.labVmsStartup.properties.timeZoneId")] + public string TimeZoneId1 { get; set; } + + /// + /// Gets or sets if notifications are enabled for this schedule (i.e. + /// Enabled, Disabled). Possible values include: 'Enabled', 'Disabled' + /// + [JsonProperty(PropertyName = "properties.formulaContent.properties.applicableSchedule.properties.labVmsStartup.properties.notificationSettings.status")] + public string Status3 { get; set; } + + /// + /// Gets or sets time in minutes before event at which notification + /// will be sent. + /// + [JsonProperty(PropertyName = "properties.formulaContent.properties.applicableSchedule.properties.labVmsStartup.properties.notificationSettings.timeInMinutes")] + public int? TimeInMinutes1 { get; set; } + + /// + /// Gets or sets the webhook URL to which the notification will be + /// sent. + /// + [JsonProperty(PropertyName = "properties.formulaContent.properties.applicableSchedule.properties.labVmsStartup.properties.notificationSettings.webhookUrl")] + public string WebhookUrl1 { get; set; } + + /// + /// Gets or sets the email recipient to send notifications to (can be a + /// list of semi-colon separated email addresses). + /// + [JsonProperty(PropertyName = "properties.formulaContent.properties.applicableSchedule.properties.labVmsStartup.properties.notificationSettings.emailRecipient")] + public string EmailRecipient1 { get; set; } + + /// + /// Gets or sets the locale to use when sending a notification + /// (fallback for unsupported languages is EN). + /// + [JsonProperty(PropertyName = "properties.formulaContent.properties.applicableSchedule.properties.labVmsStartup.properties.notificationSettings.notificationLocale")] + public string NotificationLocale1 { get; set; } + + /// + /// Gets the creation date of the schedule. + /// + [JsonProperty(PropertyName = "properties.formulaContent.properties.applicableSchedule.properties.labVmsStartup.properties.createdDate")] + public System.DateTime? CreatedDate2 { get; private set; } + + /// + /// Gets or sets the resource ID to which the schedule belongs + /// + [JsonProperty(PropertyName = "properties.formulaContent.properties.applicableSchedule.properties.labVmsStartup.properties.targetResourceId")] + public string TargetResourceId1 { get; set; } + + /// + /// Gets the provisioning status of the resource. + /// + [JsonProperty(PropertyName = "properties.formulaContent.properties.applicableSchedule.properties.labVmsStartup.properties.provisioningState")] + public string ProvisioningState1 { get; private set; } + + /// + /// Gets the unique immutable identifier of a resource (Guid). + /// + [JsonProperty(PropertyName = "properties.formulaContent.properties.applicableSchedule.properties.labVmsStartup.properties.uniqueIdentifier")] + public string UniqueIdentifier1 { get; private set; } + + /// + /// Gets the system metadata relating to this resource + /// + [JsonProperty(PropertyName = "properties.formulaContent.properties.applicableSchedule.properties.labVmsStartup.systemData")] + public SystemData SystemData1 { get; private set; } + + /// + /// Gets the system metadata relating to this resource + /// + [JsonProperty(PropertyName = "properties.formulaContent.properties.applicableSchedule.systemData")] + public SystemData SystemData2 { get; private set; } + + /// + /// Gets or sets the expiration date for VM. + /// + [JsonProperty(PropertyName = "properties.formulaContent.properties.expirationDate")] + public System.DateTime? ExpirationDate { get; set; } + + /// + /// Gets or sets indicates whether another user can take ownership of + /// the virtual machine + /// + [JsonProperty(PropertyName = "properties.formulaContent.properties.allowClaim")] + public bool? AllowClaim { get; set; } + + /// + /// Gets or sets storage type to use for virtual machine (i.e. + /// Standard, Premium, StandardSSD). Possible values include: + /// 'Standard', 'Premium', 'StandardSSD' + /// + [JsonProperty(PropertyName = "properties.formulaContent.properties.storageType")] + public string StorageType { get; set; } + + /// + /// Gets tells source of creation of lab virtual machine. Output + /// property only. Possible values include: 'FromCustomImage', + /// 'FromGalleryImage', 'FromSharedGalleryImage' + /// + [JsonProperty(PropertyName = "properties.formulaContent.properties.virtualMachineCreationSource")] + public string VirtualMachineCreationSource { get; private set; } + + /// + /// Gets or sets the resource ID of the environment that contains this + /// virtual machine, if any. + /// + [JsonProperty(PropertyName = "properties.formulaContent.properties.environmentId")] + public string EnvironmentId { get; set; } + + /// + /// Gets or sets new or existing data disks to attach to the virtual + /// machine after creation + /// + [JsonProperty(PropertyName = "properties.formulaContent.properties.dataDiskParameters")] + public IList DataDiskParameters { get; set; } + + /// + /// Gets or sets virtual Machine schedules to be created /// - [JsonProperty(PropertyName = "properties.formulaContent")] - public LabVirtualMachineCreationParameter FormulaContent { get; set; } + [JsonProperty(PropertyName = "properties.formulaContent.properties.scheduleParameters")] + public IList ScheduleParameters { get; set; } /// - /// Gets or sets information about a VM from which a formula is to be + /// Gets last known compute power state captured in DTL + /// + [JsonProperty(PropertyName = "properties.formulaContent.properties.lastKnownPowerState")] + public string LastKnownPowerState { get; private set; } + + /// + /// Gets flag to determine if apply artifacts can be triggered at the + /// time of fetching the document. + /// + [JsonProperty(PropertyName = "properties.formulaContent.properties.canApplyArtifacts")] + public bool? CanApplyArtifacts { get; private set; } + + /// + /// Gets the provisioning status of the resource. + /// + [JsonProperty(PropertyName = "properties.formulaContent.properties.provisioningState")] + public string ProvisioningState2 { get; private set; } + + /// + /// Gets the unique immutable identifier of a resource (Guid). + /// + [JsonProperty(PropertyName = "properties.formulaContent.properties.uniqueIdentifier")] + public string UniqueIdentifier2 { get; private set; } + + /// + /// Gets or sets the name of the virtual machine or environment + /// + [JsonProperty(PropertyName = "properties.formulaContent.name")] + public string Name2 { get; set; } + + /// + /// Gets or sets the location of the new virtual machine or environment + /// + [JsonProperty(PropertyName = "properties.formulaContent.location")] + public string Location2 { get; set; } + + /// + /// Gets or sets the tags of the resource. + /// + [JsonProperty(PropertyName = "properties.formulaContent.tags")] + public IDictionary Tags2 { get; set; } + + /// + /// Gets or sets the identifier of the VM from which a formula is to be /// created. /// - [JsonProperty(PropertyName = "properties.vm")] - public FormulaPropertiesFromVm Vm { get; set; } + [JsonProperty(PropertyName = "properties.vm.labVmId")] + public string LabVmId { get; set; } /// /// Gets the provisioning status of the resource. /// [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; private set; } + public string ProvisioningState3 { get; private set; } /// /// Gets the unique immutable identifier of a resource (Guid). /// [JsonProperty(PropertyName = "properties.uniqueIdentifier")] - public string UniqueIdentifier { get; private set; } + public string UniqueIdentifier3 { get; private set; } + + /// + /// Gets the system metadata relating to this resource + /// + [JsonProperty(PropertyName = "systemData")] + public SystemData SystemData { get; private set; } + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public override void Validate() + { + base.Validate(); + if (FormulaLocation == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "FormulaLocation"); + } + if (Location1 == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Location1"); + } + } } } diff --git a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/FormulaFragment.cs b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/FormulaFragment.cs index a47688ce15b4..bd718a40074d 100644 --- a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/FormulaFragment.cs +++ b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/FormulaFragment.cs @@ -10,19 +10,14 @@ namespace Microsoft.Azure.Management.DevTestLabs.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; using System.Collections; using System.Collections.Generic; using System.Linq; /// - /// A formula for creating a VM, specifying an image base and other - /// parameters + /// Patch /// - [Rest.Serialization.JsonTransformation] - public partial class FormulaFragment : UpdateResource + public partial class FormulaFragment : Tags { /// /// Initializes a new instance of the FormulaFragment class. @@ -35,21 +30,10 @@ public FormulaFragment() /// /// Initializes a new instance of the FormulaFragment class. /// - /// The tags of the resource. - /// The description of the formula. - /// The author of the formula. - /// The OS type of the formula. - /// The content of the formula. - /// Information about a VM from which a formula is to - /// be created. - public FormulaFragment(IDictionary tags = default(IDictionary), string description = default(string), string author = default(string), string osType = default(string), LabVirtualMachineCreationParameterFragment formulaContent = default(LabVirtualMachineCreationParameterFragment), FormulaPropertiesFromVmFragment vm = default(FormulaPropertiesFromVmFragment)) - : base(tags) + /// Resource tags + public FormulaFragment(IDictionary tagsProperty = default(IDictionary)) + : base(tagsProperty) { - Description = description; - Author = author; - OsType = osType; - FormulaContent = formulaContent; - Vm = vm; CustomInit(); } @@ -58,36 +42,5 @@ public FormulaFragment() /// partial void CustomInit(); - /// - /// Gets or sets the description of the formula. - /// - [JsonProperty(PropertyName = "properties.description")] - public string Description { get; set; } - - /// - /// Gets or sets the author of the formula. - /// - [JsonProperty(PropertyName = "properties.author")] - public string Author { get; set; } - - /// - /// Gets or sets the OS type of the formula. - /// - [JsonProperty(PropertyName = "properties.osType")] - public string OsType { get; set; } - - /// - /// Gets or sets the content of the formula. - /// - [JsonProperty(PropertyName = "properties.formulaContent")] - public LabVirtualMachineCreationParameterFragment FormulaContent { get; set; } - - /// - /// Gets or sets information about a VM from which a formula is to be - /// created. - /// - [JsonProperty(PropertyName = "properties.vm")] - public FormulaPropertiesFromVmFragment Vm { get; set; } - } } diff --git a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/FormulaPropertiesFromVm.cs b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/FormulaPropertiesFromVm.cs deleted file mode 100644 index 8a8484790d4b..000000000000 --- a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/FormulaPropertiesFromVm.cs +++ /dev/null @@ -1,53 +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.DevTestLabs.Models -{ - using Newtonsoft.Json; - using System.Linq; - - /// - /// Information about a VM from which a formula is to be created. - /// - public partial class FormulaPropertiesFromVm - { - /// - /// Initializes a new instance of the FormulaPropertiesFromVm class. - /// - public FormulaPropertiesFromVm() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the FormulaPropertiesFromVm class. - /// - /// The identifier of the VM from which a formula - /// is to be created. - public FormulaPropertiesFromVm(string labVmId = default(string)) - { - LabVmId = labVmId; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the identifier of the VM from which a formula is to be - /// created. - /// - [JsonProperty(PropertyName = "labVmId")] - public string LabVmId { get; set; } - - } -} diff --git a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/FormulaPropertiesFromVmFragment.cs b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/FormulaPropertiesFromVmFragment.cs deleted file mode 100644 index d8a6d8b0fe34..000000000000 --- a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/FormulaPropertiesFromVmFragment.cs +++ /dev/null @@ -1,55 +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.DevTestLabs.Models -{ - using Newtonsoft.Json; - using System.Linq; - - /// - /// Information about a VM from which a formula is to be created. - /// - public partial class FormulaPropertiesFromVmFragment - { - /// - /// Initializes a new instance of the FormulaPropertiesFromVmFragment - /// class. - /// - public FormulaPropertiesFromVmFragment() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the FormulaPropertiesFromVmFragment - /// class. - /// - /// The identifier of the VM from which a formula - /// is to be created. - public FormulaPropertiesFromVmFragment(string labVmId = default(string)) - { - LabVmId = labVmId; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the identifier of the VM from which a formula is to be - /// created. - /// - [JsonProperty(PropertyName = "labVmId")] - public string LabVmId { get; set; } - - } -} diff --git a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/GalleryImage.cs b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/GalleryImage.cs index 6ce3d112757e..755247a49c13 100644 --- a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/GalleryImage.cs +++ b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/GalleryImage.cs @@ -13,8 +13,6 @@ namespace Microsoft.Azure.Management.DevTestLabs.Models using Microsoft.Rest; using Microsoft.Rest.Serialization; using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -34,18 +32,22 @@ public GalleryImage() /// /// Initializes a new instance of the GalleryImage class. /// - /// The identifier of the resource. - /// The name of the resource. - /// The type of the resource. - /// The location of the resource. - /// The tags of the resource. + /// Fully qualified resource ID for the resource. Ex - + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + /// The name of the resource + /// The type of the resource. E.g. + /// "Microsoft.Compute/virtualMachines" or + /// "Microsoft.Storage/storageAccounts" /// The author of the gallery image. /// The creation date of the gallery /// image. /// The description of the gallery /// image. - /// The image reference of the gallery - /// image. + /// The offer of the gallery image. + /// The publisher of the gallery image. + /// The SKU of the gallery image. + /// The OS type of the gallery image. + /// The version of the gallery image. /// The icon of the gallery image. /// Indicates whether this gallery image is /// enabled. @@ -53,17 +55,24 @@ public GalleryImage() /// image /// Indicates if the plan has been /// authorized for programmatic deployment. - public GalleryImage(string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), string author = default(string), System.DateTime? createdDate = default(System.DateTime?), string description = default(string), GalleryImageReference imageReference = default(GalleryImageReference), string icon = default(string), bool? enabled = default(bool?), string planId = default(string), bool? isPlanAuthorized = default(bool?)) - : base(id, name, type, location, tags) + /// The system metadata relating to this + /// resource + public GalleryImage(string id = default(string), string name = default(string), string type = default(string), string author = default(string), System.DateTime? createdDate = default(System.DateTime?), string description = default(string), string offer = default(string), string publisher = default(string), string sku = default(string), string osType = default(string), string version = default(string), string icon = default(string), bool? enabled = default(bool?), string planId = default(string), bool? isPlanAuthorized = default(bool?), SystemData systemData = default(SystemData)) + : base(id, name, type) { Author = author; CreatedDate = createdDate; Description = description; - ImageReference = imageReference; + Offer = offer; + Publisher = publisher; + Sku = sku; + OsType = osType; + Version = version; Icon = icon; Enabled = enabled; PlanId = planId; IsPlanAuthorized = isPlanAuthorized; + SystemData = systemData; CustomInit(); } @@ -91,10 +100,34 @@ public GalleryImage() public string Description { get; set; } /// - /// Gets or sets the image reference of the gallery image. + /// Gets or sets the offer of the gallery image. + /// + [JsonProperty(PropertyName = "properties.imageReference.offer")] + public string Offer { get; set; } + + /// + /// Gets or sets the publisher of the gallery image. + /// + [JsonProperty(PropertyName = "properties.imageReference.publisher")] + public string Publisher { get; set; } + + /// + /// Gets or sets the SKU of the gallery image. + /// + [JsonProperty(PropertyName = "properties.imageReference.sku")] + public string Sku { get; set; } + + /// + /// Gets or sets the OS type of the gallery image. + /// + [JsonProperty(PropertyName = "properties.imageReference.osType")] + public string OsType { get; set; } + + /// + /// Gets or sets the version of the gallery image. /// - [JsonProperty(PropertyName = "properties.imageReference")] - public GalleryImageReference ImageReference { get; set; } + [JsonProperty(PropertyName = "properties.imageReference.version")] + public string Version { get; set; } /// /// Gets or sets the icon of the gallery image. @@ -121,5 +154,11 @@ public GalleryImage() [JsonProperty(PropertyName = "properties.isPlanAuthorized")] public bool? IsPlanAuthorized { get; set; } + /// + /// Gets the system metadata relating to this resource + /// + [JsonProperty(PropertyName = "systemData")] + public SystemData SystemData { get; private set; } + } } diff --git a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/GalleryImageReference.cs b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/GalleryImageReference.cs deleted file mode 100644 index 47b51d16b606..000000000000 --- a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/GalleryImageReference.cs +++ /dev/null @@ -1,83 +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.DevTestLabs.Models -{ - using Newtonsoft.Json; - using System.Linq; - - /// - /// The reference information for an Azure Marketplace image. - /// - public partial class GalleryImageReference - { - /// - /// Initializes a new instance of the GalleryImageReference class. - /// - public GalleryImageReference() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the GalleryImageReference class. - /// - /// The offer of the gallery image. - /// The publisher of the gallery image. - /// The SKU of the gallery image. - /// The OS type of the gallery image. - /// The version of the gallery image. - public GalleryImageReference(string offer = default(string), string publisher = default(string), string sku = default(string), string osType = default(string), string version = default(string)) - { - Offer = offer; - Publisher = publisher; - Sku = sku; - OsType = osType; - Version = version; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the offer of the gallery image. - /// - [JsonProperty(PropertyName = "offer")] - public string Offer { get; set; } - - /// - /// Gets or sets the publisher of the gallery image. - /// - [JsonProperty(PropertyName = "publisher")] - public string Publisher { get; set; } - - /// - /// Gets or sets the SKU of the gallery image. - /// - [JsonProperty(PropertyName = "sku")] - public string Sku { get; set; } - - /// - /// Gets or sets the OS type of the gallery image. - /// - [JsonProperty(PropertyName = "osType")] - public string OsType { get; set; } - - /// - /// Gets or sets the version of the gallery image. - /// - [JsonProperty(PropertyName = "version")] - public string Version { get; set; } - - } -} diff --git a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/GalleryImageReferenceFragment.cs b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/GalleryImageReferenceFragment.cs deleted file mode 100644 index 690ad674a0bd..000000000000 --- a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/GalleryImageReferenceFragment.cs +++ /dev/null @@ -1,85 +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.DevTestLabs.Models -{ - using Newtonsoft.Json; - using System.Linq; - - /// - /// The reference information for an Azure Marketplace image. - /// - public partial class GalleryImageReferenceFragment - { - /// - /// Initializes a new instance of the GalleryImageReferenceFragment - /// class. - /// - public GalleryImageReferenceFragment() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the GalleryImageReferenceFragment - /// class. - /// - /// The offer of the gallery image. - /// The publisher of the gallery image. - /// The SKU of the gallery image. - /// The OS type of the gallery image. - /// The version of the gallery image. - public GalleryImageReferenceFragment(string offer = default(string), string publisher = default(string), string sku = default(string), string osType = default(string), string version = default(string)) - { - Offer = offer; - Publisher = publisher; - Sku = sku; - OsType = osType; - Version = version; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the offer of the gallery image. - /// - [JsonProperty(PropertyName = "offer")] - public string Offer { get; set; } - - /// - /// Gets or sets the publisher of the gallery image. - /// - [JsonProperty(PropertyName = "publisher")] - public string Publisher { get; set; } - - /// - /// Gets or sets the SKU of the gallery image. - /// - [JsonProperty(PropertyName = "sku")] - public string Sku { get; set; } - - /// - /// Gets or sets the OS type of the gallery image. - /// - [JsonProperty(PropertyName = "osType")] - public string OsType { get; set; } - - /// - /// Gets or sets the version of the gallery image. - /// - [JsonProperty(PropertyName = "version")] - public string Version { get; set; } - - } -} diff --git a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/GenerateUploadUriResponse.cs b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/GenerateUploadUriResponse.cs index 89138998bb1f..7e4415cb68d8 100644 --- a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/GenerateUploadUriResponse.cs +++ b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/GenerateUploadUriResponse.cs @@ -14,7 +14,7 @@ namespace Microsoft.Azure.Management.DevTestLabs.Models using System.Linq; /// - /// Reponse body for generating an upload URI. + /// Response body for generating an upload URI. /// public partial class GenerateUploadUriResponse { diff --git a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/HttpStatusCode.cs b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/HttpStatusCode.cs index ae65a3ee7c89..a3bdddb68774 100644 --- a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/HttpStatusCode.cs +++ b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/HttpStatusCode.cs @@ -18,6 +18,8 @@ public static class HttpStatusCode { public const string Continue = "Continue"; public const string SwitchingProtocols = "SwitchingProtocols"; + public const string Processing = "Processing"; + public const string EarlyHints = "EarlyHints"; public const string OK = "OK"; public const string Created = "Created"; public const string Accepted = "Accepted"; @@ -25,14 +27,23 @@ public static class HttpStatusCode public const string NoContent = "NoContent"; public const string ResetContent = "ResetContent"; public const string PartialContent = "PartialContent"; + public const string MultiStatus = "MultiStatus"; + public const string AlreadyReported = "AlreadyReported"; + public const string IMUsed = "IMUsed"; public const string MultipleChoices = "MultipleChoices"; + public const string Ambiguous = "Ambiguous"; public const string MovedPermanently = "MovedPermanently"; + public const string Moved = "Moved"; + public const string Found = "Found"; public const string Redirect = "Redirect"; public const string SeeOther = "SeeOther"; + public const string RedirectMethod = "RedirectMethod"; public const string NotModified = "NotModified"; public const string UseProxy = "UseProxy"; public const string Unused = "Unused"; public const string TemporaryRedirect = "TemporaryRedirect"; + public const string RedirectKeepVerb = "RedirectKeepVerb"; + public const string PermanentRedirect = "PermanentRedirect"; public const string BadRequest = "BadRequest"; public const string Unauthorized = "Unauthorized"; public const string PaymentRequired = "PaymentRequired"; @@ -51,12 +62,25 @@ public static class HttpStatusCode public const string UnsupportedMediaType = "UnsupportedMediaType"; public const string RequestedRangeNotSatisfiable = "RequestedRangeNotSatisfiable"; public const string ExpectationFailed = "ExpectationFailed"; + public const string MisdirectedRequest = "MisdirectedRequest"; + public const string UnprocessableEntity = "UnprocessableEntity"; + public const string Locked = "Locked"; + public const string FailedDependency = "FailedDependency"; public const string UpgradeRequired = "UpgradeRequired"; + public const string PreconditionRequired = "PreconditionRequired"; + public const string TooManyRequests = "TooManyRequests"; + public const string RequestHeaderFieldsTooLarge = "RequestHeaderFieldsTooLarge"; + public const string UnavailableForLegalReasons = "UnavailableForLegalReasons"; public const string InternalServerError = "InternalServerError"; public const string NotImplemented = "NotImplemented"; public const string BadGateway = "BadGateway"; public const string ServiceUnavailable = "ServiceUnavailable"; public const string GatewayTimeout = "GatewayTimeout"; public const string HttpVersionNotSupported = "HttpVersionNotSupported"; + public const string VariantAlsoNegotiates = "VariantAlsoNegotiates"; + public const string InsufficientStorage = "InsufficientStorage"; + public const string LoopDetected = "LoopDetected"; + public const string NotExtended = "NotExtended"; + public const string NetworkAuthenticationRequired = "NetworkAuthenticationRequired"; } } diff --git a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/Identity.cs b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/Identity.cs new file mode 100644 index 000000000000..64a91c3fd348 --- /dev/null +++ b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/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.DevTestLabs.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' + 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' + /// + [JsonProperty(PropertyName = "type")] + public ResourceIdentityType? Type { get; set; } + + } +} diff --git a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/IdentityProperties.cs b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/IdentityProperties.cs deleted file mode 100644 index 852db48b0e93..000000000000 --- a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/IdentityProperties.cs +++ /dev/null @@ -1,77 +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.DevTestLabs.Models -{ - using Newtonsoft.Json; - using System.Linq; - - /// - /// Properties of a managed identity - /// - public partial class IdentityProperties - { - /// - /// Initializes a new instance of the IdentityProperties class. - /// - public IdentityProperties() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the IdentityProperties class. - /// - /// Managed identity. - /// The principal id of resource - /// identity. - /// The tenant identifier of resource. - /// The client secret URL of the - /// identity. - public IdentityProperties(string type = default(string), string principalId = default(string), string tenantId = default(string), string clientSecretUrl = default(string)) - { - Type = type; - PrincipalId = principalId; - TenantId = tenantId; - ClientSecretUrl = clientSecretUrl; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets managed identity. - /// - [JsonProperty(PropertyName = "type")] - public string Type { get; set; } - - /// - /// Gets or sets the principal id of resource identity. - /// - [JsonProperty(PropertyName = "principalId")] - public string PrincipalId { get; set; } - - /// - /// Gets or sets the tenant identifier of resource. - /// - [JsonProperty(PropertyName = "tenantId")] - public string TenantId { get; set; } - - /// - /// Gets or sets the client secret URL of the identity. - /// - [JsonProperty(PropertyName = "clientSecretUrl")] - public string ClientSecretUrl { get; set; } - - } -} diff --git a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/ImageType.cs b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/ImageType.cs new file mode 100644 index 000000000000..9ab1ddbaa635 --- /dev/null +++ b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/ImageType.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.DevTestLabs.Models +{ + + /// + /// Defines values for ImageType. + /// + public static class ImageType + { + public const string Generalized = "Generalized"; + public const string Specialized = "Specialized"; + } +} diff --git a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/DayDetails.cs b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/ImageVersionProperties.cs similarity index 61% rename from sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/DayDetails.cs rename to sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/ImageVersionProperties.cs index 63c3ddbec6d9..f54850ca64d9 100644 --- a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/DayDetails.cs +++ b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/ImageVersionProperties.cs @@ -14,25 +14,25 @@ namespace Microsoft.Azure.Management.DevTestLabs.Models using System.Linq; /// - /// Properties of a daily schedule. + /// Properties for a shared image version. /// - public partial class DayDetails + public partial class ImageVersionProperties { /// - /// Initializes a new instance of the DayDetails class. + /// Initializes a new instance of the ImageVersionProperties class. /// - public DayDetails() + public ImageVersionProperties() { CustomInit(); } /// - /// Initializes a new instance of the DayDetails class. + /// Initializes a new instance of the ImageVersionProperties class. /// - /// The time of day the schedule will occur. - public DayDetails(string time = default(string)) + /// Image version name + public ImageVersionProperties(string name = default(string)) { - Time = time; + Name = name; CustomInit(); } @@ -42,10 +42,10 @@ public DayDetails() partial void CustomInit(); /// - /// Gets or sets the time of day the schedule will occur. + /// Gets or sets image version name /// - [JsonProperty(PropertyName = "time")] - public string Time { get; set; } + [JsonProperty(PropertyName = "name")] + public string Name { get; set; } } } diff --git a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/InboundNatRuleFragment.cs b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/InboundNatRuleFragment.cs deleted file mode 100644 index eed034717d84..000000000000 --- a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/InboundNatRuleFragment.cs +++ /dev/null @@ -1,77 +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.DevTestLabs.Models -{ - using Newtonsoft.Json; - using System.Linq; - - /// - /// A rule for NAT - exposing a VM's port (backendPort) on the public IP - /// address using a load balancer. - /// - public partial class InboundNatRuleFragment - { - /// - /// Initializes a new instance of the InboundNatRuleFragment class. - /// - public InboundNatRuleFragment() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the InboundNatRuleFragment class. - /// - /// The transport protocol for the - /// endpoint. Possible values include: 'Tcp', 'Udp' - /// The external endpoint port of the - /// inbound connection. Possible values range between 1 and 65535, - /// inclusive. If unspecified, a value will be allocated - /// automatically. - /// The port to which the external traffic - /// will be redirected. - public InboundNatRuleFragment(string transportProtocol = default(string), int? frontendPort = default(int?), int? backendPort = default(int?)) - { - TransportProtocol = transportProtocol; - FrontendPort = frontendPort; - BackendPort = backendPort; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the transport protocol for the endpoint. Possible - /// values include: 'Tcp', 'Udp' - /// - [JsonProperty(PropertyName = "transportProtocol")] - public string TransportProtocol { get; set; } - - /// - /// Gets or sets the external endpoint port of the inbound connection. - /// Possible values range between 1 and 65535, inclusive. If - /// unspecified, a value will be allocated automatically. - /// - [JsonProperty(PropertyName = "frontendPort")] - public int? FrontendPort { get; set; } - - /// - /// Gets or sets the port to which the external traffic will be - /// redirected. - /// - [JsonProperty(PropertyName = "backendPort")] - public int? BackendPort { get; set; } - - } -} diff --git a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/KeyVaultProperties.cs b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/KeyVaultProperties.cs new file mode 100644 index 000000000000..f7e3e8061d57 --- /dev/null +++ b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/KeyVaultProperties.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.DevTestLabs.Models +{ + using Newtonsoft.Json; + using System.Linq; + + public partial class KeyVaultProperties + { + /// + /// Initializes a new instance of the KeyVaultProperties class. + /// + public KeyVaultProperties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the KeyVaultProperties class. + /// + /// Key vault uri to access the encryption + /// key. + /// The client ID of the identity which will be + /// used to access key vault. + public KeyVaultProperties(string keyIdentifier = default(string), string identity = default(string)) + { + KeyIdentifier = keyIdentifier; + Identity = identity; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets key vault uri to access the encryption key. + /// + [JsonProperty(PropertyName = "keyIdentifier")] + public string KeyIdentifier { get; set; } + + /// + /// Gets or sets the client ID of the identity which will be used to + /// access key vault. + /// + [JsonProperty(PropertyName = "identity")] + public string Identity { get; set; } + + } +} diff --git a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/Lab.cs b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/Lab.cs index 59638a9abbf3..c58d76f33506 100644 --- a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/Lab.cs +++ b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/Lab.cs @@ -21,7 +21,7 @@ namespace Microsoft.Azure.Management.DevTestLabs.Models /// A lab. /// [Rest.Serialization.JsonTransformation] - public partial class Lab : Resource + public partial class Lab : TrackedResource { /// /// Initializes a new instance of the Lab class. @@ -34,11 +34,15 @@ public Lab() /// /// Initializes a new instance of the Lab class. /// - /// The identifier of the resource. - /// The name of the resource. - /// The type of the resource. - /// The location of the resource. - /// The tags of the resource. + /// The geo-location where the resource + /// lives + /// Fully qualified resource ID for the resource. Ex - + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + /// The name of the resource + /// The type of the resource. E.g. + /// "Microsoft.Compute/virtualMachines" or + /// "Microsoft.Storage/storageAccounts" + /// Resource tags. /// The lab's default storage /// account. /// The lab's default @@ -50,7 +54,7 @@ public Lab() /// The lab's Key vault. /// Type of storage used by the lab. It /// can be either Premium or Standard. Default is Premium. Possible - /// values include: 'Standard', 'Premium' + /// values include: 'Standard', 'Premium', 'StandardSSD' /// The ordered list /// of artifact resource IDs that should be applied on all Linux VM /// creations by default, prior to the artifacts specified by the @@ -69,12 +73,29 @@ public Lab() /// The access rights to be granted /// to the user when provisioning an environment. Possible values /// include: 'Reader', 'Contributor' - /// The properties of any lab announcement - /// associated with this lab - /// The properties of any lab support message - /// associated with this lab - /// The resource group in which - /// lab virtual machines will be created in. + /// The plain text title for the lab + /// announcement + /// The markdown text (if any) that this lab + /// displays in the UI. If left empty/null, nothing will be + /// shown. + /// Is the lab announcement active/enabled at + /// this time?. Possible values include: 'Enabled', 'Disabled' + /// The time at which the announcement + /// expires (null for never) + /// Has this announcement expired? + /// The provisioning status of the + /// resource. + /// The unique immutable identifier of a + /// resource (Guid). + /// Is the lab support banner active/enabled at + /// this time?. Possible values include: 'Enabled', 'Disabled' + /// The markdown text (if any) that this lab + /// displays in the UI. If left empty/null, nothing will be + /// shown. + /// The resource group ID in + /// which all new lab virtual machines will be created. Ex: + /// /subscriptions/subId/resourceGroups/rgName To let DevTest Labs + /// manage resource group creation, set this value to null. /// The public IP address for the lab's load /// balancer. /// The load balancer used to for lab VMs @@ -84,12 +105,41 @@ public Lab() /// ports. /// Extended properties of the lab /// used for experimental features - /// The provisioning status of the + /// Is browser connect enabled for the + /// lab. Possible values include: 'Enabled', 'Disabled' + /// Is auto upgrade of + /// CSE disabled for the lab? + /// List of identities which can be + /// used for management of resources. + /// Indicates whether to create Lab + /// resources (e.g. Storage accounts and Key Vaults) in network + /// isolation. Possible values include: 'Enabled', 'Disabled' + /// Gets or sets resourceId of the + /// disk encryption set to use for enabling encryption at rest. + /// Gets or sets the type of key used to encrypt + /// the data of the disk. Possible values include: + /// 'EncryptionAtRestWithPlatformKey', + /// 'EncryptionAtRestWithCustomerKey' + /// Default secret for creating virtual + /// machines. + /// The provisioning status of the /// resource. - /// The unique immutable identifier of a - /// resource (Guid). - public Lab(string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), string defaultStorageAccount = default(string), string defaultPremiumStorageAccount = default(string), string artifactsStorageAccount = default(string), string premiumDataDiskStorageAccount = default(string), string vaultName = default(string), string labStorageType = default(string), IList mandatoryArtifactsResourceIdsLinux = default(IList), IList mandatoryArtifactsResourceIdsWindows = default(IList), System.DateTime? createdDate = default(System.DateTime?), string premiumDataDisks = default(string), string environmentPermission = default(string), LabAnnouncementProperties announcement = default(LabAnnouncementProperties), LabSupportProperties support = default(LabSupportProperties), string vmCreationResourceGroup = default(string), string publicIpId = default(string), string loadBalancerId = default(string), string networkSecurityGroupId = default(string), IDictionary extendedProperties = default(IDictionary), string provisioningState = default(string), string uniqueIdentifier = default(string)) - : base(id, name, type, location, tags) + /// The unique immutable identifier of + /// a resource (Guid). + /// Type of identity (SystemAssigned, UserAssigned, + /// None). Possible values include: 'None', 'SystemAssigned', + /// 'UserAssigned', 'SystemAssigned,UserAssigned' + /// The principal id of resource + /// identity. + /// The tenant identifier of resource. + /// The client secret URL of the + /// identity. + /// If Type is 'UserAssigned': + /// List of user assigned identities. + /// The system metadata relating to this + /// resource + public Lab(string location, string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), string defaultStorageAccount = default(string), string defaultPremiumStorageAccount = default(string), string artifactsStorageAccount = default(string), string premiumDataDiskStorageAccount = default(string), string vaultName = default(string), string labStorageType = default(string), IList mandatoryArtifactsResourceIdsLinux = default(IList), IList mandatoryArtifactsResourceIdsWindows = default(IList), System.DateTime? createdDate = default(System.DateTime?), string premiumDataDisks = default(string), string environmentPermission = default(string), string title = default(string), string markdown = default(string), string enabled = default(string), System.DateTime? expirationDate = default(System.DateTime?), bool? expired = default(bool?), string provisioningState = default(string), string uniqueIdentifier = default(string), string enabled1 = default(string), string markdown1 = default(string), string vmCreationResourceGroup = default(string), string publicIpId = default(string), string loadBalancerId = default(string), string networkSecurityGroupId = default(string), IDictionary extendedProperties = default(IDictionary), string browserConnect = default(string), bool? disableAutoUpgradeCseMinorVersion = default(bool?), IDictionary managementIdentities = default(IDictionary), string isolateLabResources = default(string), string diskEncryptionSetId = default(string), string labType = default(string), string defaultSecretName = default(string), string provisioningState1 = default(string), string uniqueIdentifier1 = default(string), string type1 = default(string), string principalId = default(string), string tenantId = default(string), string clientSecretUrl = default(string), IDictionary userAssignedIdentities = default(IDictionary), SystemData systemData = default(SystemData)) + : base(location, id, name, type, tags) { DefaultStorageAccount = defaultStorageAccount; DefaultPremiumStorageAccount = defaultPremiumStorageAccount; @@ -102,15 +152,35 @@ public Lab() CreatedDate = createdDate; PremiumDataDisks = premiumDataDisks; EnvironmentPermission = environmentPermission; - Announcement = announcement; - Support = support; + Title = title; + Markdown = markdown; + Enabled = enabled; + ExpirationDate = expirationDate; + Expired = expired; + ProvisioningState = provisioningState; + UniqueIdentifier = uniqueIdentifier; + Enabled1 = enabled1; + Markdown1 = markdown1; VmCreationResourceGroup = vmCreationResourceGroup; PublicIpId = publicIpId; LoadBalancerId = loadBalancerId; NetworkSecurityGroupId = networkSecurityGroupId; ExtendedProperties = extendedProperties; - ProvisioningState = provisioningState; - UniqueIdentifier = uniqueIdentifier; + BrowserConnect = browserConnect; + DisableAutoUpgradeCseMinorVersion = disableAutoUpgradeCseMinorVersion; + ManagementIdentities = managementIdentities; + IsolateLabResources = isolateLabResources; + DiskEncryptionSetId = diskEncryptionSetId; + LabType = labType; + DefaultSecretName = defaultSecretName; + ProvisioningState1 = provisioningState1; + UniqueIdentifier1 = uniqueIdentifier1; + Type1 = type1; + PrincipalId = principalId; + TenantId = tenantId; + ClientSecretUrl = clientSecretUrl; + UserAssignedIdentities = userAssignedIdentities; + SystemData = systemData; CustomInit(); } @@ -132,10 +202,10 @@ public Lab() public string DefaultPremiumStorageAccount { get; private set; } /// - /// Gets the lab's artifact storage account. + /// Gets or sets the lab's artifact storage account. /// [JsonProperty(PropertyName = "properties.artifactsStorageAccount")] - public string ArtifactsStorageAccount { get; private set; } + public string ArtifactsStorageAccount { get; set; } /// /// Gets the lab's premium data disk storage account. @@ -152,7 +222,7 @@ public Lab() /// /// Gets or sets type of storage used by the lab. It can be either /// Premium or Standard. Default is Premium. Possible values include: - /// 'Standard', 'Premium' + /// 'Standard', 'Premium', 'StandardSSD' /// [JsonProperty(PropertyName = "properties.labStorageType")] public string LabStorageType { get; set; } @@ -198,25 +268,72 @@ public Lab() public string EnvironmentPermission { get; set; } /// - /// Gets or sets the properties of any lab announcement associated with - /// this lab + /// Gets or sets the plain text title for the lab announcement /// - [JsonProperty(PropertyName = "properties.announcement")] - public LabAnnouncementProperties Announcement { get; set; } + [JsonProperty(PropertyName = "properties.announcement.title")] + public string Title { get; set; } /// - /// Gets or sets the properties of any lab support message associated - /// with this lab + /// Gets or sets the markdown text (if any) that this lab displays in + /// the UI. If left empty/null, nothing will be shown. /// - [JsonProperty(PropertyName = "properties.support")] - public LabSupportProperties Support { get; set; } + [JsonProperty(PropertyName = "properties.announcement.markdown")] + public string Markdown { get; set; } /// - /// Gets the resource group in which lab virtual machines will be - /// created in. + /// Gets or sets is the lab announcement active/enabled at this time?. + /// Possible values include: 'Enabled', 'Disabled' + /// + [JsonProperty(PropertyName = "properties.announcement.enabled")] + public string Enabled { get; set; } + + /// + /// Gets or sets the time at which the announcement expires (null for + /// never) + /// + [JsonProperty(PropertyName = "properties.announcement.expirationDate")] + public System.DateTime? ExpirationDate { get; set; } + + /// + /// Gets or sets has this announcement expired? + /// + [JsonProperty(PropertyName = "properties.announcement.expired")] + public bool? Expired { get; set; } + + /// + /// Gets the provisioning status of the resource. + /// + [JsonProperty(PropertyName = "properties.announcement.provisioningState")] + public string ProvisioningState { get; private set; } + + /// + /// Gets the unique immutable identifier of a resource (Guid). + /// + [JsonProperty(PropertyName = "properties.announcement.uniqueIdentifier")] + public string UniqueIdentifier { get; private set; } + + /// + /// Gets or sets is the lab support banner active/enabled at this + /// time?. Possible values include: 'Enabled', 'Disabled' + /// + [JsonProperty(PropertyName = "properties.support.enabled")] + public string Enabled1 { get; set; } + + /// + /// Gets or sets the markdown text (if any) that this lab displays in + /// the UI. If left empty/null, nothing will be shown. + /// + [JsonProperty(PropertyName = "properties.support.markdown")] + public string Markdown1 { get; set; } + + /// + /// Gets or sets the resource group ID in which all new lab virtual + /// machines will be created. Ex: + /// /subscriptions/subId/resourceGroups/rgName To let DevTest Labs + /// manage resource group creation, set this value to null. /// [JsonProperty(PropertyName = "properties.vmCreationResourceGroup")] - public string VmCreationResourceGroup { get; private set; } + public string VmCreationResourceGroup { get; set; } /// /// Gets the public IP address for the lab's load balancer. @@ -245,17 +362,115 @@ public Lab() [JsonProperty(PropertyName = "properties.extendedProperties")] public IDictionary ExtendedProperties { get; set; } + /// + /// Gets or sets is browser connect enabled for the lab. Possible + /// values include: 'Enabled', 'Disabled' + /// + [JsonProperty(PropertyName = "properties.browserConnect")] + public string BrowserConnect { get; set; } + + /// + /// Gets or sets is auto upgrade of CSE disabled for the lab? + /// + [JsonProperty(PropertyName = "properties.disableAutoUpgradeCseMinorVersion")] + public bool? DisableAutoUpgradeCseMinorVersion { get; set; } + + /// + /// Gets or sets list of identities which can be used for management of + /// resources. + /// + [JsonProperty(PropertyName = "properties.managementIdentities")] + public IDictionary ManagementIdentities { get; set; } + + /// + /// Gets or sets indicates whether to create Lab resources (e.g. + /// Storage accounts and Key Vaults) in network isolation. Possible + /// values include: 'Enabled', 'Disabled' + /// + [JsonProperty(PropertyName = "properties.isolateLabResources")] + public string IsolateLabResources { get; set; } + + /// + /// Gets or sets resourceId of the disk encryption set to use for + /// enabling encryption at rest. + /// + [JsonProperty(PropertyName = "properties.encryption.diskEncryptionSetId")] + public string DiskEncryptionSetId { get; set; } + + /// + /// Gets or sets the type of key used to encrypt the data of the disk. + /// Possible values include: 'EncryptionAtRestWithPlatformKey', + /// 'EncryptionAtRestWithCustomerKey' + /// + [JsonProperty(PropertyName = "properties.encryption.type")] + public string LabType { get; set; } + + /// + /// Gets or sets default secret for creating virtual machines. + /// + [JsonProperty(PropertyName = "properties.defaultSecretName")] + public string DefaultSecretName { get; set; } + /// /// Gets the provisioning status of the resource. /// [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; private set; } + public string ProvisioningState1 { get; private set; } /// /// Gets the unique immutable identifier of a resource (Guid). /// [JsonProperty(PropertyName = "properties.uniqueIdentifier")] - public string UniqueIdentifier { get; private set; } + public string UniqueIdentifier1 { get; private set; } + + /// + /// Gets or sets type of identity (SystemAssigned, UserAssigned, None). + /// Possible values include: 'None', 'SystemAssigned', 'UserAssigned', + /// 'SystemAssigned,UserAssigned' + /// + [JsonProperty(PropertyName = "identity.type")] + public string Type1 { get; set; } + + /// + /// Gets or sets the principal id of resource identity. + /// + [JsonProperty(PropertyName = "identity.principalId")] + public string PrincipalId { get; set; } + + /// + /// Gets or sets the tenant identifier of resource. + /// + [JsonProperty(PropertyName = "identity.tenantId")] + public string TenantId { get; set; } + + /// + /// Gets or sets the client secret URL of the identity. + /// + [JsonProperty(PropertyName = "identity.clientSecretUrl")] + public string ClientSecretUrl { get; set; } + /// + /// Gets or sets if Type is 'UserAssigned': List of user assigned + /// identities. + /// + [JsonProperty(PropertyName = "identity.userAssignedIdentities")] + public IDictionary UserAssignedIdentities { get; set; } + + /// + /// Gets the system metadata relating to this resource + /// + [JsonProperty(PropertyName = "systemData")] + public SystemData SystemData { get; private set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public override void Validate() + { + base.Validate(); + } } } diff --git a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/LabAnnouncementProperties.cs b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/LabAnnouncementProperties.cs deleted file mode 100644 index 8a2657810b8b..000000000000 --- a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/LabAnnouncementProperties.cs +++ /dev/null @@ -1,109 +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.DevTestLabs.Models -{ - using Newtonsoft.Json; - using System.Linq; - - /// - /// Properties of a lab's announcement banner - /// - public partial class LabAnnouncementProperties - { - /// - /// Initializes a new instance of the LabAnnouncementProperties class. - /// - public LabAnnouncementProperties() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the LabAnnouncementProperties class. - /// - /// The plain text title for the lab - /// announcement - /// The markdown text (if any) that this lab - /// displays in the UI. If left empty/null, nothing will be - /// shown. - /// Is the lab announcement active/enabled at - /// this time?. Possible values include: 'Enabled', 'Disabled' - /// The time at which the announcement - /// expires (null for never) - /// Has this announcement expired? - /// The provisioning status of the - /// resource. - /// The unique immutable identifier of a - /// resource (Guid). - public LabAnnouncementProperties(string title = default(string), string markdown = default(string), string enabled = default(string), System.DateTime? expirationDate = default(System.DateTime?), bool? expired = default(bool?), string provisioningState = default(string), string uniqueIdentifier = default(string)) - { - Title = title; - Markdown = markdown; - Enabled = enabled; - ExpirationDate = expirationDate; - Expired = expired; - ProvisioningState = provisioningState; - UniqueIdentifier = uniqueIdentifier; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the plain text title for the lab announcement - /// - [JsonProperty(PropertyName = "title")] - public string Title { get; set; } - - /// - /// Gets or sets the markdown text (if any) that this lab displays in - /// the UI. If left empty/null, nothing will be shown. - /// - [JsonProperty(PropertyName = "markdown")] - public string Markdown { get; set; } - - /// - /// Gets or sets is the lab announcement active/enabled at this time?. - /// Possible values include: 'Enabled', 'Disabled' - /// - [JsonProperty(PropertyName = "enabled")] - public string Enabled { get; set; } - - /// - /// Gets or sets the time at which the announcement expires (null for - /// never) - /// - [JsonProperty(PropertyName = "expirationDate")] - public System.DateTime? ExpirationDate { get; set; } - - /// - /// Gets or sets has this announcement expired? - /// - [JsonProperty(PropertyName = "expired")] - public bool? Expired { get; set; } - - /// - /// Gets the provisioning status of the resource. - /// - [JsonProperty(PropertyName = "provisioningState")] - public string ProvisioningState { get; private set; } - - /// - /// Gets the unique immutable identifier of a resource (Guid). - /// - [JsonProperty(PropertyName = "uniqueIdentifier")] - public string UniqueIdentifier { get; private set; } - - } -} diff --git a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/LabAnnouncementPropertiesFragment.cs b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/LabAnnouncementPropertiesFragment.cs deleted file mode 100644 index d6ac32c27317..000000000000 --- a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/LabAnnouncementPropertiesFragment.cs +++ /dev/null @@ -1,93 +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.DevTestLabs.Models -{ - using Newtonsoft.Json; - using System.Linq; - - /// - /// Properties of a lab's announcement banner - /// - public partial class LabAnnouncementPropertiesFragment - { - /// - /// Initializes a new instance of the LabAnnouncementPropertiesFragment - /// class. - /// - public LabAnnouncementPropertiesFragment() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the LabAnnouncementPropertiesFragment - /// class. - /// - /// The plain text title for the lab - /// announcement - /// The markdown text (if any) that this lab - /// displays in the UI. If left empty/null, nothing will be - /// shown. - /// Is the lab announcement active/enabled at - /// this time?. Possible values include: 'Enabled', 'Disabled' - /// The time at which the announcement - /// expires (null for never) - /// Has this announcement expired? - public LabAnnouncementPropertiesFragment(string title = default(string), string markdown = default(string), string enabled = default(string), System.DateTime? expirationDate = default(System.DateTime?), bool? expired = default(bool?)) - { - Title = title; - Markdown = markdown; - Enabled = enabled; - ExpirationDate = expirationDate; - Expired = expired; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the plain text title for the lab announcement - /// - [JsonProperty(PropertyName = "title")] - public string Title { get; set; } - - /// - /// Gets or sets the markdown text (if any) that this lab displays in - /// the UI. If left empty/null, nothing will be shown. - /// - [JsonProperty(PropertyName = "markdown")] - public string Markdown { get; set; } - - /// - /// Gets or sets is the lab announcement active/enabled at this time?. - /// Possible values include: 'Enabled', 'Disabled' - /// - [JsonProperty(PropertyName = "enabled")] - public string Enabled { get; set; } - - /// - /// Gets or sets the time at which the announcement expires (null for - /// never) - /// - [JsonProperty(PropertyName = "expirationDate")] - public System.DateTime? ExpirationDate { get; set; } - - /// - /// Gets or sets has this announcement expired? - /// - [JsonProperty(PropertyName = "expired")] - public bool? Expired { get; set; } - - } -} diff --git a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/LabCost.cs b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/LabCost.cs index 55e4b639853b..6727e98e8447 100644 --- a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/LabCost.cs +++ b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/LabCost.cs @@ -34,14 +34,23 @@ public LabCost() /// /// Initializes a new instance of the LabCost class. /// - /// The identifier of the resource. - /// The name of the resource. - /// The type of the resource. - /// The location of the resource. - /// The tags of the resource. - /// The target cost properties - /// The lab cost summary component of the - /// cost data. + /// Fully qualified resource ID for the resource. Ex - + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + /// The name of the resource + /// The type of the resource. E.g. + /// "Microsoft.Compute/virtualMachines" or + /// "Microsoft.Storage/storageAccounts" + /// Target cost status. Possible values include: + /// 'Enabled', 'Disabled' + /// Lab target cost + /// Cost thresholds. + /// Reporting cycle start + /// date. + /// Reporting cycle end date. + /// Reporting cycle type. Possible values + /// include: 'CalendarMonth', 'Custom' + /// The cost component of the cost + /// item. /// The lab cost details component of the /// cost data. /// The resource cost component of the cost @@ -55,11 +64,18 @@ public LabCost() /// resource. /// The unique immutable identifier of a /// resource (Guid). - public LabCost(string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), TargetCostProperties targetCost = default(TargetCostProperties), LabCostSummaryProperties labCostSummary = default(LabCostSummaryProperties), IList labCostDetails = default(IList), IList resourceCosts = default(IList), string currencyCode = default(string), System.DateTime? startDateTime = default(System.DateTime?), System.DateTime? endDateTime = default(System.DateTime?), System.DateTime? createdDate = default(System.DateTime?), string provisioningState = default(string), string uniqueIdentifier = default(string)) - : base(id, name, type, location, tags) + /// The system metadata relating to this + /// resource + public LabCost(string id = default(string), string name = default(string), string type = default(string), string status = default(string), int? target = default(int?), IList costThresholds = default(IList), System.DateTime? cycleStartDateTime = default(System.DateTime?), System.DateTime? cycleEndDateTime = default(System.DateTime?), string cycleType = default(string), double? estimatedLabCost = default(double?), IList labCostDetails = default(IList), IList resourceCosts = default(IList), string currencyCode = default(string), System.DateTime? startDateTime = default(System.DateTime?), System.DateTime? endDateTime = default(System.DateTime?), System.DateTime? createdDate = default(System.DateTime?), string provisioningState = default(string), string uniqueIdentifier = default(string), SystemData systemData = default(SystemData)) + : base(id, name, type) { - TargetCost = targetCost; - LabCostSummary = labCostSummary; + Status = status; + Target = target; + CostThresholds = costThresholds; + CycleStartDateTime = cycleStartDateTime; + CycleEndDateTime = cycleEndDateTime; + CycleType = cycleType; + EstimatedLabCost = estimatedLabCost; LabCostDetails = labCostDetails; ResourceCosts = resourceCosts; CurrencyCode = currencyCode; @@ -68,6 +84,7 @@ public LabCost() CreatedDate = createdDate; ProvisioningState = provisioningState; UniqueIdentifier = uniqueIdentifier; + SystemData = systemData; CustomInit(); } @@ -77,16 +94,48 @@ public LabCost() partial void CustomInit(); /// - /// Gets or sets the target cost properties + /// Gets or sets target cost status. Possible values include: + /// 'Enabled', 'Disabled' + /// + [JsonProperty(PropertyName = "properties.targetCost.status")] + public string Status { get; set; } + + /// + /// Gets or sets lab target cost + /// + [JsonProperty(PropertyName = "properties.targetCost.target")] + public int? Target { get; set; } + + /// + /// Gets or sets cost thresholds. + /// + [JsonProperty(PropertyName = "properties.targetCost.costThresholds")] + public IList CostThresholds { get; set; } + + /// + /// Gets or sets reporting cycle start date. /// - [JsonProperty(PropertyName = "properties.targetCost")] - public TargetCostProperties TargetCost { get; set; } + [JsonProperty(PropertyName = "properties.targetCost.cycleStartDateTime")] + public System.DateTime? CycleStartDateTime { get; set; } /// - /// Gets the lab cost summary component of the cost data. + /// Gets or sets reporting cycle end date. /// - [JsonProperty(PropertyName = "properties.labCostSummary")] - public LabCostSummaryProperties LabCostSummary { get; private set; } + [JsonProperty(PropertyName = "properties.targetCost.cycleEndDateTime")] + public System.DateTime? CycleEndDateTime { get; set; } + + /// + /// Gets or sets reporting cycle type. Possible values include: + /// 'CalendarMonth', 'Custom' + /// + [JsonProperty(PropertyName = "properties.targetCost.cycleType")] + public string CycleType { get; set; } + + /// + /// Gets or sets the cost component of the cost item. + /// + [JsonProperty(PropertyName = "properties.labCostSummary.estimatedLabCost")] + public double? EstimatedLabCost { get; set; } /// /// Gets the lab cost details component of the cost data. @@ -136,5 +185,11 @@ public LabCost() [JsonProperty(PropertyName = "properties.uniqueIdentifier")] public string UniqueIdentifier { get; private set; } + /// + /// Gets the system metadata relating to this resource + /// + [JsonProperty(PropertyName = "systemData")] + public SystemData SystemData { get; private set; } + } } diff --git a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/LabCostSummaryProperties.cs b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/LabCostSummaryProperties.cs deleted file mode 100644 index daf9adcbff0e..000000000000 --- a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/LabCostSummaryProperties.cs +++ /dev/null @@ -1,52 +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.DevTestLabs.Models -{ - using Newtonsoft.Json; - using System.Linq; - - /// - /// The properties of the cost summary. - /// - public partial class LabCostSummaryProperties - { - /// - /// Initializes a new instance of the LabCostSummaryProperties class. - /// - public LabCostSummaryProperties() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the LabCostSummaryProperties class. - /// - /// The cost component of the cost - /// item. - public LabCostSummaryProperties(double? estimatedLabCost = default(double?)) - { - EstimatedLabCost = estimatedLabCost; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the cost component of the cost item. - /// - [JsonProperty(PropertyName = "estimatedLabCost")] - public double? EstimatedLabCost { get; set; } - - } -} diff --git a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/LabFragment.cs b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/LabFragment.cs index d267fbdd502a..0d21e9bd7439 100644 --- a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/LabFragment.cs +++ b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/LabFragment.cs @@ -10,18 +10,14 @@ namespace Microsoft.Azure.Management.DevTestLabs.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; using System.Collections; using System.Collections.Generic; using System.Linq; /// - /// A lab. + /// Patch /// - [Rest.Serialization.JsonTransformation] - public partial class LabFragment : UpdateResource + public partial class LabFragment : Tags { /// /// Initializes a new instance of the LabFragment class. @@ -34,44 +30,10 @@ public LabFragment() /// /// Initializes a new instance of the LabFragment class. /// - /// The tags of the resource. - /// Type of storage used by the lab. It - /// can be either Premium or Standard. Default is Premium. Possible - /// values include: 'Standard', 'Premium' - /// The ordered list - /// of artifact resource IDs that should be applied on all Linux VM - /// creations by default, prior to the artifacts specified by the - /// user. - /// The ordered list - /// of artifact resource IDs that should be applied on all Windows VM - /// creations by default, prior to the artifacts specified by the - /// user. - /// The setting to enable usage of - /// premium data disks. - /// When its value is 'Enabled', creation of standard or premium data - /// disks is allowed. - /// When its value is 'Disabled', only creation of standard data disks - /// is allowed. Possible values include: 'Disabled', 'Enabled' - /// The access rights to be granted - /// to the user when provisioning an environment. Possible values - /// include: 'Reader', 'Contributor' - /// The properties of any lab announcement - /// associated with this lab - /// The properties of any lab support message - /// associated with this lab - /// Extended properties of the lab - /// used for experimental features - public LabFragment(IDictionary tags = default(IDictionary), string labStorageType = default(string), IList mandatoryArtifactsResourceIdsLinux = default(IList), IList mandatoryArtifactsResourceIdsWindows = default(IList), string premiumDataDisks = default(string), string environmentPermission = default(string), LabAnnouncementPropertiesFragment announcement = default(LabAnnouncementPropertiesFragment), LabSupportPropertiesFragment support = default(LabSupportPropertiesFragment), IDictionary extendedProperties = default(IDictionary)) - : base(tags) + /// Resource tags + public LabFragment(IDictionary tagsProperty = default(IDictionary)) + : base(tagsProperty) { - LabStorageType = labStorageType; - MandatoryArtifactsResourceIdsLinux = mandatoryArtifactsResourceIdsLinux; - MandatoryArtifactsResourceIdsWindows = mandatoryArtifactsResourceIdsWindows; - PremiumDataDisks = premiumDataDisks; - EnvironmentPermission = environmentPermission; - Announcement = announcement; - Support = support; - ExtendedProperties = extendedProperties; CustomInit(); } @@ -80,68 +42,5 @@ public LabFragment() /// partial void CustomInit(); - /// - /// Gets or sets type of storage used by the lab. It can be either - /// Premium or Standard. Default is Premium. Possible values include: - /// 'Standard', 'Premium' - /// - [JsonProperty(PropertyName = "properties.labStorageType")] - public string LabStorageType { get; set; } - - /// - /// Gets or sets the ordered list of artifact resource IDs that should - /// be applied on all Linux VM creations by default, prior to the - /// artifacts specified by the user. - /// - [JsonProperty(PropertyName = "properties.mandatoryArtifactsResourceIdsLinux")] - public IList MandatoryArtifactsResourceIdsLinux { get; set; } - - /// - /// Gets or sets the ordered list of artifact resource IDs that should - /// be applied on all Windows VM creations by default, prior to the - /// artifacts specified by the user. - /// - [JsonProperty(PropertyName = "properties.mandatoryArtifactsResourceIdsWindows")] - public IList MandatoryArtifactsResourceIdsWindows { get; set; } - - /// - /// Gets or sets the setting to enable usage of premium data disks. - /// When its value is 'Enabled', creation of standard or premium data - /// disks is allowed. - /// When its value is 'Disabled', only creation of standard data disks - /// is allowed. Possible values include: 'Disabled', 'Enabled' - /// - [JsonProperty(PropertyName = "properties.premiumDataDisks")] - public string PremiumDataDisks { get; set; } - - /// - /// Gets or sets the access rights to be granted to the user when - /// provisioning an environment. Possible values include: 'Reader', - /// 'Contributor' - /// - [JsonProperty(PropertyName = "properties.environmentPermission")] - public string EnvironmentPermission { get; set; } - - /// - /// Gets or sets the properties of any lab announcement associated with - /// this lab - /// - [JsonProperty(PropertyName = "properties.announcement")] - public LabAnnouncementPropertiesFragment Announcement { get; set; } - - /// - /// Gets or sets the properties of any lab support message associated - /// with this lab - /// - [JsonProperty(PropertyName = "properties.support")] - public LabSupportPropertiesFragment Support { get; set; } - - /// - /// Gets or sets extended properties of the lab used for experimental - /// features - /// - [JsonProperty(PropertyName = "properties.extendedProperties")] - public IDictionary ExtendedProperties { get; set; } - } } diff --git a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/LabSecret.cs b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/LabSecret.cs new file mode 100644 index 000000000000..1e3e41330c18 --- /dev/null +++ b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/LabSecret.cs @@ -0,0 +1,140 @@ +// +// 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.DevTestLabs.Models +{ + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// A shared secret in a lab. + /// + [Rest.Serialization.JsonTransformation] + public partial class LabSecret : TrackedResource + { + /// + /// Initializes a new instance of the LabSecret class. + /// + public LabSecret() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the LabSecret class. + /// + /// The geo-location where the resource + /// lives + /// Fully qualified resource ID for the resource. Ex - + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + /// The name of the resource + /// The type of the resource. E.g. + /// "Microsoft.Compute/virtualMachines" or + /// "Microsoft.Storage/storageAccounts" + /// Resource tags. + /// The value of the secret for secret + /// creation. + /// The name of the entry in the lab + /// KeyVault. + /// Is the secret enabled for use + /// with artifacts? + /// Is the secret enabled for use + /// with creation of VMs? + /// Is the secret enabled for + /// use with ARM environments? + /// The provisioning status of the + /// resource. + /// The unique immutable identifier of a + /// resource (Guid). + /// The system metadata relating to this + /// resource + public LabSecret(string location, string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), string value = default(string), string keyVaultEntry = default(string), bool? enabledForArtifacts = default(bool?), bool? enabledForVmCreation = default(bool?), bool? enabledForArmEnvironments = default(bool?), string provisioningState = default(string), string uniqueIdentifier = default(string), SystemData systemData = default(SystemData)) + : base(location, id, name, type, tags) + { + Value = value; + KeyVaultEntry = keyVaultEntry; + EnabledForArtifacts = enabledForArtifacts; + EnabledForVmCreation = enabledForVmCreation; + EnabledForArmEnvironments = enabledForArmEnvironments; + ProvisioningState = provisioningState; + UniqueIdentifier = uniqueIdentifier; + SystemData = systemData; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the value of the secret for secret creation. + /// + [JsonProperty(PropertyName = "properties.value")] + public string Value { get; set; } + + /// + /// Gets the name of the entry in the lab KeyVault. + /// + [JsonProperty(PropertyName = "properties.keyVaultEntry")] + public string KeyVaultEntry { get; private set; } + + /// + /// Gets or sets is the secret enabled for use with artifacts? + /// + [JsonProperty(PropertyName = "properties.enabledForArtifacts")] + public bool? EnabledForArtifacts { get; set; } + + /// + /// Gets or sets is the secret enabled for use with creation of VMs? + /// + [JsonProperty(PropertyName = "properties.enabledForVmCreation")] + public bool? EnabledForVmCreation { get; set; } + + /// + /// Gets or sets is the secret enabled for use with ARM environments? + /// + [JsonProperty(PropertyName = "properties.enabledForArmEnvironments")] + public bool? EnabledForArmEnvironments { get; set; } + + /// + /// Gets the provisioning status of the resource. + /// + [JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState { get; private set; } + + /// + /// Gets the unique immutable identifier of a resource (Guid). + /// + [JsonProperty(PropertyName = "properties.uniqueIdentifier")] + public string UniqueIdentifier { get; private set; } + + /// + /// Gets the system metadata relating to this resource + /// + [JsonProperty(PropertyName = "systemData")] + public SystemData SystemData { get; private set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public override void Validate() + { + base.Validate(); + } + } +} diff --git a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/DayDetailsFragment.cs b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/LabSecretFragment.cs similarity index 56% rename from sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/DayDetailsFragment.cs rename to sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/LabSecretFragment.cs index 411c0d965773..6a177ae17dd6 100644 --- a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/DayDetailsFragment.cs +++ b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/LabSecretFragment.cs @@ -10,29 +10,30 @@ namespace Microsoft.Azure.Management.DevTestLabs.Models { - using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; using System.Linq; /// - /// Properties of a daily schedule. + /// Patch /// - public partial class DayDetailsFragment + public partial class LabSecretFragment : Tags { /// - /// Initializes a new instance of the DayDetailsFragment class. + /// Initializes a new instance of the LabSecretFragment class. /// - public DayDetailsFragment() + public LabSecretFragment() { CustomInit(); } /// - /// Initializes a new instance of the DayDetailsFragment class. + /// Initializes a new instance of the LabSecretFragment class. /// - /// The time of day the schedule will occur. - public DayDetailsFragment(string time = default(string)) + /// Resource tags + public LabSecretFragment(IDictionary tagsProperty = default(IDictionary)) + : base(tagsProperty) { - Time = time; CustomInit(); } @@ -41,11 +42,5 @@ public DayDetailsFragment() /// partial void CustomInit(); - /// - /// Gets or sets the time of day the schedule will occur. - /// - [JsonProperty(PropertyName = "time")] - public string Time { get; set; } - } } diff --git a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/LabSupportProperties.cs b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/LabSupportProperties.cs deleted file mode 100644 index b142870f138a..000000000000 --- a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/LabSupportProperties.cs +++ /dev/null @@ -1,64 +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.DevTestLabs.Models -{ - using Newtonsoft.Json; - using System.Linq; - - /// - /// Properties of a lab's support banner - /// - public partial class LabSupportProperties - { - /// - /// Initializes a new instance of the LabSupportProperties class. - /// - public LabSupportProperties() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the LabSupportProperties class. - /// - /// Is the lab support banner active/enabled at - /// this time?. Possible values include: 'Enabled', 'Disabled' - /// The markdown text (if any) that this lab - /// displays in the UI. If left empty/null, nothing will be - /// shown. - public LabSupportProperties(string enabled = default(string), string markdown = default(string)) - { - Enabled = enabled; - Markdown = markdown; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets is the lab support banner active/enabled at this - /// time?. Possible values include: 'Enabled', 'Disabled' - /// - [JsonProperty(PropertyName = "enabled")] - public string Enabled { get; set; } - - /// - /// Gets or sets the markdown text (if any) that this lab displays in - /// the UI. If left empty/null, nothing will be shown. - /// - [JsonProperty(PropertyName = "markdown")] - public string Markdown { get; set; } - - } -} diff --git a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/LabSupportPropertiesFragment.cs b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/LabSupportPropertiesFragment.cs deleted file mode 100644 index 18cd11c963b8..000000000000 --- a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/LabSupportPropertiesFragment.cs +++ /dev/null @@ -1,66 +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.DevTestLabs.Models -{ - using Newtonsoft.Json; - using System.Linq; - - /// - /// Properties of a lab's support banner - /// - public partial class LabSupportPropertiesFragment - { - /// - /// Initializes a new instance of the LabSupportPropertiesFragment - /// class. - /// - public LabSupportPropertiesFragment() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the LabSupportPropertiesFragment - /// class. - /// - /// Is the lab support banner active/enabled at - /// this time?. Possible values include: 'Enabled', 'Disabled' - /// The markdown text (if any) that this lab - /// displays in the UI. If left empty/null, nothing will be - /// shown. - public LabSupportPropertiesFragment(string enabled = default(string), string markdown = default(string)) - { - Enabled = enabled; - Markdown = markdown; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets is the lab support banner active/enabled at this - /// time?. Possible values include: 'Enabled', 'Disabled' - /// - [JsonProperty(PropertyName = "enabled")] - public string Enabled { get; set; } - - /// - /// Gets or sets the markdown text (if any) that this lab displays in - /// the UI. If left empty/null, nothing will be shown. - /// - [JsonProperty(PropertyName = "markdown")] - public string Markdown { get; set; } - - } -} diff --git a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/LabVirtualMachine.cs b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/LabVirtualMachine.cs index e6525bc4f840..7c55259b4a5b 100644 --- a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/LabVirtualMachine.cs +++ b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/LabVirtualMachine.cs @@ -21,7 +21,7 @@ namespace Microsoft.Azure.Management.DevTestLabs.Models /// A virtual machine. /// [Rest.Serialization.JsonTransformation] - public partial class LabVirtualMachine : Resource + public partial class LabVirtualMachine : TrackedResource { /// /// Initializes a new instance of the LabVirtualMachine class. @@ -34,11 +34,19 @@ public LabVirtualMachine() /// /// Initializes a new instance of the LabVirtualMachine class. /// - /// The identifier of the resource. - /// The name of the resource. - /// The type of the resource. - /// The location of the resource. - /// The tags of the resource. + /// The geo-location where the resource + /// lives + /// The geo-location where the + /// resource lives + /// The geo-location where the resource + /// lives + /// Fully qualified resource ID for the resource. Ex - + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + /// The name of the resource + /// The type of the resource. E.g. + /// "Microsoft.Compute/virtualMachines" or + /// "Microsoft.Storage/storageAccounts" + /// Resource tags. /// The notes of the virtual machine. /// The object identifier of the owner of /// the virtual machine. @@ -54,6 +62,13 @@ public LabVirtualMachine() /// of the virtual machine. /// The custom image identifier of the /// virtual machine. + /// The shared gallery image + /// version resource identifier of the virtual machine. + /// The shared image resource identifier of + /// the virtual machine. + /// The shared image version for the + /// specified shared image Id. Will use latest if not + /// specified. /// The OS type of the virtual machine. /// The size of the virtual machine. /// The user name of the virtual @@ -74,26 +89,152 @@ public LabVirtualMachine() /// machine is to be created without a public IP address. /// The artifacts to be installed on the /// virtual machine. - /// The artifact deployment - /// status for the virtual machine. - /// The Microsoft Azure Marketplace - /// image reference of the virtual machine. + /// The deployment status of the + /// artifact. + /// The total count of the artifacts + /// that were successfully applied. + /// The total count of the artifacts that + /// were tentatively applied. + /// The offer of the gallery image. + /// The publisher of the gallery image. + /// The SKU of the gallery image. + /// The OS type of the gallery image. + /// The version of the gallery image. /// The id of the plan associated with the virtual /// machine image - /// The compute virtual machine - /// properties. - /// The network interface - /// properties. - /// The applicable schedule for the - /// virtual machine. + /// Specifies the size of an empty data disk + /// in gigabytes. This element can be used to overwrite the size of the + /// disk in a virtual machine image. + /// Gets the statuses of the virtual + /// machine. + /// Gets the OS type of the virtual + /// machine. + /// Gets the size of the virtual machine. + /// Gets the network interface ID of + /// the virtual machine. + /// Gets OS disk blob uri for the virtual + /// machine. + /// Gets data disks blob uri for the virtual + /// machine. + /// Gets all data disks attached to the virtual + /// machine. + /// The resource ID of the virtual + /// network. + /// The resource ID of the sub net. + /// The resource ID of the public IP + /// address. + /// The public IP address. + /// The private IP address. + /// The DNS name. + /// The RdpAuthority property is a server + /// DNS host name or IP address followed by the service port number for + /// RDP (Remote Desktop Protocol). + /// The SshAuthority property is a server + /// DNS host name or IP address followed by the service port number for + /// SSH. + /// The incoming NAT rules + /// Resource tags + /// Fully qualified resource ID for + /// the resource. Ex - + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + /// The name of the + /// resource + /// The type of the resource. E.g. + /// "Microsoft.Compute/virtualMachines" or + /// "Microsoft.Storage/storageAccounts" + /// Resource tags. + /// The status of the schedule (i.e. Enabled, + /// Disabled). Possible values include: 'Enabled', 'Disabled' + /// The task type of the schedule (e.g. + /// LabVmsShutdownTask, LabVmAutoStart). + /// The days of the week for which the schedule + /// is set (e.g. Sunday, Monday, Tuesday, etc.). + /// The time of the day the schedule will + /// occur. + /// The time of day the schedule will + /// occur. + /// Minutes of the hour the schedule will + /// run. + /// The time zone ID (e.g. Pacific Standard + /// time). + /// If notifications are enabled for this + /// schedule (i.e. Enabled, Disabled). Possible values include: + /// 'Enabled', 'Disabled' + /// Time in minutes before event at which + /// notification will be sent. + /// The webhook URL to which the notification + /// will be sent. + /// The email recipient to send + /// notifications to (can be a list of semi-colon separated email + /// addresses). + /// The locale to use when sending a + /// notification (fallback for unsupported languages is EN). + /// The creation date of the + /// schedule. + /// The resource ID to which the + /// schedule belongs + /// The provisioning status of the + /// resource. + /// The unique immutable identifier of a + /// resource (Guid). + /// The system metadata relating to + /// this resource + /// Fully qualified resource ID for the resource. Ex + /// - + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + /// The name of the resource + /// The type of the resource. E.g. + /// "Microsoft.Compute/virtualMachines" or + /// "Microsoft.Storage/storageAccounts" + /// Resource tags. + /// The status of the schedule (i.e. Enabled, + /// Disabled). Possible values include: 'Enabled', 'Disabled' + /// The task type of the schedule (e.g. + /// LabVmsShutdownTask, LabVmAutoStart). + /// The days of the week for which the schedule + /// is set (e.g. Sunday, Monday, Tuesday, etc.). + /// The time of the day the schedule will + /// occur. + /// The time of day the schedule will + /// occur. + /// Minutes of the hour the schedule will + /// run. + /// The time zone ID (e.g. Pacific Standard + /// time). + /// If notifications are enabled for this + /// schedule (i.e. Enabled, Disabled). Possible values include: + /// 'Enabled', 'Disabled' + /// Time in minutes before event at which + /// notification will be sent. + /// The webhook URL to which the notification + /// will be sent. + /// The email recipient to send + /// notifications to (can be a list of semi-colon separated email + /// addresses). + /// The locale to use when sending a + /// notification (fallback for unsupported languages is EN). + /// The creation date of the + /// schedule. + /// The resource ID to which the + /// schedule belongs + /// The provisioning status of the + /// resource. + /// The unique immutable identifier of + /// a resource (Guid). + /// The system metadata relating to this + /// resource + /// The system metadata relating to this + /// resource /// The expiration date for VM. /// Indicates whether another user can take /// ownership of the virtual machine /// Storage type to use for virtual machine - /// (i.e. Standard, Premium). + /// (i.e. Standard, Premium, StandardSSD). Possible values include: + /// 'Standard', 'Premium', 'StandardSSD' /// Tells source of creation /// of lab virtual machine. Output property only. Possible values - /// include: 'FromCustomImage', 'FromGalleryImage' + /// include: 'FromCustomImage', 'FromGalleryImage', + /// 'FromSharedGalleryImage' /// The resource ID of the environment that /// contains this virtual machine, if any. /// New or existing data disks to @@ -102,12 +243,17 @@ public LabVirtualMachine() /// created /// Last known compute power state /// captured in DTL - /// The provisioning status of the + /// Flag to determine if apply + /// artifacts can be triggered at the time of fetching the + /// document. + /// The provisioning status of the /// resource. - /// The unique immutable identifier of a - /// resource (Guid). - public LabVirtualMachine(string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), string notes = default(string), string ownerObjectId = default(string), string ownerUserPrincipalName = default(string), string createdByUserId = default(string), string createdByUser = default(string), System.DateTime? createdDate = default(System.DateTime?), string computeId = default(string), string customImageId = default(string), string osType = default(string), string size = default(string), string userName = default(string), string password = default(string), string sshKey = default(string), bool? isAuthenticationWithSshKey = default(bool?), string fqdn = default(string), string labSubnetName = default(string), string labVirtualNetworkId = default(string), bool? disallowPublicIpAddress = default(bool?), IList artifacts = default(IList), ArtifactDeploymentStatusProperties artifactDeploymentStatus = default(ArtifactDeploymentStatusProperties), GalleryImageReference galleryImageReference = default(GalleryImageReference), string planId = default(string), ComputeVmProperties computeVm = default(ComputeVmProperties), NetworkInterfaceProperties networkInterface = default(NetworkInterfaceProperties), ApplicableSchedule applicableSchedule = default(ApplicableSchedule), System.DateTime? expirationDate = default(System.DateTime?), bool? allowClaim = default(bool?), string storageType = default(string), string virtualMachineCreationSource = default(string), string environmentId = default(string), IList dataDiskParameters = default(IList), IList scheduleParameters = default(IList), string lastKnownPowerState = default(string), string provisioningState = default(string), string uniqueIdentifier = default(string)) - : base(id, name, type, location, tags) + /// The unique immutable identifier of + /// a resource (Guid). + /// The system metadata relating to this + /// resource + public LabVirtualMachine(string location, string labVirtualMachineLocation, string location1, string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), string notes = default(string), string ownerObjectId = default(string), string ownerUserPrincipalName = default(string), string createdByUserId = default(string), string createdByUser = default(string), System.DateTime? createdDate = default(System.DateTime?), string computeId = default(string), string customImageId = default(string), string galleryImageVersionId = default(string), string sharedImageId = default(string), string sharedImageVersion = default(string), string osType = default(string), string size = default(string), string userName = default(string), string password = default(string), string sshKey = default(string), bool? isAuthenticationWithSshKey = default(bool?), string fqdn = default(string), string labSubnetName = default(string), string labVirtualNetworkId = default(string), bool? disallowPublicIpAddress = default(bool?), IList artifacts = default(IList), string deploymentStatus = default(string), int? artifactsApplied = default(int?), int? totalArtifacts = default(int?), string offer = default(string), string publisher = default(string), string sku = default(string), string osType1 = default(string), string version = default(string), string planId = default(string), int? osDiskSizeGb = default(int?), IList statuses = default(IList), string osType2 = default(string), string vmSize = default(string), string networkInterfaceId = default(string), string osDiskId = default(string), IList dataDiskIds = default(IList), IList dataDisks = default(IList), string virtualNetworkId = default(string), string subnetId = default(string), string publicIpAddressId = default(string), string publicIpAddress = default(string), string privateIpAddress = default(string), string dnsName = default(string), string rdpAuthority = default(string), string sshAuthority = default(string), IList inboundNatRules = default(IList), IDictionary tagsProperty = default(IDictionary), string labVirtualMachineId = default(string), string labVirtualMachineName = default(string), string labVirtualMachineType = default(string), IDictionary labVirtualMachineTags = default(IDictionary), string status = default(string), string taskType = default(string), IList weekdays = default(IList), string time = default(string), string time1 = default(string), int? minute = default(int?), string timeZoneId = default(string), string status1 = default(string), int? timeInMinutes = default(int?), string webhookUrl = default(string), string emailRecipient = default(string), string notificationLocale = default(string), System.DateTime? createdDate1 = default(System.DateTime?), string targetResourceId = default(string), string provisioningState = default(string), string uniqueIdentifier = default(string), SystemData scheduleSystemData = default(SystemData), string id1 = default(string), string name1 = default(string), string type1 = default(string), IDictionary tags1 = default(IDictionary), string status2 = default(string), string taskType1 = default(string), IList weekdays1 = default(IList), string time2 = default(string), string time3 = default(string), int? minute1 = default(int?), string timeZoneId1 = default(string), string status3 = default(string), int? timeInMinutes1 = default(int?), string webhookUrl1 = default(string), string emailRecipient1 = default(string), string notificationLocale1 = default(string), System.DateTime? createdDate2 = default(System.DateTime?), string targetResourceId1 = default(string), string provisioningState1 = default(string), string uniqueIdentifier1 = default(string), SystemData systemData1 = default(SystemData), SystemData systemData2 = default(SystemData), System.DateTime? expirationDate = default(System.DateTime?), bool? allowClaim = default(bool?), string storageType = default(string), string virtualMachineCreationSource = default(string), string environmentId = default(string), IList dataDiskParameters = default(IList), IList scheduleParameters = default(IList), string lastKnownPowerState = default(string), bool? canApplyArtifacts = default(bool?), string provisioningState2 = default(string), string uniqueIdentifier2 = default(string), SystemData systemData = default(SystemData)) + : base(location, id, name, type, tags) { Notes = notes; OwnerObjectId = ownerObjectId; @@ -117,6 +263,9 @@ public LabVirtualMachine() CreatedDate = createdDate; ComputeId = computeId; CustomImageId = customImageId; + GalleryImageVersionId = galleryImageVersionId; + SharedImageId = sharedImageId; + SharedImageVersion = sharedImageVersion; OsType = osType; Size = size; UserName = userName; @@ -128,12 +277,78 @@ public LabVirtualMachine() LabVirtualNetworkId = labVirtualNetworkId; DisallowPublicIpAddress = disallowPublicIpAddress; Artifacts = artifacts; - ArtifactDeploymentStatus = artifactDeploymentStatus; - GalleryImageReference = galleryImageReference; + DeploymentStatus = deploymentStatus; + ArtifactsApplied = artifactsApplied; + TotalArtifacts = totalArtifacts; + Offer = offer; + Publisher = publisher; + Sku = sku; + OsType1 = osType1; + Version = version; PlanId = planId; - ComputeVm = computeVm; - NetworkInterface = networkInterface; - ApplicableSchedule = applicableSchedule; + OsDiskSizeGb = osDiskSizeGb; + Statuses = statuses; + OsType2 = osType2; + VmSize = vmSize; + NetworkInterfaceId = networkInterfaceId; + OsDiskId = osDiskId; + DataDiskIds = dataDiskIds; + DataDisks = dataDisks; + VirtualNetworkId = virtualNetworkId; + SubnetId = subnetId; + PublicIpAddressId = publicIpAddressId; + PublicIpAddress = publicIpAddress; + PrivateIpAddress = privateIpAddress; + DnsName = dnsName; + RdpAuthority = rdpAuthority; + SshAuthority = sshAuthority; + InboundNatRules = inboundNatRules; + TagsProperty = tagsProperty; + LabVirtualMachineId = labVirtualMachineId; + LabVirtualMachineName = labVirtualMachineName; + LabVirtualMachineType = labVirtualMachineType; + LabVirtualMachineTags = labVirtualMachineTags; + LabVirtualMachineLocation = labVirtualMachineLocation; + Status = status; + TaskType = taskType; + Weekdays = weekdays; + Time = time; + Time1 = time1; + Minute = minute; + TimeZoneId = timeZoneId; + Status1 = status1; + TimeInMinutes = timeInMinutes; + WebhookUrl = webhookUrl; + EmailRecipient = emailRecipient; + NotificationLocale = notificationLocale; + CreatedDate1 = createdDate1; + TargetResourceId = targetResourceId; + ProvisioningState = provisioningState; + UniqueIdentifier = uniqueIdentifier; + ScheduleSystemData = scheduleSystemData; + Id1 = id1; + Name1 = name1; + Type1 = type1; + Tags1 = tags1; + Location1 = location1; + Status2 = status2; + TaskType1 = taskType1; + Weekdays1 = weekdays1; + Time2 = time2; + Time3 = time3; + Minute1 = minute1; + TimeZoneId1 = timeZoneId1; + Status3 = status3; + TimeInMinutes1 = timeInMinutes1; + WebhookUrl1 = webhookUrl1; + EmailRecipient1 = emailRecipient1; + NotificationLocale1 = notificationLocale1; + CreatedDate2 = createdDate2; + TargetResourceId1 = targetResourceId1; + ProvisioningState1 = provisioningState1; + UniqueIdentifier1 = uniqueIdentifier1; + SystemData1 = systemData1; + SystemData2 = systemData2; ExpirationDate = expirationDate; AllowClaim = allowClaim; StorageType = storageType; @@ -142,8 +357,10 @@ public LabVirtualMachine() DataDiskParameters = dataDiskParameters; ScheduleParameters = scheduleParameters; LastKnownPowerState = lastKnownPowerState; - ProvisioningState = provisioningState; - UniqueIdentifier = uniqueIdentifier; + CanApplyArtifacts = canApplyArtifacts; + ProvisioningState2 = provisioningState2; + UniqueIdentifier2 = uniqueIdentifier2; + SystemData = systemData; CustomInit(); } @@ -172,17 +389,16 @@ public LabVirtualMachine() public string OwnerUserPrincipalName { get; set; } /// - /// Gets or sets the object identifier of the creator of the virtual - /// machine. + /// Gets the object identifier of the creator of the virtual machine. /// [JsonProperty(PropertyName = "properties.createdByUserId")] - public string CreatedByUserId { get; set; } + public string CreatedByUserId { get; private set; } /// - /// Gets or sets the email address of creator of the virtual machine. + /// Gets the email address of creator of the virtual machine. /// [JsonProperty(PropertyName = "properties.createdByUser")] - public string CreatedByUser { get; set; } + public string CreatedByUser { get; private set; } /// /// Gets or sets the creation date of the virtual machine. @@ -191,11 +407,11 @@ public LabVirtualMachine() public System.DateTime? CreatedDate { get; set; } /// - /// Gets or sets the resource identifier (Microsoft.Compute) of the - /// virtual machine. + /// Gets the resource identifier (Microsoft.Compute) of the virtual + /// machine. /// [JsonProperty(PropertyName = "properties.computeId")] - public string ComputeId { get; set; } + public string ComputeId { get; private set; } /// /// Gets or sets the custom image identifier of the virtual machine. @@ -204,10 +420,31 @@ public LabVirtualMachine() public string CustomImageId { get; set; } /// - /// Gets or sets the OS type of the virtual machine. + /// Gets or sets the shared gallery image version resource identifier + /// of the virtual machine. + /// + [JsonProperty(PropertyName = "properties.galleryImageVersionId")] + public string GalleryImageVersionId { get; set; } + + /// + /// Gets or sets the shared image resource identifier of the virtual + /// machine. + /// + [JsonProperty(PropertyName = "properties.sharedImageId")] + public string SharedImageId { get; set; } + + /// + /// Gets or sets the shared image version for the specified shared + /// image Id. Will use latest if not specified. + /// + [JsonProperty(PropertyName = "properties.sharedImageVersion")] + public string SharedImageVersion { get; set; } + + /// + /// Gets the OS type of the virtual machine. /// [JsonProperty(PropertyName = "properties.osType")] - public string OsType { get; set; } + public string OsType { get; private set; } /// /// Gets or sets the size of the virtual machine. @@ -241,11 +478,10 @@ public LabVirtualMachine() public bool? IsAuthenticationWithSshKey { get; set; } /// - /// Gets or sets the fully-qualified domain name of the virtual - /// machine. + /// Gets the fully-qualified domain name of the virtual machine. /// [JsonProperty(PropertyName = "properties.fqdn")] - public string Fqdn { get; set; } + public string Fqdn { get; private set; } /// /// Gets or sets the lab subnet name of the virtual machine. @@ -274,18 +510,54 @@ public LabVirtualMachine() public IList Artifacts { get; set; } /// - /// Gets or sets the artifact deployment status for the virtual - /// machine. + /// Gets or sets the deployment status of the artifact. + /// + [JsonProperty(PropertyName = "properties.artifactDeploymentStatus.deploymentStatus")] + public string DeploymentStatus { get; set; } + + /// + /// Gets or sets the total count of the artifacts that were + /// successfully applied. + /// + [JsonProperty(PropertyName = "properties.artifactDeploymentStatus.artifactsApplied")] + public int? ArtifactsApplied { get; set; } + + /// + /// Gets or sets the total count of the artifacts that were tentatively + /// applied. /// - [JsonProperty(PropertyName = "properties.artifactDeploymentStatus")] - public ArtifactDeploymentStatusProperties ArtifactDeploymentStatus { get; set; } + [JsonProperty(PropertyName = "properties.artifactDeploymentStatus.totalArtifacts")] + public int? TotalArtifacts { get; set; } /// - /// Gets or sets the Microsoft Azure Marketplace image reference of the - /// virtual machine. + /// Gets or sets the offer of the gallery image. /// - [JsonProperty(PropertyName = "properties.galleryImageReference")] - public GalleryImageReference GalleryImageReference { get; set; } + [JsonProperty(PropertyName = "properties.galleryImageReference.offer")] + public string Offer { get; set; } + + /// + /// Gets or sets the publisher of the gallery image. + /// + [JsonProperty(PropertyName = "properties.galleryImageReference.publisher")] + public string Publisher { get; set; } + + /// + /// Gets or sets the SKU of the gallery image. + /// + [JsonProperty(PropertyName = "properties.galleryImageReference.sku")] + public string Sku { get; set; } + + /// + /// Gets or sets the OS type of the gallery image. + /// + [JsonProperty(PropertyName = "properties.galleryImageReference.osType")] + public string OsType1 { get; set; } + + /// + /// Gets or sets the version of the gallery image. + /// + [JsonProperty(PropertyName = "properties.galleryImageReference.version")] + public string Version { get; set; } /// /// Gets or sets the id of the plan associated with the virtual machine @@ -295,22 +567,409 @@ public LabVirtualMachine() public string PlanId { get; set; } /// - /// Gets the compute virtual machine properties. + /// Gets or sets specifies the size of an empty data disk in gigabytes. + /// This element can be used to overwrite the size of the disk in a + /// virtual machine image. + /// + [JsonProperty(PropertyName = "properties.osDiskSizeGb")] + public int? OsDiskSizeGb { get; set; } + + /// + /// Gets the statuses of the virtual machine. + /// + [JsonProperty(PropertyName = "properties.computeVm.statuses")] + public IList Statuses { get; set; } + + /// + /// Gets the OS type of the virtual machine. + /// + [JsonProperty(PropertyName = "properties.computeVm.osType")] + public string OsType2 { get; set; } + + /// + /// Gets the size of the virtual machine. + /// + [JsonProperty(PropertyName = "properties.computeVm.vmSize")] + public string VmSize { get; set; } + + /// + /// Gets the network interface ID of the virtual machine. + /// + [JsonProperty(PropertyName = "properties.computeVm.networkInterfaceId")] + public string NetworkInterfaceId { get; set; } + + /// + /// Gets OS disk blob uri for the virtual machine. + /// + [JsonProperty(PropertyName = "properties.computeVm.osDiskId")] + public string OsDiskId { get; set; } + + /// + /// Gets data disks blob uri for the virtual machine. + /// + [JsonProperty(PropertyName = "properties.computeVm.dataDiskIds")] + public IList DataDiskIds { get; set; } + + /// + /// Gets all data disks attached to the virtual machine. + /// + [JsonProperty(PropertyName = "properties.computeVm.dataDisks")] + public IList DataDisks { get; set; } + + /// + /// Gets or sets the resource ID of the virtual network. + /// + [JsonProperty(PropertyName = "properties.networkInterface.virtualNetworkId")] + public string VirtualNetworkId { get; set; } + + /// + /// Gets or sets the resource ID of the sub net. + /// + [JsonProperty(PropertyName = "properties.networkInterface.subnetId")] + public string SubnetId { get; set; } + + /// + /// Gets or sets the resource ID of the public IP address. + /// + [JsonProperty(PropertyName = "properties.networkInterface.publicIpAddressId")] + public string PublicIpAddressId { get; set; } + + /// + /// Gets or sets the public IP address. + /// + [JsonProperty(PropertyName = "properties.networkInterface.publicIpAddress")] + public string PublicIpAddress { get; set; } + + /// + /// Gets or sets the private IP address. + /// + [JsonProperty(PropertyName = "properties.networkInterface.privateIpAddress")] + public string PrivateIpAddress { get; set; } + + /// + /// Gets or sets the DNS name. + /// + [JsonProperty(PropertyName = "properties.networkInterface.dnsName")] + public string DnsName { get; set; } + + /// + /// Gets or sets the RdpAuthority property is a server DNS host name or + /// IP address followed by the service port number for RDP (Remote + /// Desktop Protocol). + /// + [JsonProperty(PropertyName = "properties.networkInterface.rdpAuthority")] + public string RdpAuthority { get; set; } + + /// + /// Gets or sets the SshAuthority property is a server DNS host name or + /// IP address followed by the service port number for SSH. + /// + [JsonProperty(PropertyName = "properties.networkInterface.sshAuthority")] + public string SshAuthority { get; set; } + + /// + /// Gets or sets the incoming NAT rules + /// + [JsonProperty(PropertyName = "properties.networkInterface.sharedPublicIpAddressConfiguration.inboundNatRules")] + public IList InboundNatRules { get; set; } + + /// + /// Gets or sets resource tags + /// + [JsonProperty(PropertyName = "properties.applicableSchedule.tags")] + public IDictionary TagsProperty { get; set; } + + /// + /// Gets fully qualified resource ID for the resource. Ex - + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + /// + [JsonProperty(PropertyName = "properties.applicableSchedule.properties.labVmsShutdown.id")] + public string LabVirtualMachineId { get; private set; } + + /// + /// Gets the name of the resource + /// + [JsonProperty(PropertyName = "properties.applicableSchedule.properties.labVmsShutdown.name")] + public string LabVirtualMachineName { get; private set; } + + /// + /// Gets the type of the resource. E.g. + /// "Microsoft.Compute/virtualMachines" or + /// "Microsoft.Storage/storageAccounts" + /// + [JsonProperty(PropertyName = "properties.applicableSchedule.properties.labVmsShutdown.type")] + public string LabVirtualMachineType { get; private set; } + + /// + /// Gets or sets resource tags. + /// + [JsonProperty(PropertyName = "properties.applicableSchedule.properties.labVmsShutdown.tags")] + public IDictionary LabVirtualMachineTags { get; set; } + + /// + /// Gets or sets the geo-location where the resource lives + /// + [JsonProperty(PropertyName = "properties.applicableSchedule.properties.labVmsShutdown.location")] + public string LabVirtualMachineLocation { get; set; } + + /// + /// Gets or sets the status of the schedule (i.e. Enabled, Disabled). + /// Possible values include: 'Enabled', 'Disabled' + /// + [JsonProperty(PropertyName = "properties.applicableSchedule.properties.labVmsShutdown.properties.status")] + public string Status { get; set; } + + /// + /// Gets or sets the task type of the schedule (e.g. + /// LabVmsShutdownTask, LabVmAutoStart). + /// + [JsonProperty(PropertyName = "properties.applicableSchedule.properties.labVmsShutdown.properties.taskType")] + public string TaskType { get; set; } + + /// + /// Gets or sets the days of the week for which the schedule is set + /// (e.g. Sunday, Monday, Tuesday, etc.). + /// + [JsonProperty(PropertyName = "properties.applicableSchedule.properties.labVmsShutdown.properties.weeklyRecurrence.weekdays")] + public IList Weekdays { get; set; } + + /// + /// Gets or sets the time of the day the schedule will occur. + /// + [JsonProperty(PropertyName = "properties.applicableSchedule.properties.labVmsShutdown.properties.weeklyRecurrence.time")] + public string Time { get; set; } + + /// + /// Gets or sets the time of day the schedule will occur. + /// + [JsonProperty(PropertyName = "properties.applicableSchedule.properties.labVmsShutdown.properties.dailyRecurrence.time")] + public string Time1 { get; set; } + + /// + /// Gets or sets minutes of the hour the schedule will run. + /// + [JsonProperty(PropertyName = "properties.applicableSchedule.properties.labVmsShutdown.properties.hourlyRecurrence.minute")] + public int? Minute { get; set; } + + /// + /// Gets or sets the time zone ID (e.g. Pacific Standard time). + /// + [JsonProperty(PropertyName = "properties.applicableSchedule.properties.labVmsShutdown.properties.timeZoneId")] + public string TimeZoneId { get; set; } + + /// + /// Gets or sets if notifications are enabled for this schedule (i.e. + /// Enabled, Disabled). Possible values include: 'Enabled', 'Disabled' + /// + [JsonProperty(PropertyName = "properties.applicableSchedule.properties.labVmsShutdown.properties.notificationSettings.status")] + public string Status1 { get; set; } + + /// + /// Gets or sets time in minutes before event at which notification + /// will be sent. + /// + [JsonProperty(PropertyName = "properties.applicableSchedule.properties.labVmsShutdown.properties.notificationSettings.timeInMinutes")] + public int? TimeInMinutes { get; set; } + + /// + /// Gets or sets the webhook URL to which the notification will be + /// sent. + /// + [JsonProperty(PropertyName = "properties.applicableSchedule.properties.labVmsShutdown.properties.notificationSettings.webhookUrl")] + public string WebhookUrl { get; set; } + + /// + /// Gets or sets the email recipient to send notifications to (can be a + /// list of semi-colon separated email addresses). + /// + [JsonProperty(PropertyName = "properties.applicableSchedule.properties.labVmsShutdown.properties.notificationSettings.emailRecipient")] + public string EmailRecipient { get; set; } + + /// + /// Gets or sets the locale to use when sending a notification + /// (fallback for unsupported languages is EN). + /// + [JsonProperty(PropertyName = "properties.applicableSchedule.properties.labVmsShutdown.properties.notificationSettings.notificationLocale")] + public string NotificationLocale { get; set; } + + /// + /// Gets the creation date of the schedule. + /// + [JsonProperty(PropertyName = "properties.applicableSchedule.properties.labVmsShutdown.properties.createdDate")] + public System.DateTime? CreatedDate1 { get; private set; } + + /// + /// Gets or sets the resource ID to which the schedule belongs + /// + [JsonProperty(PropertyName = "properties.applicableSchedule.properties.labVmsShutdown.properties.targetResourceId")] + public string TargetResourceId { get; set; } + + /// + /// Gets the provisioning status of the resource. + /// + [JsonProperty(PropertyName = "properties.applicableSchedule.properties.labVmsShutdown.properties.provisioningState")] + public string ProvisioningState { get; private set; } + + /// + /// Gets the unique immutable identifier of a resource (Guid). + /// + [JsonProperty(PropertyName = "properties.applicableSchedule.properties.labVmsShutdown.properties.uniqueIdentifier")] + public string UniqueIdentifier { get; private set; } + + /// + /// Gets the system metadata relating to this resource + /// + [JsonProperty(PropertyName = "properties.applicableSchedule.properties.labVmsShutdown.systemData")] + public SystemData ScheduleSystemData { get; private set; } + + /// + /// Gets fully qualified resource ID for the resource. Ex - + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + /// + [JsonProperty(PropertyName = "properties.applicableSchedule.properties.labVmsStartup.id")] + public string Id1 { get; private set; } + + /// + /// Gets the name of the resource + /// + [JsonProperty(PropertyName = "properties.applicableSchedule.properties.labVmsStartup.name")] + public string Name1 { get; private set; } + + /// + /// Gets the type of the resource. E.g. + /// "Microsoft.Compute/virtualMachines" or + /// "Microsoft.Storage/storageAccounts" + /// + [JsonProperty(PropertyName = "properties.applicableSchedule.properties.labVmsStartup.type")] + public string Type1 { get; private set; } + + /// + /// Gets or sets resource tags. + /// + [JsonProperty(PropertyName = "properties.applicableSchedule.properties.labVmsStartup.tags")] + public IDictionary Tags1 { get; set; } + + /// + /// Gets or sets the geo-location where the resource lives /// - [JsonProperty(PropertyName = "properties.computeVm")] - public ComputeVmProperties ComputeVm { get; private set; } + [JsonProperty(PropertyName = "properties.applicableSchedule.properties.labVmsStartup.location")] + public string Location1 { get; set; } /// - /// Gets or sets the network interface properties. + /// Gets or sets the status of the schedule (i.e. Enabled, Disabled). + /// Possible values include: 'Enabled', 'Disabled' /// - [JsonProperty(PropertyName = "properties.networkInterface")] - public NetworkInterfaceProperties NetworkInterface { get; set; } + [JsonProperty(PropertyName = "properties.applicableSchedule.properties.labVmsStartup.properties.status")] + public string Status2 { get; set; } /// - /// Gets the applicable schedule for the virtual machine. + /// Gets or sets the task type of the schedule (e.g. + /// LabVmsShutdownTask, LabVmAutoStart). /// - [JsonProperty(PropertyName = "properties.applicableSchedule")] - public ApplicableSchedule ApplicableSchedule { get; private set; } + [JsonProperty(PropertyName = "properties.applicableSchedule.properties.labVmsStartup.properties.taskType")] + public string TaskType1 { get; set; } + + /// + /// Gets or sets the days of the week for which the schedule is set + /// (e.g. Sunday, Monday, Tuesday, etc.). + /// + [JsonProperty(PropertyName = "properties.applicableSchedule.properties.labVmsStartup.properties.weeklyRecurrence.weekdays")] + public IList Weekdays1 { get; set; } + + /// + /// Gets or sets the time of the day the schedule will occur. + /// + [JsonProperty(PropertyName = "properties.applicableSchedule.properties.labVmsStartup.properties.weeklyRecurrence.time")] + public string Time2 { get; set; } + + /// + /// Gets or sets the time of day the schedule will occur. + /// + [JsonProperty(PropertyName = "properties.applicableSchedule.properties.labVmsStartup.properties.dailyRecurrence.time")] + public string Time3 { get; set; } + + /// + /// Gets or sets minutes of the hour the schedule will run. + /// + [JsonProperty(PropertyName = "properties.applicableSchedule.properties.labVmsStartup.properties.hourlyRecurrence.minute")] + public int? Minute1 { get; set; } + + /// + /// Gets or sets the time zone ID (e.g. Pacific Standard time). + /// + [JsonProperty(PropertyName = "properties.applicableSchedule.properties.labVmsStartup.properties.timeZoneId")] + public string TimeZoneId1 { get; set; } + + /// + /// Gets or sets if notifications are enabled for this schedule (i.e. + /// Enabled, Disabled). Possible values include: 'Enabled', 'Disabled' + /// + [JsonProperty(PropertyName = "properties.applicableSchedule.properties.labVmsStartup.properties.notificationSettings.status")] + public string Status3 { get; set; } + + /// + /// Gets or sets time in minutes before event at which notification + /// will be sent. + /// + [JsonProperty(PropertyName = "properties.applicableSchedule.properties.labVmsStartup.properties.notificationSettings.timeInMinutes")] + public int? TimeInMinutes1 { get; set; } + + /// + /// Gets or sets the webhook URL to which the notification will be + /// sent. + /// + [JsonProperty(PropertyName = "properties.applicableSchedule.properties.labVmsStartup.properties.notificationSettings.webhookUrl")] + public string WebhookUrl1 { get; set; } + + /// + /// Gets or sets the email recipient to send notifications to (can be a + /// list of semi-colon separated email addresses). + /// + [JsonProperty(PropertyName = "properties.applicableSchedule.properties.labVmsStartup.properties.notificationSettings.emailRecipient")] + public string EmailRecipient1 { get; set; } + + /// + /// Gets or sets the locale to use when sending a notification + /// (fallback for unsupported languages is EN). + /// + [JsonProperty(PropertyName = "properties.applicableSchedule.properties.labVmsStartup.properties.notificationSettings.notificationLocale")] + public string NotificationLocale1 { get; set; } + + /// + /// Gets the creation date of the schedule. + /// + [JsonProperty(PropertyName = "properties.applicableSchedule.properties.labVmsStartup.properties.createdDate")] + public System.DateTime? CreatedDate2 { get; private set; } + + /// + /// Gets or sets the resource ID to which the schedule belongs + /// + [JsonProperty(PropertyName = "properties.applicableSchedule.properties.labVmsStartup.properties.targetResourceId")] + public string TargetResourceId1 { get; set; } + + /// + /// Gets the provisioning status of the resource. + /// + [JsonProperty(PropertyName = "properties.applicableSchedule.properties.labVmsStartup.properties.provisioningState")] + public string ProvisioningState1 { get; private set; } + + /// + /// Gets the unique immutable identifier of a resource (Guid). + /// + [JsonProperty(PropertyName = "properties.applicableSchedule.properties.labVmsStartup.properties.uniqueIdentifier")] + public string UniqueIdentifier1 { get; private set; } + + /// + /// Gets the system metadata relating to this resource + /// + [JsonProperty(PropertyName = "properties.applicableSchedule.properties.labVmsStartup.systemData")] + public SystemData SystemData1 { get; private set; } + + /// + /// Gets the system metadata relating to this resource + /// + [JsonProperty(PropertyName = "properties.applicableSchedule.systemData")] + public SystemData SystemData2 { get; private set; } /// /// Gets or sets the expiration date for VM. @@ -327,18 +986,19 @@ public LabVirtualMachine() /// /// Gets or sets storage type to use for virtual machine (i.e. - /// Standard, Premium). + /// Standard, Premium, StandardSSD). Possible values include: + /// 'Standard', 'Premium', 'StandardSSD' /// [JsonProperty(PropertyName = "properties.storageType")] public string StorageType { get; set; } /// - /// Gets or sets tells source of creation of lab virtual machine. - /// Output property only. Possible values include: 'FromCustomImage', - /// 'FromGalleryImage' + /// Gets tells source of creation of lab virtual machine. Output + /// property only. Possible values include: 'FromCustomImage', + /// 'FromGalleryImage', 'FromSharedGalleryImage' /// [JsonProperty(PropertyName = "properties.virtualMachineCreationSource")] - public string VirtualMachineCreationSource { get; set; } + public string VirtualMachineCreationSource { get; private set; } /// /// Gets or sets the resource ID of the environment that contains this @@ -361,22 +1021,53 @@ public LabVirtualMachine() public IList ScheduleParameters { get; set; } /// - /// Gets or sets last known compute power state captured in DTL + /// Gets last known compute power state captured in DTL /// [JsonProperty(PropertyName = "properties.lastKnownPowerState")] - public string LastKnownPowerState { get; set; } + public string LastKnownPowerState { get; private set; } + + /// + /// Gets flag to determine if apply artifacts can be triggered at the + /// time of fetching the document. + /// + [JsonProperty(PropertyName = "properties.canApplyArtifacts")] + public bool? CanApplyArtifacts { get; private set; } /// /// Gets the provisioning status of the resource. /// [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; private set; } + public string ProvisioningState2 { get; private set; } /// /// Gets the unique immutable identifier of a resource (Guid). /// [JsonProperty(PropertyName = "properties.uniqueIdentifier")] - public string UniqueIdentifier { get; private set; } + public string UniqueIdentifier2 { get; private set; } + /// + /// Gets the system metadata relating to this resource + /// + [JsonProperty(PropertyName = "systemData")] + public SystemData SystemData { get; private set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public override void Validate() + { + base.Validate(); + if (LabVirtualMachineLocation == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "LabVirtualMachineLocation"); + } + if (Location1 == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Location1"); + } + } } } diff --git a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/LabVirtualMachineCreationParameter.cs b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/LabVirtualMachineCreationParameter.cs index 3ff647fd5600..c845a2d93b5c 100644 --- a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/LabVirtualMachineCreationParameter.cs +++ b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/LabVirtualMachineCreationParameter.cs @@ -11,7 +11,6 @@ namespace Microsoft.Azure.Management.DevTestLabs.Models { using Microsoft.Rest; - using Microsoft.Rest.Serialization; using Newtonsoft.Json; using System.Collections; using System.Collections.Generic; @@ -20,7 +19,6 @@ namespace Microsoft.Azure.Management.DevTestLabs.Models /// /// Properties for creating a virtual machine. /// - [Rest.Serialization.JsonTransformation] public partial class LabVirtualMachineCreationParameter { /// @@ -36,106 +34,15 @@ public LabVirtualMachineCreationParameter() /// Initializes a new instance of the /// LabVirtualMachineCreationParameter class. /// - /// The number of virtual machine - /// instances to create. - /// The notes of the virtual machine. - /// The object identifier of the owner of - /// the virtual machine. - /// The user principal name of the - /// virtual machine owner. - /// The object identifier of the creator - /// of the virtual machine. - /// The email address of creator of the - /// virtual machine. - /// The creation date of the virtual - /// machine. - /// The resource identifier (Microsoft.Compute) - /// of the virtual machine. - /// The custom image identifier of the - /// virtual machine. - /// The OS type of the virtual machine. - /// The size of the virtual machine. - /// The user name of the virtual - /// machine. - /// The password of the virtual machine - /// administrator. - /// The SSH key of the virtual machine - /// administrator. - /// Indicates whether this - /// virtual machine uses an SSH key for authentication. - /// The fully-qualified domain name of the virtual - /// machine. - /// The lab subnet name of the virtual - /// machine. - /// The lab virtual network - /// identifier of the virtual machine. - /// Indicates whether the virtual - /// machine is to be created without a public IP address. - /// The artifacts to be installed on the - /// virtual machine. - /// The artifact deployment - /// status for the virtual machine. - /// The Microsoft Azure Marketplace - /// image reference of the virtual machine. - /// The id of the plan associated with the virtual - /// machine image - /// The network interface - /// properties. - /// The expiration date for VM. - /// Indicates whether another user can take - /// ownership of the virtual machine - /// Storage type to use for virtual machine - /// (i.e. Standard, Premium). - /// Tells source of creation - /// of lab virtual machine. Output property only. Possible values - /// include: 'FromCustomImage', 'FromGalleryImage' - /// The resource ID of the environment that - /// contains this virtual machine, if any. - /// New or existing data disks to - /// attach to the virtual machine after creation - /// Virtual Machine schedules to be - /// created - /// Last known compute power state - /// captured in DTL + /// The properties of the resource. /// The name of the virtual machine or /// environment /// The location of the new virtual machine or /// environment /// The tags of the resource. - public LabVirtualMachineCreationParameter(BulkCreationParameters bulkCreationParameters = default(BulkCreationParameters), string notes = default(string), string ownerObjectId = default(string), string ownerUserPrincipalName = default(string), string createdByUserId = default(string), string createdByUser = default(string), System.DateTime? createdDate = default(System.DateTime?), string computeId = default(string), string customImageId = default(string), string osType = default(string), string size = default(string), string userName = default(string), string password = default(string), string sshKey = default(string), bool? isAuthenticationWithSshKey = default(bool?), string fqdn = default(string), string labSubnetName = default(string), string labVirtualNetworkId = default(string), bool? disallowPublicIpAddress = default(bool?), IList artifacts = default(IList), ArtifactDeploymentStatusProperties artifactDeploymentStatus = default(ArtifactDeploymentStatusProperties), GalleryImageReference galleryImageReference = default(GalleryImageReference), string planId = default(string), NetworkInterfaceProperties networkInterface = default(NetworkInterfaceProperties), System.DateTime? expirationDate = default(System.DateTime?), bool? allowClaim = default(bool?), string storageType = default(string), string virtualMachineCreationSource = default(string), string environmentId = default(string), IList dataDiskParameters = default(IList), IList scheduleParameters = default(IList), string lastKnownPowerState = default(string), string name = default(string), string location = default(string), IDictionary tags = default(IDictionary)) + public LabVirtualMachineCreationParameter(LabVirtualMachineCreationParameterProperties properties, string name = default(string), string location = default(string), IDictionary tags = default(IDictionary)) { - BulkCreationParameters = bulkCreationParameters; - Notes = notes; - OwnerObjectId = ownerObjectId; - OwnerUserPrincipalName = ownerUserPrincipalName; - CreatedByUserId = createdByUserId; - CreatedByUser = createdByUser; - CreatedDate = createdDate; - ComputeId = computeId; - CustomImageId = customImageId; - OsType = osType; - Size = size; - UserName = userName; - Password = password; - SshKey = sshKey; - IsAuthenticationWithSshKey = isAuthenticationWithSshKey; - Fqdn = fqdn; - LabSubnetName = labSubnetName; - LabVirtualNetworkId = labVirtualNetworkId; - DisallowPublicIpAddress = disallowPublicIpAddress; - Artifacts = artifacts; - ArtifactDeploymentStatus = artifactDeploymentStatus; - GalleryImageReference = galleryImageReference; - PlanId = planId; - NetworkInterface = networkInterface; - ExpirationDate = expirationDate; - AllowClaim = allowClaim; - StorageType = storageType; - VirtualMachineCreationSource = virtualMachineCreationSource; - EnvironmentId = environmentId; - DataDiskParameters = dataDiskParameters; - ScheduleParameters = scheduleParameters; - LastKnownPowerState = lastKnownPowerState; + Properties = properties; Name = name; Location = location; Tags = tags; @@ -148,212 +55,10 @@ public LabVirtualMachineCreationParameter() partial void CustomInit(); /// - /// Gets or sets the number of virtual machine instances to create. + /// Gets or sets the properties of the resource. /// - [JsonProperty(PropertyName = "properties.bulkCreationParameters")] - public BulkCreationParameters BulkCreationParameters { get; set; } - - /// - /// Gets or sets the notes of the virtual machine. - /// - [JsonProperty(PropertyName = "properties.notes")] - public string Notes { get; set; } - - /// - /// Gets or sets the object identifier of the owner of the virtual - /// machine. - /// - [JsonProperty(PropertyName = "properties.ownerObjectId")] - public string OwnerObjectId { get; set; } - - /// - /// Gets or sets the user principal name of the virtual machine owner. - /// - [JsonProperty(PropertyName = "properties.ownerUserPrincipalName")] - public string OwnerUserPrincipalName { get; set; } - - /// - /// Gets or sets the object identifier of the creator of the virtual - /// machine. - /// - [JsonProperty(PropertyName = "properties.createdByUserId")] - public string CreatedByUserId { get; set; } - - /// - /// Gets or sets the email address of creator of the virtual machine. - /// - [JsonProperty(PropertyName = "properties.createdByUser")] - public string CreatedByUser { get; set; } - - /// - /// Gets or sets the creation date of the virtual machine. - /// - [JsonProperty(PropertyName = "properties.createdDate")] - public System.DateTime? CreatedDate { get; set; } - - /// - /// Gets or sets the resource identifier (Microsoft.Compute) of the - /// virtual machine. - /// - [JsonProperty(PropertyName = "properties.computeId")] - public string ComputeId { get; set; } - - /// - /// Gets or sets the custom image identifier of the virtual machine. - /// - [JsonProperty(PropertyName = "properties.customImageId")] - public string CustomImageId { get; set; } - - /// - /// Gets or sets the OS type of the virtual machine. - /// - [JsonProperty(PropertyName = "properties.osType")] - public string OsType { get; set; } - - /// - /// Gets or sets the size of the virtual machine. - /// - [JsonProperty(PropertyName = "properties.size")] - public string Size { get; set; } - - /// - /// Gets or sets the user name of the virtual machine. - /// - [JsonProperty(PropertyName = "properties.userName")] - public string UserName { get; set; } - - /// - /// Gets or sets the password of the virtual machine administrator. - /// - [JsonProperty(PropertyName = "properties.password")] - public string Password { get; set; } - - /// - /// Gets or sets the SSH key of the virtual machine administrator. - /// - [JsonProperty(PropertyName = "properties.sshKey")] - public string SshKey { get; set; } - - /// - /// Gets or sets indicates whether this virtual machine uses an SSH key - /// for authentication. - /// - [JsonProperty(PropertyName = "properties.isAuthenticationWithSshKey")] - public bool? IsAuthenticationWithSshKey { get; set; } - - /// - /// Gets or sets the fully-qualified domain name of the virtual - /// machine. - /// - [JsonProperty(PropertyName = "properties.fqdn")] - public string Fqdn { get; set; } - - /// - /// Gets or sets the lab subnet name of the virtual machine. - /// - [JsonProperty(PropertyName = "properties.labSubnetName")] - public string LabSubnetName { get; set; } - - /// - /// Gets or sets the lab virtual network identifier of the virtual - /// machine. - /// - [JsonProperty(PropertyName = "properties.labVirtualNetworkId")] - public string LabVirtualNetworkId { get; set; } - - /// - /// Gets or sets indicates whether the virtual machine is to be created - /// without a public IP address. - /// - [JsonProperty(PropertyName = "properties.disallowPublicIpAddress")] - public bool? DisallowPublicIpAddress { get; set; } - - /// - /// Gets or sets the artifacts to be installed on the virtual machine. - /// - [JsonProperty(PropertyName = "properties.artifacts")] - public IList Artifacts { get; set; } - - /// - /// Gets or sets the artifact deployment status for the virtual - /// machine. - /// - [JsonProperty(PropertyName = "properties.artifactDeploymentStatus")] - public ArtifactDeploymentStatusProperties ArtifactDeploymentStatus { get; set; } - - /// - /// Gets or sets the Microsoft Azure Marketplace image reference of the - /// virtual machine. - /// - [JsonProperty(PropertyName = "properties.galleryImageReference")] - public GalleryImageReference GalleryImageReference { get; set; } - - /// - /// Gets or sets the id of the plan associated with the virtual machine - /// image - /// - [JsonProperty(PropertyName = "properties.planId")] - public string PlanId { get; set; } - - /// - /// Gets or sets the network interface properties. - /// - [JsonProperty(PropertyName = "properties.networkInterface")] - public NetworkInterfaceProperties NetworkInterface { get; set; } - - /// - /// Gets or sets the expiration date for VM. - /// - [JsonProperty(PropertyName = "properties.expirationDate")] - public System.DateTime? ExpirationDate { get; set; } - - /// - /// Gets or sets indicates whether another user can take ownership of - /// the virtual machine - /// - [JsonProperty(PropertyName = "properties.allowClaim")] - public bool? AllowClaim { get; set; } - - /// - /// Gets or sets storage type to use for virtual machine (i.e. - /// Standard, Premium). - /// - [JsonProperty(PropertyName = "properties.storageType")] - public string StorageType { get; set; } - - /// - /// Gets or sets tells source of creation of lab virtual machine. - /// Output property only. Possible values include: 'FromCustomImage', - /// 'FromGalleryImage' - /// - [JsonProperty(PropertyName = "properties.virtualMachineCreationSource")] - public string VirtualMachineCreationSource { get; set; } - - /// - /// Gets or sets the resource ID of the environment that contains this - /// virtual machine, if any. - /// - [JsonProperty(PropertyName = "properties.environmentId")] - public string EnvironmentId { get; set; } - - /// - /// Gets or sets new or existing data disks to attach to the virtual - /// machine after creation - /// - [JsonProperty(PropertyName = "properties.dataDiskParameters")] - public IList DataDiskParameters { get; set; } - - /// - /// Gets or sets virtual Machine schedules to be created - /// - [JsonProperty(PropertyName = "properties.scheduleParameters")] - public IList ScheduleParameters { get; set; } - - /// - /// Gets or sets last known compute power state captured in DTL - /// - [JsonProperty(PropertyName = "properties.lastKnownPowerState")] - public string LastKnownPowerState { get; set; } + [JsonProperty(PropertyName = "properties")] + public LabVirtualMachineCreationParameterProperties Properties { get; set; } /// /// Gets or sets the name of the virtual machine or environment @@ -373,5 +78,22 @@ public LabVirtualMachineCreationParameter() [JsonProperty(PropertyName = "tags")] public IDictionary Tags { get; set; } + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (Properties == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Properties"); + } + if (Properties != null) + { + Properties.Validate(); + } + } } } diff --git a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/LabVirtualMachineCreationParameterFragment.cs b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/LabVirtualMachineCreationParameterFragment.cs deleted file mode 100644 index df4407baf182..000000000000 --- a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/LabVirtualMachineCreationParameterFragment.cs +++ /dev/null @@ -1,377 +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.DevTestLabs.Models -{ - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - - /// - /// Properties for creating a virtual machine. - /// - [Rest.Serialization.JsonTransformation] - public partial class LabVirtualMachineCreationParameterFragment - { - /// - /// Initializes a new instance of the - /// LabVirtualMachineCreationParameterFragment class. - /// - public LabVirtualMachineCreationParameterFragment() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the - /// LabVirtualMachineCreationParameterFragment class. - /// - /// The number of virtual machine - /// instances to create. - /// The notes of the virtual machine. - /// The object identifier of the owner of - /// the virtual machine. - /// The user principal name of the - /// virtual machine owner. - /// The object identifier of the creator - /// of the virtual machine. - /// The email address of creator of the - /// virtual machine. - /// The creation date of the virtual - /// machine. - /// The resource identifier (Microsoft.Compute) - /// of the virtual machine. - /// The custom image identifier of the - /// virtual machine. - /// The OS type of the virtual machine. - /// The size of the virtual machine. - /// The user name of the virtual - /// machine. - /// The password of the virtual machine - /// administrator. - /// The SSH key of the virtual machine - /// administrator. - /// Indicates whether this - /// virtual machine uses an SSH key for authentication. - /// The fully-qualified domain name of the virtual - /// machine. - /// The lab subnet name of the virtual - /// machine. - /// The lab virtual network - /// identifier of the virtual machine. - /// Indicates whether the virtual - /// machine is to be created without a public IP address. - /// The artifacts to be installed on the - /// virtual machine. - /// The artifact deployment - /// status for the virtual machine. - /// The Microsoft Azure Marketplace - /// image reference of the virtual machine. - /// The id of the plan associated with the virtual - /// machine image - /// The network interface - /// properties. - /// The expiration date for VM. - /// Indicates whether another user can take - /// ownership of the virtual machine - /// Storage type to use for virtual machine - /// (i.e. Standard, Premium). - /// Tells source of creation - /// of lab virtual machine. Output property only. Possible values - /// include: 'FromCustomImage', 'FromGalleryImage' - /// The resource ID of the environment that - /// contains this virtual machine, if any. - /// New or existing data disks to - /// attach to the virtual machine after creation - /// Virtual Machine schedules to be - /// created - /// Last known compute power state - /// captured in DTL - /// The name of the virtual machine or - /// environment - /// The location of the new virtual machine or - /// environment - /// The tags of the resource. - public LabVirtualMachineCreationParameterFragment(BulkCreationParametersFragment bulkCreationParameters = default(BulkCreationParametersFragment), string notes = default(string), string ownerObjectId = default(string), string ownerUserPrincipalName = default(string), string createdByUserId = default(string), string createdByUser = default(string), System.DateTime? createdDate = default(System.DateTime?), string computeId = default(string), string customImageId = default(string), string osType = default(string), string size = default(string), string userName = default(string), string password = default(string), string sshKey = default(string), bool? isAuthenticationWithSshKey = default(bool?), string fqdn = default(string), string labSubnetName = default(string), string labVirtualNetworkId = default(string), bool? disallowPublicIpAddress = default(bool?), IList artifacts = default(IList), ArtifactDeploymentStatusPropertiesFragment artifactDeploymentStatus = default(ArtifactDeploymentStatusPropertiesFragment), GalleryImageReferenceFragment galleryImageReference = default(GalleryImageReferenceFragment), string planId = default(string), NetworkInterfacePropertiesFragment networkInterface = default(NetworkInterfacePropertiesFragment), System.DateTime? expirationDate = default(System.DateTime?), bool? allowClaim = default(bool?), string storageType = default(string), string virtualMachineCreationSource = default(string), string environmentId = default(string), IList dataDiskParameters = default(IList), IList scheduleParameters = default(IList), string lastKnownPowerState = default(string), string name = default(string), string location = default(string), IDictionary tags = default(IDictionary)) - { - BulkCreationParameters = bulkCreationParameters; - Notes = notes; - OwnerObjectId = ownerObjectId; - OwnerUserPrincipalName = ownerUserPrincipalName; - CreatedByUserId = createdByUserId; - CreatedByUser = createdByUser; - CreatedDate = createdDate; - ComputeId = computeId; - CustomImageId = customImageId; - OsType = osType; - Size = size; - UserName = userName; - Password = password; - SshKey = sshKey; - IsAuthenticationWithSshKey = isAuthenticationWithSshKey; - Fqdn = fqdn; - LabSubnetName = labSubnetName; - LabVirtualNetworkId = labVirtualNetworkId; - DisallowPublicIpAddress = disallowPublicIpAddress; - Artifacts = artifacts; - ArtifactDeploymentStatus = artifactDeploymentStatus; - GalleryImageReference = galleryImageReference; - PlanId = planId; - NetworkInterface = networkInterface; - ExpirationDate = expirationDate; - AllowClaim = allowClaim; - StorageType = storageType; - VirtualMachineCreationSource = virtualMachineCreationSource; - EnvironmentId = environmentId; - DataDiskParameters = dataDiskParameters; - ScheduleParameters = scheduleParameters; - LastKnownPowerState = lastKnownPowerState; - Name = name; - Location = location; - Tags = tags; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the number of virtual machine instances to create. - /// - [JsonProperty(PropertyName = "properties.bulkCreationParameters")] - public BulkCreationParametersFragment BulkCreationParameters { get; set; } - - /// - /// Gets or sets the notes of the virtual machine. - /// - [JsonProperty(PropertyName = "properties.notes")] - public string Notes { get; set; } - - /// - /// Gets or sets the object identifier of the owner of the virtual - /// machine. - /// - [JsonProperty(PropertyName = "properties.ownerObjectId")] - public string OwnerObjectId { get; set; } - - /// - /// Gets or sets the user principal name of the virtual machine owner. - /// - [JsonProperty(PropertyName = "properties.ownerUserPrincipalName")] - public string OwnerUserPrincipalName { get; set; } - - /// - /// Gets or sets the object identifier of the creator of the virtual - /// machine. - /// - [JsonProperty(PropertyName = "properties.createdByUserId")] - public string CreatedByUserId { get; set; } - - /// - /// Gets or sets the email address of creator of the virtual machine. - /// - [JsonProperty(PropertyName = "properties.createdByUser")] - public string CreatedByUser { get; set; } - - /// - /// Gets or sets the creation date of the virtual machine. - /// - [JsonProperty(PropertyName = "properties.createdDate")] - public System.DateTime? CreatedDate { get; set; } - - /// - /// Gets or sets the resource identifier (Microsoft.Compute) of the - /// virtual machine. - /// - [JsonProperty(PropertyName = "properties.computeId")] - public string ComputeId { get; set; } - - /// - /// Gets or sets the custom image identifier of the virtual machine. - /// - [JsonProperty(PropertyName = "properties.customImageId")] - public string CustomImageId { get; set; } - - /// - /// Gets or sets the OS type of the virtual machine. - /// - [JsonProperty(PropertyName = "properties.osType")] - public string OsType { get; set; } - - /// - /// Gets or sets the size of the virtual machine. - /// - [JsonProperty(PropertyName = "properties.size")] - public string Size { get; set; } - - /// - /// Gets or sets the user name of the virtual machine. - /// - [JsonProperty(PropertyName = "properties.userName")] - public string UserName { get; set; } - - /// - /// Gets or sets the password of the virtual machine administrator. - /// - [JsonProperty(PropertyName = "properties.password")] - public string Password { get; set; } - - /// - /// Gets or sets the SSH key of the virtual machine administrator. - /// - [JsonProperty(PropertyName = "properties.sshKey")] - public string SshKey { get; set; } - - /// - /// Gets or sets indicates whether this virtual machine uses an SSH key - /// for authentication. - /// - [JsonProperty(PropertyName = "properties.isAuthenticationWithSshKey")] - public bool? IsAuthenticationWithSshKey { get; set; } - - /// - /// Gets or sets the fully-qualified domain name of the virtual - /// machine. - /// - [JsonProperty(PropertyName = "properties.fqdn")] - public string Fqdn { get; set; } - - /// - /// Gets or sets the lab subnet name of the virtual machine. - /// - [JsonProperty(PropertyName = "properties.labSubnetName")] - public string LabSubnetName { get; set; } - - /// - /// Gets or sets the lab virtual network identifier of the virtual - /// machine. - /// - [JsonProperty(PropertyName = "properties.labVirtualNetworkId")] - public string LabVirtualNetworkId { get; set; } - - /// - /// Gets or sets indicates whether the virtual machine is to be created - /// without a public IP address. - /// - [JsonProperty(PropertyName = "properties.disallowPublicIpAddress")] - public bool? DisallowPublicIpAddress { get; set; } - - /// - /// Gets or sets the artifacts to be installed on the virtual machine. - /// - [JsonProperty(PropertyName = "properties.artifacts")] - public IList Artifacts { get; set; } - - /// - /// Gets or sets the artifact deployment status for the virtual - /// machine. - /// - [JsonProperty(PropertyName = "properties.artifactDeploymentStatus")] - public ArtifactDeploymentStatusPropertiesFragment ArtifactDeploymentStatus { get; set; } - - /// - /// Gets or sets the Microsoft Azure Marketplace image reference of the - /// virtual machine. - /// - [JsonProperty(PropertyName = "properties.galleryImageReference")] - public GalleryImageReferenceFragment GalleryImageReference { get; set; } - - /// - /// Gets or sets the id of the plan associated with the virtual machine - /// image - /// - [JsonProperty(PropertyName = "properties.planId")] - public string PlanId { get; set; } - - /// - /// Gets or sets the network interface properties. - /// - [JsonProperty(PropertyName = "properties.networkInterface")] - public NetworkInterfacePropertiesFragment NetworkInterface { get; set; } - - /// - /// Gets or sets the expiration date for VM. - /// - [JsonProperty(PropertyName = "properties.expirationDate")] - public System.DateTime? ExpirationDate { get; set; } - - /// - /// Gets or sets indicates whether another user can take ownership of - /// the virtual machine - /// - [JsonProperty(PropertyName = "properties.allowClaim")] - public bool? AllowClaim { get; set; } - - /// - /// Gets or sets storage type to use for virtual machine (i.e. - /// Standard, Premium). - /// - [JsonProperty(PropertyName = "properties.storageType")] - public string StorageType { get; set; } - - /// - /// Gets or sets tells source of creation of lab virtual machine. - /// Output property only. Possible values include: 'FromCustomImage', - /// 'FromGalleryImage' - /// - [JsonProperty(PropertyName = "properties.virtualMachineCreationSource")] - public string VirtualMachineCreationSource { get; set; } - - /// - /// Gets or sets the resource ID of the environment that contains this - /// virtual machine, if any. - /// - [JsonProperty(PropertyName = "properties.environmentId")] - public string EnvironmentId { get; set; } - - /// - /// Gets or sets new or existing data disks to attach to the virtual - /// machine after creation - /// - [JsonProperty(PropertyName = "properties.dataDiskParameters")] - public IList DataDiskParameters { get; set; } - - /// - /// Gets or sets virtual Machine schedules to be created - /// - [JsonProperty(PropertyName = "properties.scheduleParameters")] - public IList ScheduleParameters { get; set; } - - /// - /// Gets or sets last known compute power state captured in DTL - /// - [JsonProperty(PropertyName = "properties.lastKnownPowerState")] - public string LastKnownPowerState { get; set; } - - /// - /// Gets or sets the name of the virtual machine or environment - /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } - - /// - /// Gets or sets the location of the new virtual machine or environment - /// - [JsonProperty(PropertyName = "location")] - public string Location { get; set; } - - /// - /// Gets or sets the tags of the resource. - /// - [JsonProperty(PropertyName = "tags")] - public IDictionary Tags { get; set; } - - } -} diff --git a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/LabVirtualMachineFragment.cs b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/LabVirtualMachineFragment.cs index b76a4e63da3b..3e8ccdc9bfe3 100644 --- a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/LabVirtualMachineFragment.cs +++ b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/LabVirtualMachineFragment.cs @@ -10,18 +10,14 @@ namespace Microsoft.Azure.Management.DevTestLabs.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; using System.Collections; using System.Collections.Generic; using System.Linq; /// - /// A virtual machine. + /// Patch /// - [Rest.Serialization.JsonTransformation] - public partial class LabVirtualMachineFragment : UpdateResource + public partial class LabVirtualMachineFragment : Tags { /// /// Initializes a new instance of the LabVirtualMachineFragment class. @@ -34,100 +30,10 @@ public LabVirtualMachineFragment() /// /// Initializes a new instance of the LabVirtualMachineFragment class. /// - /// The tags of the resource. - /// The notes of the virtual machine. - /// The object identifier of the owner of - /// the virtual machine. - /// The user principal name of the - /// virtual machine owner. - /// The object identifier of the creator - /// of the virtual machine. - /// The email address of creator of the - /// virtual machine. - /// The creation date of the virtual - /// machine. - /// The resource identifier (Microsoft.Compute) - /// of the virtual machine. - /// The custom image identifier of the - /// virtual machine. - /// The OS type of the virtual machine. - /// The size of the virtual machine. - /// The user name of the virtual - /// machine. - /// The password of the virtual machine - /// administrator. - /// The SSH key of the virtual machine - /// administrator. - /// Indicates whether this - /// virtual machine uses an SSH key for authentication. - /// The fully-qualified domain name of the virtual - /// machine. - /// The lab subnet name of the virtual - /// machine. - /// The lab virtual network - /// identifier of the virtual machine. - /// Indicates whether the virtual - /// machine is to be created without a public IP address. - /// The artifacts to be installed on the - /// virtual machine. - /// The artifact deployment - /// status for the virtual machine. - /// The Microsoft Azure Marketplace - /// image reference of the virtual machine. - /// The id of the plan associated with the virtual - /// machine image - /// The network interface - /// properties. - /// The expiration date for VM. - /// Indicates whether another user can take - /// ownership of the virtual machine - /// Storage type to use for virtual machine - /// (i.e. Standard, Premium). - /// Tells source of creation - /// of lab virtual machine. Output property only. Possible values - /// include: 'FromCustomImage', 'FromGalleryImage' - /// The resource ID of the environment that - /// contains this virtual machine, if any. - /// New or existing data disks to - /// attach to the virtual machine after creation - /// Virtual Machine schedules to be - /// created - /// Last known compute power state - /// captured in DTL - public LabVirtualMachineFragment(IDictionary tags = default(IDictionary), string notes = default(string), string ownerObjectId = default(string), string ownerUserPrincipalName = default(string), string createdByUserId = default(string), string createdByUser = default(string), System.DateTime? createdDate = default(System.DateTime?), string computeId = default(string), string customImageId = default(string), string osType = default(string), string size = default(string), string userName = default(string), string password = default(string), string sshKey = default(string), bool? isAuthenticationWithSshKey = default(bool?), string fqdn = default(string), string labSubnetName = default(string), string labVirtualNetworkId = default(string), bool? disallowPublicIpAddress = default(bool?), IList artifacts = default(IList), ArtifactDeploymentStatusPropertiesFragment artifactDeploymentStatus = default(ArtifactDeploymentStatusPropertiesFragment), GalleryImageReferenceFragment galleryImageReference = default(GalleryImageReferenceFragment), string planId = default(string), NetworkInterfacePropertiesFragment networkInterface = default(NetworkInterfacePropertiesFragment), System.DateTime? expirationDate = default(System.DateTime?), bool? allowClaim = default(bool?), string storageType = default(string), string virtualMachineCreationSource = default(string), string environmentId = default(string), IList dataDiskParameters = default(IList), IList scheduleParameters = default(IList), string lastKnownPowerState = default(string)) - : base(tags) + /// Resource tags + public LabVirtualMachineFragment(IDictionary tagsProperty = default(IDictionary)) + : base(tagsProperty) { - Notes = notes; - OwnerObjectId = ownerObjectId; - OwnerUserPrincipalName = ownerUserPrincipalName; - CreatedByUserId = createdByUserId; - CreatedByUser = createdByUser; - CreatedDate = createdDate; - ComputeId = computeId; - CustomImageId = customImageId; - OsType = osType; - Size = size; - UserName = userName; - Password = password; - SshKey = sshKey; - IsAuthenticationWithSshKey = isAuthenticationWithSshKey; - Fqdn = fqdn; - LabSubnetName = labSubnetName; - LabVirtualNetworkId = labVirtualNetworkId; - DisallowPublicIpAddress = disallowPublicIpAddress; - Artifacts = artifacts; - ArtifactDeploymentStatus = artifactDeploymentStatus; - GalleryImageReference = galleryImageReference; - PlanId = planId; - NetworkInterface = networkInterface; - ExpirationDate = expirationDate; - AllowClaim = allowClaim; - StorageType = storageType; - VirtualMachineCreationSource = virtualMachineCreationSource; - EnvironmentId = environmentId; - DataDiskParameters = dataDiskParameters; - ScheduleParameters = scheduleParameters; - LastKnownPowerState = lastKnownPowerState; CustomInit(); } @@ -136,207 +42,5 @@ public LabVirtualMachineFragment() /// partial void CustomInit(); - /// - /// Gets or sets the notes of the virtual machine. - /// - [JsonProperty(PropertyName = "properties.notes")] - public string Notes { get; set; } - - /// - /// Gets or sets the object identifier of the owner of the virtual - /// machine. - /// - [JsonProperty(PropertyName = "properties.ownerObjectId")] - public string OwnerObjectId { get; set; } - - /// - /// Gets or sets the user principal name of the virtual machine owner. - /// - [JsonProperty(PropertyName = "properties.ownerUserPrincipalName")] - public string OwnerUserPrincipalName { get; set; } - - /// - /// Gets or sets the object identifier of the creator of the virtual - /// machine. - /// - [JsonProperty(PropertyName = "properties.createdByUserId")] - public string CreatedByUserId { get; set; } - - /// - /// Gets or sets the email address of creator of the virtual machine. - /// - [JsonProperty(PropertyName = "properties.createdByUser")] - public string CreatedByUser { get; set; } - - /// - /// Gets or sets the creation date of the virtual machine. - /// - [JsonProperty(PropertyName = "properties.createdDate")] - public System.DateTime? CreatedDate { get; set; } - - /// - /// Gets or sets the resource identifier (Microsoft.Compute) of the - /// virtual machine. - /// - [JsonProperty(PropertyName = "properties.computeId")] - public string ComputeId { get; set; } - - /// - /// Gets or sets the custom image identifier of the virtual machine. - /// - [JsonProperty(PropertyName = "properties.customImageId")] - public string CustomImageId { get; set; } - - /// - /// Gets or sets the OS type of the virtual machine. - /// - [JsonProperty(PropertyName = "properties.osType")] - public string OsType { get; set; } - - /// - /// Gets or sets the size of the virtual machine. - /// - [JsonProperty(PropertyName = "properties.size")] - public string Size { get; set; } - - /// - /// Gets or sets the user name of the virtual machine. - /// - [JsonProperty(PropertyName = "properties.userName")] - public string UserName { get; set; } - - /// - /// Gets or sets the password of the virtual machine administrator. - /// - [JsonProperty(PropertyName = "properties.password")] - public string Password { get; set; } - - /// - /// Gets or sets the SSH key of the virtual machine administrator. - /// - [JsonProperty(PropertyName = "properties.sshKey")] - public string SshKey { get; set; } - - /// - /// Gets or sets indicates whether this virtual machine uses an SSH key - /// for authentication. - /// - [JsonProperty(PropertyName = "properties.isAuthenticationWithSshKey")] - public bool? IsAuthenticationWithSshKey { get; set; } - - /// - /// Gets or sets the fully-qualified domain name of the virtual - /// machine. - /// - [JsonProperty(PropertyName = "properties.fqdn")] - public string Fqdn { get; set; } - - /// - /// Gets or sets the lab subnet name of the virtual machine. - /// - [JsonProperty(PropertyName = "properties.labSubnetName")] - public string LabSubnetName { get; set; } - - /// - /// Gets or sets the lab virtual network identifier of the virtual - /// machine. - /// - [JsonProperty(PropertyName = "properties.labVirtualNetworkId")] - public string LabVirtualNetworkId { get; set; } - - /// - /// Gets or sets indicates whether the virtual machine is to be created - /// without a public IP address. - /// - [JsonProperty(PropertyName = "properties.disallowPublicIpAddress")] - public bool? DisallowPublicIpAddress { get; set; } - - /// - /// Gets or sets the artifacts to be installed on the virtual machine. - /// - [JsonProperty(PropertyName = "properties.artifacts")] - public IList Artifacts { get; set; } - - /// - /// Gets or sets the artifact deployment status for the virtual - /// machine. - /// - [JsonProperty(PropertyName = "properties.artifactDeploymentStatus")] - public ArtifactDeploymentStatusPropertiesFragment ArtifactDeploymentStatus { get; set; } - - /// - /// Gets or sets the Microsoft Azure Marketplace image reference of the - /// virtual machine. - /// - [JsonProperty(PropertyName = "properties.galleryImageReference")] - public GalleryImageReferenceFragment GalleryImageReference { get; set; } - - /// - /// Gets or sets the id of the plan associated with the virtual machine - /// image - /// - [JsonProperty(PropertyName = "properties.planId")] - public string PlanId { get; set; } - - /// - /// Gets or sets the network interface properties. - /// - [JsonProperty(PropertyName = "properties.networkInterface")] - public NetworkInterfacePropertiesFragment NetworkInterface { get; set; } - - /// - /// Gets or sets the expiration date for VM. - /// - [JsonProperty(PropertyName = "properties.expirationDate")] - public System.DateTime? ExpirationDate { get; set; } - - /// - /// Gets or sets indicates whether another user can take ownership of - /// the virtual machine - /// - [JsonProperty(PropertyName = "properties.allowClaim")] - public bool? AllowClaim { get; set; } - - /// - /// Gets or sets storage type to use for virtual machine (i.e. - /// Standard, Premium). - /// - [JsonProperty(PropertyName = "properties.storageType")] - public string StorageType { get; set; } - - /// - /// Gets or sets tells source of creation of lab virtual machine. - /// Output property only. Possible values include: 'FromCustomImage', - /// 'FromGalleryImage' - /// - [JsonProperty(PropertyName = "properties.virtualMachineCreationSource")] - public string VirtualMachineCreationSource { get; set; } - - /// - /// Gets or sets the resource ID of the environment that contains this - /// virtual machine, if any. - /// - [JsonProperty(PropertyName = "properties.environmentId")] - public string EnvironmentId { get; set; } - - /// - /// Gets or sets new or existing data disks to attach to the virtual - /// machine after creation - /// - [JsonProperty(PropertyName = "properties.dataDiskParameters")] - public IList DataDiskParameters { get; set; } - - /// - /// Gets or sets virtual Machine schedules to be created - /// - [JsonProperty(PropertyName = "properties.scheduleParameters")] - public IList ScheduleParameters { get; set; } - - /// - /// Gets or sets last known compute power state captured in DTL - /// - [JsonProperty(PropertyName = "properties.lastKnownPowerState")] - public string LastKnownPowerState { get; set; } - } } diff --git a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/LinuxOsInfo.cs b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/LinuxOsInfo.cs deleted file mode 100644 index cdd1c1023010..000000000000 --- a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/LinuxOsInfo.cs +++ /dev/null @@ -1,56 +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.DevTestLabs.Models -{ - using Newtonsoft.Json; - using System.Linq; - - /// - /// Information about a Linux OS. - /// - public partial class LinuxOsInfo - { - /// - /// Initializes a new instance of the LinuxOsInfo class. - /// - public LinuxOsInfo() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the LinuxOsInfo class. - /// - /// The state of the Linux OS (i.e. - /// NonDeprovisioned, DeprovisionRequested, DeprovisionApplied). - /// Possible values include: 'NonDeprovisioned', - /// 'DeprovisionRequested', 'DeprovisionApplied' - public LinuxOsInfo(string linuxOsState = default(string)) - { - LinuxOsState = linuxOsState; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the state of the Linux OS (i.e. NonDeprovisioned, - /// DeprovisionRequested, DeprovisionApplied). Possible values include: - /// 'NonDeprovisioned', 'DeprovisionRequested', 'DeprovisionApplied' - /// - [JsonProperty(PropertyName = "linuxOsState")] - public string LinuxOsState { get; set; } - - } -} diff --git a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/LinuxOsInfoFragment.cs b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/LinuxOsInfoFragment.cs deleted file mode 100644 index fdd6ba5aba99..000000000000 --- a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/LinuxOsInfoFragment.cs +++ /dev/null @@ -1,56 +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.DevTestLabs.Models -{ - using Newtonsoft.Json; - using System.Linq; - - /// - /// Information about a Linux OS. - /// - public partial class LinuxOsInfoFragment - { - /// - /// Initializes a new instance of the LinuxOsInfoFragment class. - /// - public LinuxOsInfoFragment() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the LinuxOsInfoFragment class. - /// - /// The state of the Linux OS (i.e. - /// NonDeprovisioned, DeprovisionRequested, DeprovisionApplied). - /// Possible values include: 'NonDeprovisioned', - /// 'DeprovisionRequested', 'DeprovisionApplied' - public LinuxOsInfoFragment(string linuxOsState = default(string)) - { - LinuxOsState = linuxOsState; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the state of the Linux OS (i.e. NonDeprovisioned, - /// DeprovisionRequested, DeprovisionApplied). Possible values include: - /// 'NonDeprovisioned', 'DeprovisionRequested', 'DeprovisionApplied' - /// - [JsonProperty(PropertyName = "linuxOsState")] - public string LinuxOsState { get; set; } - - } -} diff --git a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/LocationData.cs b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/LocationData.cs new file mode 100644 index 000000000000..346b9e9074ad --- /dev/null +++ b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/LocationData.cs @@ -0,0 +1,102 @@ +// +// 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.DevTestLabs.Models +{ + using Microsoft.Rest; + using Newtonsoft.Json; + using System.Linq; + + /// + /// Metadata pertaining to the geographic location of the resource. + /// + public partial class LocationData + { + /// + /// Initializes a new instance of the LocationData class. + /// + public LocationData() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the LocationData class. + /// + /// A canonical name for the geographic or physical + /// location. + /// The city or locality where the resource is + /// located. + /// The district, state, or province where the + /// resource is located. + /// The country or region where the + /// resource is located + public LocationData(string name, string city = default(string), string district = default(string), string countryOrRegion = default(string)) + { + Name = name; + City = city; + District = district; + CountryOrRegion = countryOrRegion; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets a canonical name for the geographic or physical + /// location. + /// + [JsonProperty(PropertyName = "name")] + public string Name { get; set; } + + /// + /// Gets or sets the city or locality where the resource is located. + /// + [JsonProperty(PropertyName = "city")] + public string City { get; set; } + + /// + /// Gets or sets the district, state, or province where the resource is + /// located. + /// + [JsonProperty(PropertyName = "district")] + public string District { get; set; } + + /// + /// Gets or sets the country or region where the resource is located + /// + [JsonProperty(PropertyName = "countryOrRegion")] + public string CountryOrRegion { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (Name == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Name"); + } + if (Name != null) + { + if (Name.Length > 256) + { + throw new ValidationException(ValidationRules.MaxLength, "Name", 256); + } + } + } + } +} diff --git a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/ManagedIdentityType.cs b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/ManagedIdentityType.cs new file mode 100644 index 000000000000..1adae326dafe --- /dev/null +++ b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/ManagedIdentityType.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.DevTestLabs.Models +{ + + /// + /// Defines values for ManagedIdentityType. + /// + public static class ManagedIdentityType + { + public const string None = "None"; + public const string SystemAssigned = "SystemAssigned"; + public const string UserAssigned = "UserAssigned"; + public const string SystemAssignedUserAssigned = "SystemAssigned,UserAssigned"; + } +} diff --git a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/NetworkInterfaceProperties.cs b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/NetworkInterfaceProperties.cs deleted file mode 100644 index af26330b86bd..000000000000 --- a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/NetworkInterfaceProperties.cs +++ /dev/null @@ -1,127 +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.DevTestLabs.Models -{ - using Newtonsoft.Json; - using System.Linq; - - /// - /// Properties of a network interface. - /// - public partial class NetworkInterfaceProperties - { - /// - /// Initializes a new instance of the NetworkInterfaceProperties class. - /// - public NetworkInterfaceProperties() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the NetworkInterfaceProperties class. - /// - /// The resource ID of the virtual - /// network. - /// The resource ID of the sub net. - /// The resource ID of the public IP - /// address. - /// The public IP address. - /// The private IP address. - /// The DNS name. - /// The RdpAuthority property is a server - /// DNS host name or IP address followed by the service port number for - /// RDP (Remote Desktop Protocol). - /// The SshAuthority property is a server - /// DNS host name or IP address followed by the service port number for - /// SSH. - /// The configuration - /// for sharing a public IP address across multiple virtual - /// machines. - public NetworkInterfaceProperties(string virtualNetworkId = default(string), string subnetId = default(string), string publicIpAddressId = default(string), string publicIpAddress = default(string), string privateIpAddress = default(string), string dnsName = default(string), string rdpAuthority = default(string), string sshAuthority = default(string), SharedPublicIpAddressConfiguration sharedPublicIpAddressConfiguration = default(SharedPublicIpAddressConfiguration)) - { - VirtualNetworkId = virtualNetworkId; - SubnetId = subnetId; - PublicIpAddressId = publicIpAddressId; - PublicIpAddress = publicIpAddress; - PrivateIpAddress = privateIpAddress; - DnsName = dnsName; - RdpAuthority = rdpAuthority; - SshAuthority = sshAuthority; - SharedPublicIpAddressConfiguration = sharedPublicIpAddressConfiguration; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the resource ID of the virtual network. - /// - [JsonProperty(PropertyName = "virtualNetworkId")] - public string VirtualNetworkId { get; set; } - - /// - /// Gets or sets the resource ID of the sub net. - /// - [JsonProperty(PropertyName = "subnetId")] - public string SubnetId { get; set; } - - /// - /// Gets or sets the resource ID of the public IP address. - /// - [JsonProperty(PropertyName = "publicIpAddressId")] - public string PublicIpAddressId { get; set; } - - /// - /// Gets or sets the public IP address. - /// - [JsonProperty(PropertyName = "publicIpAddress")] - public string PublicIpAddress { get; set; } - - /// - /// Gets or sets the private IP address. - /// - [JsonProperty(PropertyName = "privateIpAddress")] - public string PrivateIpAddress { get; set; } - - /// - /// Gets or sets the DNS name. - /// - [JsonProperty(PropertyName = "dnsName")] - public string DnsName { get; set; } - - /// - /// Gets or sets the RdpAuthority property is a server DNS host name or - /// IP address followed by the service port number for RDP (Remote - /// Desktop Protocol). - /// - [JsonProperty(PropertyName = "rdpAuthority")] - public string RdpAuthority { get; set; } - - /// - /// Gets or sets the SshAuthority property is a server DNS host name or - /// IP address followed by the service port number for SSH. - /// - [JsonProperty(PropertyName = "sshAuthority")] - public string SshAuthority { get; set; } - - /// - /// Gets or sets the configuration for sharing a public IP address - /// across multiple virtual machines. - /// - [JsonProperty(PropertyName = "sharedPublicIpAddressConfiguration")] - public SharedPublicIpAddressConfiguration SharedPublicIpAddressConfiguration { get; set; } - - } -} diff --git a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/NetworkInterfacePropertiesFragment.cs b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/NetworkInterfacePropertiesFragment.cs deleted file mode 100644 index e790d77f8f65..000000000000 --- a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/NetworkInterfacePropertiesFragment.cs +++ /dev/null @@ -1,129 +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.DevTestLabs.Models -{ - using Newtonsoft.Json; - using System.Linq; - - /// - /// Properties of a network interface. - /// - public partial class NetworkInterfacePropertiesFragment - { - /// - /// Initializes a new instance of the - /// NetworkInterfacePropertiesFragment class. - /// - public NetworkInterfacePropertiesFragment() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the - /// NetworkInterfacePropertiesFragment class. - /// - /// The resource ID of the virtual - /// network. - /// The resource ID of the sub net. - /// The resource ID of the public IP - /// address. - /// The public IP address. - /// The private IP address. - /// The DNS name. - /// The RdpAuthority property is a server - /// DNS host name or IP address followed by the service port number for - /// RDP (Remote Desktop Protocol). - /// The SshAuthority property is a server - /// DNS host name or IP address followed by the service port number for - /// SSH. - /// The configuration - /// for sharing a public IP address across multiple virtual - /// machines. - public NetworkInterfacePropertiesFragment(string virtualNetworkId = default(string), string subnetId = default(string), string publicIpAddressId = default(string), string publicIpAddress = default(string), string privateIpAddress = default(string), string dnsName = default(string), string rdpAuthority = default(string), string sshAuthority = default(string), SharedPublicIpAddressConfigurationFragment sharedPublicIpAddressConfiguration = default(SharedPublicIpAddressConfigurationFragment)) - { - VirtualNetworkId = virtualNetworkId; - SubnetId = subnetId; - PublicIpAddressId = publicIpAddressId; - PublicIpAddress = publicIpAddress; - PrivateIpAddress = privateIpAddress; - DnsName = dnsName; - RdpAuthority = rdpAuthority; - SshAuthority = sshAuthority; - SharedPublicIpAddressConfiguration = sharedPublicIpAddressConfiguration; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the resource ID of the virtual network. - /// - [JsonProperty(PropertyName = "virtualNetworkId")] - public string VirtualNetworkId { get; set; } - - /// - /// Gets or sets the resource ID of the sub net. - /// - [JsonProperty(PropertyName = "subnetId")] - public string SubnetId { get; set; } - - /// - /// Gets or sets the resource ID of the public IP address. - /// - [JsonProperty(PropertyName = "publicIpAddressId")] - public string PublicIpAddressId { get; set; } - - /// - /// Gets or sets the public IP address. - /// - [JsonProperty(PropertyName = "publicIpAddress")] - public string PublicIpAddress { get; set; } - - /// - /// Gets or sets the private IP address. - /// - [JsonProperty(PropertyName = "privateIpAddress")] - public string PrivateIpAddress { get; set; } - - /// - /// Gets or sets the DNS name. - /// - [JsonProperty(PropertyName = "dnsName")] - public string DnsName { get; set; } - - /// - /// Gets or sets the RdpAuthority property is a server DNS host name or - /// IP address followed by the service port number for RDP (Remote - /// Desktop Protocol). - /// - [JsonProperty(PropertyName = "rdpAuthority")] - public string RdpAuthority { get; set; } - - /// - /// Gets or sets the SshAuthority property is a server DNS host name or - /// IP address followed by the service port number for SSH. - /// - [JsonProperty(PropertyName = "sshAuthority")] - public string SshAuthority { get; set; } - - /// - /// Gets or sets the configuration for sharing a public IP address - /// across multiple virtual machines. - /// - [JsonProperty(PropertyName = "sharedPublicIpAddressConfiguration")] - public SharedPublicIpAddressConfigurationFragment SharedPublicIpAddressConfiguration { get; set; } - - } -} diff --git a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/NotificationChannel.cs b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/NotificationChannel.cs index 99644eb038a2..a8dbe9dd1ff0 100644 --- a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/NotificationChannel.cs +++ b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/NotificationChannel.cs @@ -21,7 +21,7 @@ namespace Microsoft.Azure.Management.DevTestLabs.Models /// A notification. /// [Rest.Serialization.JsonTransformation] - public partial class NotificationChannel : Resource + public partial class NotificationChannel : TrackedResource { /// /// Initializes a new instance of the NotificationChannel class. @@ -34,15 +34,19 @@ public NotificationChannel() /// /// Initializes a new instance of the NotificationChannel class. /// - /// The identifier of the resource. - /// The name of the resource. - /// The type of the resource. - /// The location of the resource. - /// The tags of the resource. + /// The geo-location where the resource + /// lives + /// Fully qualified resource ID for the resource. Ex - + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + /// The name of the resource + /// The type of the resource. E.g. + /// "Microsoft.Compute/virtualMachines" or + /// "Microsoft.Storage/storageAccounts" + /// Resource tags. /// The webhook URL to send notifications /// to. /// The email recipient to send - /// notifications to (can be a list of semi-colon seperated email + /// notifications to (can be a list of semi-colon separated email /// addresses). /// The locale to use when sending a /// notification (fallback for unsupported languages is EN). @@ -55,8 +59,10 @@ public NotificationChannel() /// resource. /// The unique immutable identifier of a /// resource (Guid). - public NotificationChannel(string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), string webHookUrl = default(string), string emailRecipient = default(string), string notificationLocale = default(string), string description = default(string), IList events = default(IList), System.DateTime? createdDate = default(System.DateTime?), string provisioningState = default(string), string uniqueIdentifier = default(string)) - : base(id, name, type, location, tags) + /// The system metadata relating to this + /// resource + public NotificationChannel(string location, string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), string webHookUrl = default(string), string emailRecipient = default(string), string notificationLocale = default(string), string description = default(string), IList events = default(IList), System.DateTime? createdDate = default(System.DateTime?), string provisioningState = default(string), string uniqueIdentifier = default(string), SystemData systemData = default(SystemData)) + : base(location, id, name, type, tags) { WebHookUrl = webHookUrl; EmailRecipient = emailRecipient; @@ -66,6 +72,7 @@ public NotificationChannel() CreatedDate = createdDate; ProvisioningState = provisioningState; UniqueIdentifier = uniqueIdentifier; + SystemData = systemData; CustomInit(); } @@ -82,7 +89,7 @@ public NotificationChannel() /// /// Gets or sets the email recipient to send notifications to (can be a - /// list of semi-colon seperated email addresses). + /// list of semi-colon separated email addresses). /// [JsonProperty(PropertyName = "properties.emailRecipient")] public string EmailRecipient { get; set; } @@ -125,5 +132,21 @@ public NotificationChannel() [JsonProperty(PropertyName = "properties.uniqueIdentifier")] public string UniqueIdentifier { get; private set; } + /// + /// Gets the system metadata relating to this resource + /// + [JsonProperty(PropertyName = "systemData")] + public SystemData SystemData { get; private set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public override void Validate() + { + base.Validate(); + } } } diff --git a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/NotificationChannelFragment.cs b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/NotificationChannelFragment.cs index c5b9f4b87259..92f3d2e397c9 100644 --- a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/NotificationChannelFragment.cs +++ b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/NotificationChannelFragment.cs @@ -10,18 +10,14 @@ namespace Microsoft.Azure.Management.DevTestLabs.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; using System.Collections; using System.Collections.Generic; using System.Linq; /// - /// A notification. + /// Patch /// - [Rest.Serialization.JsonTransformation] - public partial class NotificationChannelFragment : UpdateResource + public partial class NotificationChannelFragment : Tags { /// /// Initializes a new instance of the NotificationChannelFragment @@ -36,25 +32,10 @@ public NotificationChannelFragment() /// Initializes a new instance of the NotificationChannelFragment /// class. /// - /// The tags of the resource. - /// The webhook URL to send notifications - /// to. - /// The email recipient to send - /// notifications to (can be a list of semi-colon seperated email - /// addresses). - /// The locale to use when sending a - /// notification (fallback for unsupported languages is EN). - /// Description of notification. - /// The list of event for which this notification - /// is enabled. - public NotificationChannelFragment(IDictionary tags = default(IDictionary), string webHookUrl = default(string), string emailRecipient = default(string), string notificationLocale = default(string), string description = default(string), IList events = default(IList)) - : base(tags) + /// Resource tags + public NotificationChannelFragment(IDictionary tagsProperty = default(IDictionary)) + : base(tagsProperty) { - WebHookUrl = webHookUrl; - EmailRecipient = emailRecipient; - NotificationLocale = notificationLocale; - Description = description; - Events = events; CustomInit(); } @@ -63,38 +44,5 @@ public NotificationChannelFragment() /// partial void CustomInit(); - /// - /// Gets or sets the webhook URL to send notifications to. - /// - [JsonProperty(PropertyName = "properties.webHookUrl")] - public string WebHookUrl { get; set; } - - /// - /// Gets or sets the email recipient to send notifications to (can be a - /// list of semi-colon seperated email addresses). - /// - [JsonProperty(PropertyName = "properties.emailRecipient")] - public string EmailRecipient { get; set; } - - /// - /// Gets or sets the locale to use when sending a notification - /// (fallback for unsupported languages is EN). - /// - [JsonProperty(PropertyName = "properties.notificationLocale")] - public string NotificationLocale { get; set; } - - /// - /// Gets or sets description of notification. - /// - [JsonProperty(PropertyName = "properties.description")] - public string Description { get; set; } - - /// - /// Gets or sets the list of event for which this notification is - /// enabled. - /// - [JsonProperty(PropertyName = "properties.events")] - public IList Events { get; set; } - } } diff --git a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/NotificationSettings.cs b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/NotificationSettings.cs deleted file mode 100644 index cdc145cc5a1b..000000000000 --- a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/NotificationSettings.cs +++ /dev/null @@ -1,95 +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.DevTestLabs.Models -{ - using Newtonsoft.Json; - using System.Linq; - - /// - /// Notification settings for a schedule. - /// - public partial class NotificationSettings - { - /// - /// Initializes a new instance of the NotificationSettings class. - /// - public NotificationSettings() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the NotificationSettings class. - /// - /// If notifications are enabled for this schedule - /// (i.e. Enabled, Disabled). Possible values include: 'Enabled', - /// 'Disabled' - /// Time in minutes before event at which - /// notification will be sent. - /// The webhook URL to which the notification - /// will be sent. - /// The email recipient to send - /// notifications to (can be a list of semi-colon seperated email - /// addresses). - /// The locale to use when sending a - /// notification (fallback for unsupported languages is EN). - public NotificationSettings(string status = default(string), int? timeInMinutes = default(int?), string webhookUrl = default(string), string emailRecipient = default(string), string notificationLocale = default(string)) - { - Status = status; - TimeInMinutes = timeInMinutes; - WebhookUrl = webhookUrl; - EmailRecipient = emailRecipient; - NotificationLocale = notificationLocale; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets if notifications are enabled for this schedule (i.e. - /// Enabled, Disabled). Possible values include: 'Enabled', 'Disabled' - /// - [JsonProperty(PropertyName = "status")] - public string Status { get; set; } - - /// - /// Gets or sets time in minutes before event at which notification - /// will be sent. - /// - [JsonProperty(PropertyName = "timeInMinutes")] - public int? TimeInMinutes { get; set; } - - /// - /// Gets or sets the webhook URL to which the notification will be - /// sent. - /// - [JsonProperty(PropertyName = "webhookUrl")] - public string WebhookUrl { get; set; } - - /// - /// Gets or sets the email recipient to send notifications to (can be a - /// list of semi-colon seperated email addresses). - /// - [JsonProperty(PropertyName = "emailRecipient")] - public string EmailRecipient { get; set; } - - /// - /// Gets or sets the locale to use when sending a notification - /// (fallback for unsupported languages is EN). - /// - [JsonProperty(PropertyName = "notificationLocale")] - public string NotificationLocale { get; set; } - - } -} diff --git a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/NotificationSettingsFragment.cs b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/NotificationSettingsFragment.cs deleted file mode 100644 index eaae0283bef2..000000000000 --- a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/NotificationSettingsFragment.cs +++ /dev/null @@ -1,97 +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.DevTestLabs.Models -{ - using Newtonsoft.Json; - using System.Linq; - - /// - /// Notification settings for a schedule. - /// - public partial class NotificationSettingsFragment - { - /// - /// Initializes a new instance of the NotificationSettingsFragment - /// class. - /// - public NotificationSettingsFragment() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the NotificationSettingsFragment - /// class. - /// - /// If notifications are enabled for this schedule - /// (i.e. Enabled, Disabled). Possible values include: 'Enabled', - /// 'Disabled' - /// Time in minutes before event at which - /// notification will be sent. - /// The webhook URL to which the notification - /// will be sent. - /// The email recipient to send - /// notifications to (can be a list of semi-colon seperated email - /// addresses). - /// The locale to use when sending a - /// notification (fallback for unsupported languages is EN). - public NotificationSettingsFragment(string status = default(string), int? timeInMinutes = default(int?), string webhookUrl = default(string), string emailRecipient = default(string), string notificationLocale = default(string)) - { - Status = status; - TimeInMinutes = timeInMinutes; - WebhookUrl = webhookUrl; - EmailRecipient = emailRecipient; - NotificationLocale = notificationLocale; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets if notifications are enabled for this schedule (i.e. - /// Enabled, Disabled). Possible values include: 'Enabled', 'Disabled' - /// - [JsonProperty(PropertyName = "status")] - public string Status { get; set; } - - /// - /// Gets or sets time in minutes before event at which notification - /// will be sent. - /// - [JsonProperty(PropertyName = "timeInMinutes")] - public int? TimeInMinutes { get; set; } - - /// - /// Gets or sets the webhook URL to which the notification will be - /// sent. - /// - [JsonProperty(PropertyName = "webhookUrl")] - public string WebhookUrl { get; set; } - - /// - /// Gets or sets the email recipient to send notifications to (can be a - /// list of semi-colon seperated email addresses). - /// - [JsonProperty(PropertyName = "emailRecipient")] - public string EmailRecipient { get; set; } - - /// - /// Gets or sets the locale to use when sending a notification - /// (fallback for unsupported languages is EN). - /// - [JsonProperty(PropertyName = "notificationLocale")] - public string NotificationLocale { get; set; } - - } -} diff --git a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/Operation.cs b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/Operation.cs new file mode 100644 index 000000000000..b02510413645 --- /dev/null +++ b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/Operation.cs @@ -0,0 +1,109 @@ +// +// 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.DevTestLabs.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// REST API Operation + /// + /// + /// Details of a REST API operation, returned from the Resource Provider + /// Operations API + /// + public partial class Operation + { + /// + /// Initializes a new instance of the Operation class. + /// + public Operation() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the Operation class. + /// + /// The name of the operation, as per Resource-Based + /// Access Control (RBAC). Examples: + /// "Microsoft.Compute/virtualMachines/write", + /// "Microsoft.Compute/virtualMachines/capture/action" + /// Whether the operation applies to + /// data-plane. This is "true" for data-plane operations and "false" + /// for ARM/control-plane operations. + /// Localized display information for this + /// particular operation. + /// The intended executor of the operation; as in + /// Resource Based Access Control (RBAC) and audit logs UX. Default + /// value is "user,system". Possible values include: 'user', 'system', + /// 'user,system' + /// Enum. Indicates the action type. + /// "Internal" refers to actions that are for internal only APIs. + /// Possible values include: 'Internal' + public Operation(string name = default(string), bool? isDataAction = default(bool?), OperationDisplay display = default(OperationDisplay), string origin = default(string), string actionType = default(string)) + { + Name = name; + IsDataAction = isDataAction; + Display = display; + Origin = origin; + ActionType = actionType; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets the name of the operation, as per Resource-Based Access + /// Control (RBAC). Examples: + /// "Microsoft.Compute/virtualMachines/write", + /// "Microsoft.Compute/virtualMachines/capture/action" + /// + [JsonProperty(PropertyName = "name")] + public string Name { get; private set; } + + /// + /// Gets whether the operation applies to data-plane. This is "true" + /// for data-plane operations and "false" for ARM/control-plane + /// operations. + /// + [JsonProperty(PropertyName = "isDataAction")] + public bool? IsDataAction { get; private set; } + + /// + /// Gets or sets localized display information for this particular + /// operation. + /// + [JsonProperty(PropertyName = "display")] + public OperationDisplay Display { get; set; } + + /// + /// Gets the intended executor of the operation; as in Resource Based + /// Access Control (RBAC) and audit logs UX. Default value is + /// "user,system". Possible values include: 'user', 'system', + /// 'user,system' + /// + [JsonProperty(PropertyName = "origin")] + public string Origin { get; private set; } + + /// + /// Gets enum. Indicates the action type. "Internal" refers to actions + /// that are for internal only APIs. Possible values include: + /// 'Internal' + /// + [JsonProperty(PropertyName = "actionType")] + public string ActionType { get; private set; } + + } +} diff --git a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/OperationDisplay.cs b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/OperationDisplay.cs new file mode 100644 index 000000000000..acb35cdbd0a0 --- /dev/null +++ b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/OperationDisplay.cs @@ -0,0 +1,89 @@ +// +// 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.DevTestLabs.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Localized display information for this particular operation. + /// + public partial class OperationDisplay + { + /// + /// Initializes a new instance of the OperationDisplay class. + /// + public OperationDisplay() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the OperationDisplay class. + /// + /// The localized friendly form of the resource + /// provider name, e.g. "Microsoft Monitoring Insights" or "Microsoft + /// Compute". + /// The localized friendly name of the resource + /// type related to this operation. E.g. "Virtual Machines" or "Job + /// Schedule Collections". + /// The concise, localized friendly name for + /// the operation; suitable for dropdowns. E.g. "Create or Update + /// Virtual Machine", "Restart Virtual Machine". + /// The short, localized friendly description + /// of the operation; suitable for tool tips and detailed + /// views. + public OperationDisplay(string provider = default(string), string resource = default(string), string operation = default(string), string description = default(string)) + { + Provider = provider; + Resource = resource; + Operation = operation; + Description = description; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets the localized friendly form of the resource provider name, + /// e.g. "Microsoft Monitoring Insights" or "Microsoft Compute". + /// + [JsonProperty(PropertyName = "provider")] + public string Provider { get; private set; } + + /// + /// Gets the localized friendly name of the resource type related to + /// this operation. E.g. "Virtual Machines" or "Job Schedule + /// Collections". + /// + [JsonProperty(PropertyName = "resource")] + public string Resource { get; private set; } + + /// + /// Gets the concise, localized friendly name for the operation; + /// suitable for dropdowns. E.g. "Create or Update Virtual Machine", + /// "Restart Virtual Machine". + /// + [JsonProperty(PropertyName = "operation")] + public string Operation { get; private set; } + + /// + /// Gets the short, localized friendly description of the operation; + /// suitable for tool tips and detailed views. + /// + [JsonProperty(PropertyName = "description")] + public string Description { get; private set; } + + } +} diff --git a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/OperationError.cs b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/OperationError.cs deleted file mode 100644 index 7fd87aa1d96c..000000000000 --- a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/OperationError.cs +++ /dev/null @@ -1,60 +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.DevTestLabs.Models -{ - using Newtonsoft.Json; - using System.Linq; - - /// - /// Error details for the operation in case of a failure. - /// - public partial class OperationError - { - /// - /// Initializes a new instance of the OperationError class. - /// - public OperationError() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the OperationError class. - /// - /// The error code of the operation error. - /// The error message of the operation - /// error. - public OperationError(string code = default(string), string message = default(string)) - { - Code = code; - Message = message; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the error code of the operation error. - /// - [JsonProperty(PropertyName = "code")] - public string Code { get; set; } - - /// - /// Gets or sets the error message of the operation error. - /// - [JsonProperty(PropertyName = "message")] - public string Message { get; set; } - - } -} diff --git a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/OperationListResult.cs b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/OperationListResult.cs new file mode 100644 index 000000000000..d43e0a014a16 --- /dev/null +++ b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/OperationListResult.cs @@ -0,0 +1,65 @@ +// +// 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.DevTestLabs.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// A list of REST API operations supported by an Azure Resource Provider. + /// It contains an URL link to get the next set of results. + /// + public partial class OperationListResult + { + /// + /// Initializes a new instance of the OperationListResult class. + /// + public OperationListResult() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the OperationListResult class. + /// + /// List of operations supported by the resource + /// provider + /// URL to get the next set of operation list + /// results (if there are any). + public OperationListResult(IList value = default(IList), string nextLink = default(string)) + { + Value = value; + NextLink = nextLink; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets list of operations supported by the resource provider + /// + [JsonProperty(PropertyName = "value")] + public IList Value { get; private set; } + + /// + /// Gets URL to get the next set of operation list results (if there + /// are any). + /// + [JsonProperty(PropertyName = "nextLink")] + public string NextLink { get; private set; } + + } +} diff --git a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/OperationResult.cs b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/OperationResult.cs index 7b0099cbe817..846eacc9668e 100644 --- a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/OperationResult.cs +++ b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/OperationResult.cs @@ -10,12 +10,15 @@ namespace Microsoft.Azure.Management.DevTestLabs.Models { + using Microsoft.Rest; + using Microsoft.Rest.Serialization; using Newtonsoft.Json; using System.Linq; /// /// An Operation Result /// + [Rest.Serialization.JsonTransformation] public partial class OperationResult { /// @@ -31,26 +34,36 @@ public OperationResult() /// /// The operation status. /// The status code for the operation. - /// Possible values include: 'Continue', 'SwitchingProtocols', 'OK', - /// 'Created', 'Accepted', 'NonAuthoritativeInformation', 'NoContent', - /// 'ResetContent', 'PartialContent', 'MultipleChoices', - /// 'MovedPermanently', 'Redirect', 'SeeOther', 'NotModified', - /// 'UseProxy', 'Unused', 'TemporaryRedirect', 'BadRequest', - /// 'Unauthorized', 'PaymentRequired', 'Forbidden', 'NotFound', - /// 'MethodNotAllowed', 'NotAcceptable', 'ProxyAuthenticationRequired', - /// 'RequestTimeout', 'Conflict', 'Gone', 'LengthRequired', - /// 'PreconditionFailed', 'RequestEntityTooLarge', 'RequestUriTooLong', + /// Possible values include: 'Continue', 'SwitchingProtocols', + /// 'Processing', 'EarlyHints', 'OK', 'Created', 'Accepted', + /// 'NonAuthoritativeInformation', 'NoContent', 'ResetContent', + /// 'PartialContent', 'MultiStatus', 'AlreadyReported', 'IMUsed', + /// 'MultipleChoices', 'Ambiguous', 'MovedPermanently', 'Moved', + /// 'Found', 'Redirect', 'SeeOther', 'RedirectMethod', 'NotModified', + /// 'UseProxy', 'Unused', 'TemporaryRedirect', 'RedirectKeepVerb', + /// 'PermanentRedirect', 'BadRequest', 'Unauthorized', + /// 'PaymentRequired', 'Forbidden', 'NotFound', 'MethodNotAllowed', + /// 'NotAcceptable', 'ProxyAuthenticationRequired', 'RequestTimeout', + /// 'Conflict', 'Gone', 'LengthRequired', 'PreconditionFailed', + /// 'RequestEntityTooLarge', 'RequestUriTooLong', /// 'UnsupportedMediaType', 'RequestedRangeNotSatisfiable', - /// 'ExpectationFailed', 'UpgradeRequired', 'InternalServerError', - /// 'NotImplemented', 'BadGateway', 'ServiceUnavailable', - /// 'GatewayTimeout', 'HttpVersionNotSupported' - /// Error details for the operation in case of a - /// failure. - public OperationResult(string status = default(string), string statusCode = default(string), OperationError error = default(OperationError)) + /// 'ExpectationFailed', 'MisdirectedRequest', 'UnprocessableEntity', + /// 'Locked', 'FailedDependency', 'UpgradeRequired', + /// 'PreconditionRequired', 'TooManyRequests', + /// 'RequestHeaderFieldsTooLarge', 'UnavailableForLegalReasons', + /// 'InternalServerError', 'NotImplemented', 'BadGateway', + /// 'ServiceUnavailable', 'GatewayTimeout', 'HttpVersionNotSupported', + /// 'VariantAlsoNegotiates', 'InsufficientStorage', 'LoopDetected', + /// 'NotExtended', 'NetworkAuthenticationRequired' + /// The error code of the operation error. + /// The error message of the operation + /// error. + public OperationResult(string status = default(string), string statusCode = default(string), string code = default(string), string message = default(string)) { Status = status; StatusCode = statusCode; - Error = error; + Code = code; + Message = message; CustomInit(); } @@ -67,28 +80,42 @@ public OperationResult() /// /// Gets or sets the status code for the operation. Possible values - /// include: 'Continue', 'SwitchingProtocols', 'OK', 'Created', - /// 'Accepted', 'NonAuthoritativeInformation', 'NoContent', - /// 'ResetContent', 'PartialContent', 'MultipleChoices', - /// 'MovedPermanently', 'Redirect', 'SeeOther', 'NotModified', - /// 'UseProxy', 'Unused', 'TemporaryRedirect', 'BadRequest', - /// 'Unauthorized', 'PaymentRequired', 'Forbidden', 'NotFound', - /// 'MethodNotAllowed', 'NotAcceptable', 'ProxyAuthenticationRequired', - /// 'RequestTimeout', 'Conflict', 'Gone', 'LengthRequired', - /// 'PreconditionFailed', 'RequestEntityTooLarge', 'RequestUriTooLong', + /// include: 'Continue', 'SwitchingProtocols', 'Processing', + /// 'EarlyHints', 'OK', 'Created', 'Accepted', + /// 'NonAuthoritativeInformation', 'NoContent', 'ResetContent', + /// 'PartialContent', 'MultiStatus', 'AlreadyReported', 'IMUsed', + /// 'MultipleChoices', 'Ambiguous', 'MovedPermanently', 'Moved', + /// 'Found', 'Redirect', 'SeeOther', 'RedirectMethod', 'NotModified', + /// 'UseProxy', 'Unused', 'TemporaryRedirect', 'RedirectKeepVerb', + /// 'PermanentRedirect', 'BadRequest', 'Unauthorized', + /// 'PaymentRequired', 'Forbidden', 'NotFound', 'MethodNotAllowed', + /// 'NotAcceptable', 'ProxyAuthenticationRequired', 'RequestTimeout', + /// 'Conflict', 'Gone', 'LengthRequired', 'PreconditionFailed', + /// 'RequestEntityTooLarge', 'RequestUriTooLong', /// 'UnsupportedMediaType', 'RequestedRangeNotSatisfiable', - /// 'ExpectationFailed', 'UpgradeRequired', 'InternalServerError', - /// 'NotImplemented', 'BadGateway', 'ServiceUnavailable', - /// 'GatewayTimeout', 'HttpVersionNotSupported' + /// 'ExpectationFailed', 'MisdirectedRequest', 'UnprocessableEntity', + /// 'Locked', 'FailedDependency', 'UpgradeRequired', + /// 'PreconditionRequired', 'TooManyRequests', + /// 'RequestHeaderFieldsTooLarge', 'UnavailableForLegalReasons', + /// 'InternalServerError', 'NotImplemented', 'BadGateway', + /// 'ServiceUnavailable', 'GatewayTimeout', 'HttpVersionNotSupported', + /// 'VariantAlsoNegotiates', 'InsufficientStorage', 'LoopDetected', + /// 'NotExtended', 'NetworkAuthenticationRequired' /// [JsonProperty(PropertyName = "statusCode")] public string StatusCode { get; set; } /// - /// Gets or sets error details for the operation in case of a failure. + /// Gets or sets the error code of the operation error. /// - [JsonProperty(PropertyName = "error")] - public OperationError Error { get; set; } + [JsonProperty(PropertyName = "error.code")] + public string Code { get; set; } + + /// + /// Gets or sets the error message of the operation error. + /// + [JsonProperty(PropertyName = "error.message")] + public string Message { get; set; } } } diff --git a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/OperationStatusResult.cs b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/OperationStatusResult.cs new file mode 100644 index 000000000000..02227de7df9f --- /dev/null +++ b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/OperationStatusResult.cs @@ -0,0 +1,144 @@ +// +// 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.DevTestLabs.Models +{ + using Microsoft.Rest; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// The current status of an async operation. + /// + public partial class OperationStatusResult + { + /// + /// Initializes a new instance of the OperationStatusResult class. + /// + public OperationStatusResult() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the OperationStatusResult class. + /// + /// Operation status. + /// Fully qualified ID for the async + /// operation. + /// Name of the async operation. + /// Percent of the operation that is + /// complete. + /// The start time of the operation. + /// The end time of the operation. + /// The operations list. + /// If present, details of the operation + /// error. + public OperationStatusResult(string status, string id = default(string), string name = default(string), double? percentComplete = default(double?), System.DateTime? startTime = default(System.DateTime?), System.DateTime? endTime = default(System.DateTime?), IList operations = default(IList), ErrorDetail error = default(ErrorDetail)) + { + Id = id; + Name = name; + Status = status; + PercentComplete = percentComplete; + StartTime = startTime; + EndTime = endTime; + Operations = operations; + Error = error; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets fully qualified ID for the async operation. + /// + [JsonProperty(PropertyName = "id")] + public string Id { get; set; } + + /// + /// Gets or sets name of the async operation. + /// + [JsonProperty(PropertyName = "name")] + public string Name { get; set; } + + /// + /// Gets or sets operation status. + /// + [JsonProperty(PropertyName = "status")] + public string Status { get; set; } + + /// + /// Gets or sets percent of the operation that is complete. + /// + [JsonProperty(PropertyName = "percentComplete")] + public double? PercentComplete { get; set; } + + /// + /// Gets or sets the start time of the operation. + /// + [JsonProperty(PropertyName = "startTime")] + public System.DateTime? StartTime { get; set; } + + /// + /// Gets or sets the end time of the operation. + /// + [JsonProperty(PropertyName = "endTime")] + public System.DateTime? EndTime { get; set; } + + /// + /// Gets or sets the operations list. + /// + [JsonProperty(PropertyName = "operations")] + public IList Operations { get; set; } + + /// + /// Gets or sets if present, details of the operation error. + /// + [JsonProperty(PropertyName = "error")] + public ErrorDetail Error { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (Status == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Status"); + } + if (PercentComplete > 100) + { + throw new ValidationException(ValidationRules.InclusiveMaximum, "PercentComplete", 100); + } + if (PercentComplete < 0) + { + throw new ValidationException(ValidationRules.InclusiveMinimum, "PercentComplete", 0); + } + if (Operations != null) + { + foreach (var element in Operations) + { + if (element != null) + { + element.Validate(); + } + } + } + } + } +} diff --git a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/Origin.cs b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/Origin.cs new file mode 100644 index 000000000000..7f86f486d709 --- /dev/null +++ b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/Origin.cs @@ -0,0 +1,23 @@ +// +// 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.DevTestLabs.Models +{ + + /// + /// Defines values for Origin. + /// + public static class Origin + { + public const string User = "user"; + public const string System = "system"; + public const string Usersystem = "user,system"; + } +} diff --git a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/OsType.cs b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/OsType.cs new file mode 100644 index 000000000000..b73a04945b5a --- /dev/null +++ b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/OsType.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.DevTestLabs.Models +{ + + /// + /// Defines values for OsType. + /// + public static class OsType + { + public const string Windows = "Windows"; + public const string Linux = "Linux"; + } +} diff --git a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/PercentageCostThresholdProperties.cs b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/PercentageCostThresholdProperties.cs deleted file mode 100644 index 8e3bb0efb8c3..000000000000 --- a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/PercentageCostThresholdProperties.cs +++ /dev/null @@ -1,53 +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.DevTestLabs.Models -{ - using Newtonsoft.Json; - using System.Linq; - - /// - /// Properties of a percentage cost threshold. - /// - public partial class PercentageCostThresholdProperties - { - /// - /// Initializes a new instance of the PercentageCostThresholdProperties - /// class. - /// - public PercentageCostThresholdProperties() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the PercentageCostThresholdProperties - /// class. - /// - /// The cost threshold value. - public PercentageCostThresholdProperties(double? thresholdValue = default(double?)) - { - ThresholdValue = thresholdValue; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the cost threshold value. - /// - [JsonProperty(PropertyName = "thresholdValue")] - public double? ThresholdValue { get; set; } - - } -} diff --git a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/Plan.cs b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/Plan.cs new file mode 100644 index 000000000000..670c212d50b7 --- /dev/null +++ b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/Plan.cs @@ -0,0 +1,116 @@ +// +// 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.DevTestLabs.Models +{ + using Microsoft.Rest; + using Newtonsoft.Json; + using System.Linq; + + /// + /// Plan for the resource. + /// + public partial class Plan + { + /// + /// Initializes a new instance of the Plan class. + /// + public Plan() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the Plan class. + /// + /// A user defined name of the 3rd Party Artifact + /// that is being procured. + /// The publisher of the 3rd Party Artifact + /// that is being bought. E.g. NewRelic + /// The 3rd Party artifact that is being + /// procured. E.g. NewRelic. Product maps to the OfferID specified for + /// the artifact at the time of Data Market onboarding. + /// A publisher provided promotion code as + /// provisioned in Data Market for the said product/artifact. + /// The version of the desired + /// product/artifact. + public Plan(string name, string publisher, string product, string promotionCode = default(string), string version = default(string)) + { + Name = name; + Publisher = publisher; + Product = product; + PromotionCode = promotionCode; + Version = version; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets a user defined name of the 3rd Party Artifact that is + /// being procured. + /// + [JsonProperty(PropertyName = "name")] + public string Name { get; set; } + + /// + /// Gets or sets the publisher of the 3rd Party Artifact that is being + /// bought. E.g. NewRelic + /// + [JsonProperty(PropertyName = "publisher")] + public string Publisher { get; set; } + + /// + /// Gets or sets the 3rd Party artifact that is being procured. E.g. + /// NewRelic. Product maps to the OfferID specified for the artifact at + /// the time of Data Market onboarding. + /// + [JsonProperty(PropertyName = "product")] + public string Product { get; set; } + + /// + /// Gets or sets a publisher provided promotion code as provisioned in + /// Data Market for the said product/artifact. + /// + [JsonProperty(PropertyName = "promotionCode")] + public string PromotionCode { get; set; } + + /// + /// Gets or sets the version of the desired product/artifact. + /// + [JsonProperty(PropertyName = "version")] + public string Version { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (Name == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Name"); + } + if (Publisher == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Publisher"); + } + if (Product == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Product"); + } + } + } +} diff --git a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/Policy.cs b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/Policy.cs index bb50ec14a072..5c3286b7d450 100644 --- a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/Policy.cs +++ b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/Policy.cs @@ -21,7 +21,7 @@ namespace Microsoft.Azure.Management.DevTestLabs.Models /// A Policy. /// [Rest.Serialization.JsonTransformation] - public partial class Policy : Resource + public partial class Policy : TrackedResource { /// /// Initializes a new instance of the Policy class. @@ -34,11 +34,15 @@ public Policy() /// /// Initializes a new instance of the Policy class. /// - /// The identifier of the resource. - /// The name of the resource. - /// The type of the resource. - /// The location of the resource. - /// The tags of the resource. + /// The geo-location where the resource + /// lives + /// Fully qualified resource ID for the resource. Ex - + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + /// The name of the resource + /// The type of the resource. E.g. + /// "Microsoft.Compute/virtualMachines" or + /// "Microsoft.Storage/storageAccounts" + /// Resource tags. /// The description of the policy. /// The status of the policy. Possible values /// include: 'Enabled', 'Disabled' @@ -60,8 +64,10 @@ public Policy() /// resource. /// The unique immutable identifier of a /// resource (Guid). - public Policy(string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), string description = default(string), string status = default(string), string factName = default(string), string factData = default(string), string threshold = default(string), string evaluatorType = default(string), System.DateTime? createdDate = default(System.DateTime?), string provisioningState = default(string), string uniqueIdentifier = default(string)) - : base(id, name, type, location, tags) + /// The system metadata relating to this + /// resource + public Policy(string location, string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), string description = default(string), string status = default(string), string factName = default(string), string factData = default(string), string threshold = default(string), string evaluatorType = default(string), System.DateTime? createdDate = default(System.DateTime?), string provisioningState = default(string), string uniqueIdentifier = default(string), SystemData systemData = default(SystemData)) + : base(location, id, name, type, tags) { Description = description; Status = status; @@ -72,6 +78,7 @@ public Policy() CreatedDate = createdDate; ProvisioningState = provisioningState; UniqueIdentifier = uniqueIdentifier; + SystemData = systemData; CustomInit(); } @@ -144,5 +151,21 @@ public Policy() [JsonProperty(PropertyName = "properties.uniqueIdentifier")] public string UniqueIdentifier { get; private set; } + /// + /// Gets the system metadata relating to this resource + /// + [JsonProperty(PropertyName = "systemData")] + public SystemData SystemData { get; private set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public override void Validate() + { + base.Validate(); + } } } diff --git a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/PolicyFragment.cs b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/PolicyFragment.cs index 020c1526165d..bf66af4cb79f 100644 --- a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/PolicyFragment.cs +++ b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/PolicyFragment.cs @@ -10,18 +10,14 @@ namespace Microsoft.Azure.Management.DevTestLabs.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; using System.Collections; using System.Collections.Generic; using System.Linq; /// - /// A Policy. + /// Patch /// - [Rest.Serialization.JsonTransformation] - public partial class PolicyFragment : UpdateResource + public partial class PolicyFragment : Tags { /// /// Initializes a new instance of the PolicyFragment class. @@ -34,32 +30,10 @@ public PolicyFragment() /// /// Initializes a new instance of the PolicyFragment class. /// - /// The tags of the resource. - /// The description of the policy. - /// The status of the policy. Possible values - /// include: 'Enabled', 'Disabled' - /// The fact name of the policy (e.g. - /// LabVmCount, LabVmSize, MaxVmsAllowedPerLab, etc. Possible values - /// include: 'UserOwnedLabVmCount', 'UserOwnedLabPremiumVmCount', - /// 'LabVmCount', 'LabPremiumVmCount', 'LabVmSize', 'GalleryImage', - /// 'UserOwnedLabVmCountInSubnet', 'LabTargetCost', - /// 'EnvironmentTemplate', 'ScheduleEditPermission' - /// The fact data of the policy. - /// The threshold of the policy (i.e. a number - /// for MaxValuePolicy, and a JSON array of values for - /// AllowedValuesPolicy). - /// The evaluator type of the policy (i.e. - /// AllowedValuesPolicy, MaxValuePolicy). Possible values include: - /// 'AllowedValuesPolicy', 'MaxValuePolicy' - public PolicyFragment(IDictionary tags = default(IDictionary), string description = default(string), string status = default(string), string factName = default(string), string factData = default(string), string threshold = default(string), string evaluatorType = default(string)) - : base(tags) + /// Resource tags + public PolicyFragment(IDictionary tagsProperty = default(IDictionary)) + : base(tagsProperty) { - Description = description; - Status = status; - FactName = factName; - FactData = factData; - Threshold = threshold; - EvaluatorType = evaluatorType; CustomInit(); } @@ -68,51 +42,5 @@ public PolicyFragment() /// partial void CustomInit(); - /// - /// Gets or sets the description of the policy. - /// - [JsonProperty(PropertyName = "properties.description")] - public string Description { get; set; } - - /// - /// Gets or sets the status of the policy. Possible values include: - /// 'Enabled', 'Disabled' - /// - [JsonProperty(PropertyName = "properties.status")] - public string Status { get; set; } - - /// - /// Gets or sets the fact name of the policy (e.g. LabVmCount, - /// LabVmSize, MaxVmsAllowedPerLab, etc. Possible values include: - /// 'UserOwnedLabVmCount', 'UserOwnedLabPremiumVmCount', 'LabVmCount', - /// 'LabPremiumVmCount', 'LabVmSize', 'GalleryImage', - /// 'UserOwnedLabVmCountInSubnet', 'LabTargetCost', - /// 'EnvironmentTemplate', 'ScheduleEditPermission' - /// - [JsonProperty(PropertyName = "properties.factName")] - public string FactName { get; set; } - - /// - /// Gets or sets the fact data of the policy. - /// - [JsonProperty(PropertyName = "properties.factData")] - public string FactData { get; set; } - - /// - /// Gets or sets the threshold of the policy (i.e. a number for - /// MaxValuePolicy, and a JSON array of values for - /// AllowedValuesPolicy). - /// - [JsonProperty(PropertyName = "properties.threshold")] - public string Threshold { get; set; } - - /// - /// Gets or sets the evaluator type of the policy (i.e. - /// AllowedValuesPolicy, MaxValuePolicy). Possible values include: - /// 'AllowedValuesPolicy', 'MaxValuePolicy' - /// - [JsonProperty(PropertyName = "properties.evaluatorType")] - public string EvaluatorType { get; set; } - } } diff --git a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/PolicySet.cs b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/PolicySet.cs new file mode 100644 index 000000000000..52dd4d430708 --- /dev/null +++ b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/PolicySet.cs @@ -0,0 +1,80 @@ +// +// 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.DevTestLabs.Models +{ + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Linq; + + /// + /// A PolicySet. + /// + [Rest.Serialization.JsonTransformation] + public partial class PolicySet : Resource + { + /// + /// Initializes a new instance of the PolicySet class. + /// + public PolicySet() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the PolicySet class. + /// + /// Fully qualified resource ID for the resource. Ex - + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + /// The name of the resource + /// The type of the resource. E.g. + /// "Microsoft.Compute/virtualMachines" or + /// "Microsoft.Storage/storageAccounts" + /// The provisioning status of the + /// resource. + /// The unique immutable identifier of a + /// resource (Guid). + /// The system metadata relating to this + /// resource + public PolicySet(string id = default(string), string name = default(string), string type = default(string), string provisioningState = default(string), string uniqueIdentifier = default(string), SystemData systemData = default(SystemData)) + : base(id, name, type) + { + ProvisioningState = provisioningState; + UniqueIdentifier = uniqueIdentifier; + SystemData = systemData; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets the provisioning status of the resource. + /// + [JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState { get; private set; } + + /// + /// Gets the unique immutable identifier of a resource (Guid). + /// + [JsonProperty(PropertyName = "properties.uniqueIdentifier")] + public string UniqueIdentifier { get; private set; } + + /// + /// Gets the system metadata relating to this resource + /// + [JsonProperty(PropertyName = "systemData")] + public SystemData SystemData { get; private set; } + + } +} diff --git a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/PortFragment.cs b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/PortFragment.cs deleted file mode 100644 index ccf98f72fa22..000000000000 --- a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/PortFragment.cs +++ /dev/null @@ -1,62 +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.DevTestLabs.Models -{ - using Newtonsoft.Json; - using System.Linq; - - /// - /// Properties of a network port. - /// - public partial class PortFragment - { - /// - /// Initializes a new instance of the PortFragment class. - /// - public PortFragment() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the PortFragment class. - /// - /// Protocol type of the port. Possible - /// values include: 'Tcp', 'Udp' - /// Backend port of the target virtual - /// machine. - public PortFragment(string transportProtocol = default(string), int? backendPort = default(int?)) - { - TransportProtocol = transportProtocol; - BackendPort = backendPort; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets protocol type of the port. Possible values include: - /// 'Tcp', 'Udp' - /// - [JsonProperty(PropertyName = "transportProtocol")] - public string TransportProtocol { get; set; } - - /// - /// Gets or sets backend port of the target virtual machine. - /// - [JsonProperty(PropertyName = "backendPort")] - public int? BackendPort { get; set; } - - } -} diff --git a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/ProxyResource.cs b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/ProxyResource.cs new file mode 100644 index 000000000000..001153128254 --- /dev/null +++ b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/ProxyResource.cs @@ -0,0 +1,53 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.DevTestLabs.Models +{ + using System.Linq; + + /// + /// Proxy Resource + /// + /// + /// The resource model definition for a Azure Resource Manager proxy + /// resource. It will not have tags and a location + /// + public partial class ProxyResource : Resource + { + /// + /// Initializes a new instance of the ProxyResource class. + /// + public ProxyResource() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ProxyResource class. + /// + /// Fully qualified resource ID for the resource. Ex - + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + /// The name of the resource + /// The type of the resource. E.g. + /// "Microsoft.Compute/virtualMachines" or + /// "Microsoft.Storage/storageAccounts" + public ProxyResource(string id = default(string), string name = default(string), string type = default(string)) + : base(id, name, type) + { + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + } +} diff --git a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/Resource.cs b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/Resource.cs index 065a5d37a329..77cc7c81bb79 100644 --- a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/Resource.cs +++ b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/Resource.cs @@ -13,13 +13,15 @@ namespace Microsoft.Azure.Management.DevTestLabs.Models using Microsoft.Rest; using Microsoft.Rest.Azure; using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// - /// An Azure resource. + /// Resource /// + /// + /// Common fields that are returned in the response for all Azure Resource + /// Manager resources + /// public partial class Resource : IResource { /// @@ -33,18 +35,17 @@ public Resource() /// /// Initializes a new instance of the Resource class. /// - /// The identifier of the resource. - /// The name of the resource. - /// The type of the resource. - /// The location of the resource. - /// The tags of the resource. - public Resource(string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary)) + /// Fully qualified resource ID for the resource. Ex - + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + /// The name of the resource + /// The type of the resource. E.g. + /// "Microsoft.Compute/virtualMachines" or + /// "Microsoft.Storage/storageAccounts" + public Resource(string id = default(string), string name = default(string), string type = default(string)) { Id = id; Name = name; Type = type; - Location = location; - Tags = tags; CustomInit(); } @@ -54,34 +55,25 @@ public Resource() partial void CustomInit(); /// - /// Gets the identifier of the resource. + /// Gets fully qualified resource ID for the resource. Ex - + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} /// [JsonProperty(PropertyName = "id")] public string Id { get; private set; } /// - /// Gets the name of the resource. + /// Gets the name of the resource /// [JsonProperty(PropertyName = "name")] public string Name { get; private set; } /// - /// Gets the type of the resource. + /// Gets the type of the resource. E.g. + /// "Microsoft.Compute/virtualMachines" or + /// "Microsoft.Storage/storageAccounts" /// [JsonProperty(PropertyName = "type")] public string Type { get; private set; } - /// - /// Gets or sets the location of the resource. - /// - [JsonProperty(PropertyName = "location")] - public string Location { get; set; } - - /// - /// Gets or sets the tags of the resource. - /// - [JsonProperty(PropertyName = "tags")] - public IDictionary Tags { get; set; } - } } diff --git a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/ResourceIdentityType.cs b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/ResourceIdentityType.cs new file mode 100644 index 000000000000..48bb1d26d580 --- /dev/null +++ b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/ResourceIdentityType.cs @@ -0,0 +1,54 @@ +// +// 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.DevTestLabs.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 + } + 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"; + } + return null; + } + + internal static ResourceIdentityType? ParseResourceIdentityType(this string value) + { + switch( value ) + { + case "SystemAssigned": + return ResourceIdentityType.SystemAssigned; + } + return null; + } + } +} diff --git a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/ResourceModelWithAllowedPropertySet.cs b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/ResourceModelWithAllowedPropertySet.cs new file mode 100644 index 000000000000..5866f33e1b99 --- /dev/null +++ b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/ResourceModelWithAllowedPropertySet.cs @@ -0,0 +1,190 @@ +// +// 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.DevTestLabs.Models +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// The resource model definition containing the full set of allowed + /// properties for a resource. Except properties bag, there cannot be a top + /// level property outside of this set. + /// + public partial class ResourceModelWithAllowedPropertySet : IResource + { + /// + /// Initializes a new instance of the + /// ResourceModelWithAllowedPropertySet class. + /// + public ResourceModelWithAllowedPropertySet() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// ResourceModelWithAllowedPropertySet class. + /// + /// Fully qualified resource ID for the resource. Ex - + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + /// The name of the resource + /// The type of the resource. E.g. + /// "Microsoft.Compute/virtualMachines" or + /// "Microsoft.Storage/storageAccounts" + /// The geo-location where the resource + /// lives + /// The fully qualified resource ID of the + /// resource that manages this resource. Indicates if this resource is + /// managed by another Azure resource. If this is present, complete + /// mode deployment will not delete the resource if it is removed from + /// the template since it is managed by another resource. + /// Metadata used by portal/tooling/etc to render + /// different UX experiences for resources of the same type; e.g. + /// ApiApps are a kind of Microsoft.Web/sites type. If supported, the + /// resource provider must validate and persist this value. + /// The etag field is *not* required. If it is + /// provided in the response body, it must also be provided as a header + /// per the normal etag convention. Entity tags are used for comparing + /// two or more entities from the same requested resource. HTTP/1.1 + /// uses entity tags in the etag (section 14.19), If-Match (section + /// 14.24), If-None-Match (section 14.26), and If-Range (section 14.27) + /// header fields. + /// Resource tags. + public ResourceModelWithAllowedPropertySet(string id = default(string), string name = default(string), string type = default(string), string location = default(string), string managedBy = default(string), string kind = default(string), string etag = default(string), IDictionary tags = default(IDictionary), ResourceModelWithAllowedPropertySetIdentity identity = default(ResourceModelWithAllowedPropertySetIdentity), ResourceModelWithAllowedPropertySetSku sku = default(ResourceModelWithAllowedPropertySetSku), ResourceModelWithAllowedPropertySetPlan plan = default(ResourceModelWithAllowedPropertySetPlan)) + { + Id = id; + Name = name; + Type = type; + Location = location; + ManagedBy = managedBy; + Kind = kind; + Etag = etag; + Tags = tags; + Identity = identity; + Sku = sku; + Plan = plan; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets fully qualified resource ID for the resource. Ex - + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + /// + [JsonProperty(PropertyName = "id")] + public string Id { get; private set; } + + /// + /// Gets the name of the resource + /// + [JsonProperty(PropertyName = "name")] + public string Name { get; private set; } + + /// + /// Gets the type of the resource. E.g. + /// "Microsoft.Compute/virtualMachines" or + /// "Microsoft.Storage/storageAccounts" + /// + [JsonProperty(PropertyName = "type")] + public string Type { get; private set; } + + /// + /// Gets or sets the geo-location where the resource lives + /// + [JsonProperty(PropertyName = "location")] + public string Location { get; set; } + + /// + /// Gets or sets the fully qualified resource ID of the resource that + /// manages this resource. Indicates if this resource is managed by + /// another Azure resource. If this is present, complete mode + /// deployment will not delete the resource if it is removed from the + /// template since it is managed by another resource. + /// + [JsonProperty(PropertyName = "managedBy")] + public string ManagedBy { get; set; } + + /// + /// Gets or sets metadata used by portal/tooling/etc to render + /// different UX experiences for resources of the same type; e.g. + /// ApiApps are a kind of Microsoft.Web/sites type. If supported, the + /// resource provider must validate and persist this value. + /// + [JsonProperty(PropertyName = "kind")] + public string Kind { get; set; } + + /// + /// Gets the etag field is *not* required. If it is provided in the + /// response body, it must also be provided as a header per the normal + /// etag convention. Entity tags are used for comparing two or more + /// entities from the same requested resource. HTTP/1.1 uses entity + /// tags in the etag (section 14.19), If-Match (section 14.24), + /// If-None-Match (section 14.26), and If-Range (section 14.27) header + /// fields. + /// + [JsonProperty(PropertyName = "etag")] + public string Etag { get; private set; } + + /// + /// Gets or sets resource tags. + /// + [JsonProperty(PropertyName = "tags")] + public IDictionary Tags { get; set; } + + /// + /// + [JsonProperty(PropertyName = "identity")] + public ResourceModelWithAllowedPropertySetIdentity Identity { get; set; } + + /// + /// + [JsonProperty(PropertyName = "sku")] + public ResourceModelWithAllowedPropertySetSku Sku { get; set; } + + /// + /// + [JsonProperty(PropertyName = "plan")] + public ResourceModelWithAllowedPropertySetPlan Plan { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (Kind != null) + { + if (!System.Text.RegularExpressions.Regex.IsMatch(Kind, "^[-\\w\\._,\\(\\)]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "Kind", "^[-\\w\\._,\\(\\)]+$"); + } + } + if (Sku != null) + { + Sku.Validate(); + } + if (Plan != null) + { + Plan.Validate(); + } + } + } +} diff --git a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/ResourceModelWithAllowedPropertySetIdentity.cs b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/ResourceModelWithAllowedPropertySetIdentity.cs new file mode 100644 index 000000000000..064be12acda0 --- /dev/null +++ b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/ResourceModelWithAllowedPropertySetIdentity.cs @@ -0,0 +1,47 @@ +// +// 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.DevTestLabs.Models +{ + using System.Linq; + + public partial class ResourceModelWithAllowedPropertySetIdentity : Identity + { + /// + /// Initializes a new instance of the + /// ResourceModelWithAllowedPropertySetIdentity class. + /// + public ResourceModelWithAllowedPropertySetIdentity() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// ResourceModelWithAllowedPropertySetIdentity class. + /// + /// The principal ID of resource + /// identity. + /// The tenant ID of resource. + /// The identity type. Possible values include: + /// 'SystemAssigned' + public ResourceModelWithAllowedPropertySetIdentity(string principalId = default(string), string tenantId = default(string), ResourceIdentityType? type = default(ResourceIdentityType?)) + : base(principalId, tenantId, type) + { + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + } +} diff --git a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/ResourceModelWithAllowedPropertySetPlan.cs b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/ResourceModelWithAllowedPropertySetPlan.cs new file mode 100644 index 000000000000..b966f69b29f5 --- /dev/null +++ b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/ResourceModelWithAllowedPropertySetPlan.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.DevTestLabs.Models +{ + using System.Linq; + + public partial class ResourceModelWithAllowedPropertySetPlan : Plan + { + /// + /// Initializes a new instance of the + /// ResourceModelWithAllowedPropertySetPlan class. + /// + public ResourceModelWithAllowedPropertySetPlan() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// ResourceModelWithAllowedPropertySetPlan class. + /// + /// A user defined name of the 3rd Party Artifact + /// that is being procured. + /// The publisher of the 3rd Party Artifact + /// that is being bought. E.g. NewRelic + /// The 3rd Party artifact that is being + /// procured. E.g. NewRelic. Product maps to the OfferID specified for + /// the artifact at the time of Data Market onboarding. + /// A publisher provided promotion code as + /// provisioned in Data Market for the said product/artifact. + /// The version of the desired + /// product/artifact. + public ResourceModelWithAllowedPropertySetPlan(string name, string publisher, string product, string promotionCode = default(string), string version = default(string)) + : base(name, publisher, product, promotionCode, version) + { + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public override void Validate() + { + base.Validate(); + } + } +} diff --git a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/ResourceModelWithAllowedPropertySetSku.cs b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/ResourceModelWithAllowedPropertySetSku.cs new file mode 100644 index 000000000000..10f79d51830d --- /dev/null +++ b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/ResourceModelWithAllowedPropertySetSku.cs @@ -0,0 +1,66 @@ +// +// 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.DevTestLabs.Models +{ + using System.Linq; + + public partial class ResourceModelWithAllowedPropertySetSku : Sku + { + /// + /// Initializes a new instance of the + /// ResourceModelWithAllowedPropertySetSku class. + /// + public ResourceModelWithAllowedPropertySetSku() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// ResourceModelWithAllowedPropertySetSku class. + /// + /// The name of the SKU. Ex - P3. It is typically a + /// letter+number code + /// This field is required to be implemented by the + /// Resource Provider if the service has more than one tier, but is not + /// required on a PUT. Possible values include: 'Free', 'Basic', + /// 'Standard', 'Premium' + /// The SKU size. When the name field is the + /// combination of tier and some other value, this would be the + /// standalone code. + /// If the service has different generations of + /// hardware, for the same SKU, then that can be captured here. + /// If the SKU supports scale out/in then the + /// capacity integer should be included. If scale out/in is not + /// possible for the resource this may be omitted. + public ResourceModelWithAllowedPropertySetSku(string name, SkuTier? tier = default(SkuTier?), string size = default(string), string family = default(string), int? capacity = default(int?)) + : base(name, tier, size, family, capacity) + { + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public override void Validate() + { + base.Validate(); + } + } +} diff --git a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/Schedule.cs b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/Schedule.cs index 9fea2adcb9ac..e3ef3302c774 100644 --- a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/Schedule.cs +++ b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/Schedule.cs @@ -11,7 +11,6 @@ namespace Microsoft.Azure.Management.DevTestLabs.Models { using Microsoft.Rest; - using Microsoft.Rest.Serialization; using Newtonsoft.Json; using System.Collections; using System.Collections.Generic; @@ -20,8 +19,7 @@ namespace Microsoft.Azure.Management.DevTestLabs.Models /// /// A schedule. /// - [Rest.Serialization.JsonTransformation] - public partial class Schedule : Resource + public partial class Schedule : TrackedResource { /// /// Initializes a new instance of the Schedule class. @@ -34,46 +32,23 @@ public Schedule() /// /// Initializes a new instance of the Schedule class. /// - /// The identifier of the resource. - /// The name of the resource. - /// The type of the resource. - /// The location of the resource. - /// The tags of the resource. - /// The status of the schedule (i.e. Enabled, - /// Disabled). Possible values include: 'Enabled', 'Disabled' - /// The task type of the schedule (e.g. - /// LabVmsShutdownTask, LabVmAutoStart). - /// If the schedule will occur only some - /// days of the week, specify the weekly recurrence. - /// If the schedule will occur once each - /// day of the week, specify the daily recurrence. - /// If the schedule will occur multiple - /// times a day, specify the hourly recurrence. - /// The time zone ID (e.g. Pacific Standard - /// time). - /// Notification settings. - /// The creation date of the - /// schedule. - /// The resource ID to which the - /// schedule belongs - /// The provisioning status of the - /// resource. - /// The unique immutable identifier of a - /// resource (Guid). - public Schedule(string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), string status = default(string), string taskType = default(string), WeekDetails weeklyRecurrence = default(WeekDetails), DayDetails dailyRecurrence = default(DayDetails), HourDetails hourlyRecurrence = default(HourDetails), string timeZoneId = default(string), NotificationSettings notificationSettings = default(NotificationSettings), System.DateTime? createdDate = default(System.DateTime?), string targetResourceId = default(string), string provisioningState = default(string), string uniqueIdentifier = default(string)) - : base(id, name, type, location, tags) + /// The geo-location where the resource + /// lives + /// The properties of the resource. + /// Fully qualified resource ID for the resource. Ex - + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + /// The name of the resource + /// The type of the resource. E.g. + /// "Microsoft.Compute/virtualMachines" or + /// "Microsoft.Storage/storageAccounts" + /// Resource tags. + /// The system metadata relating to this + /// resource + public Schedule(string location, ScheduleProperties properties, string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), SystemData systemData = default(SystemData)) + : base(location, id, name, type, tags) { - Status = status; - TaskType = taskType; - WeeklyRecurrence = weeklyRecurrence; - DailyRecurrence = dailyRecurrence; - HourlyRecurrence = hourlyRecurrence; - TimeZoneId = timeZoneId; - NotificationSettings = notificationSettings; - CreatedDate = createdDate; - TargetResourceId = targetResourceId; - ProvisioningState = provisioningState; - UniqueIdentifier = uniqueIdentifier; + Properties = properties; + SystemData = systemData; CustomInit(); } @@ -83,75 +58,30 @@ public Schedule() partial void CustomInit(); /// - /// Gets or sets the status of the schedule (i.e. Enabled, Disabled). - /// Possible values include: 'Enabled', 'Disabled' + /// Gets or sets the properties of the resource. /// - [JsonProperty(PropertyName = "properties.status")] - public string Status { get; set; } + [JsonProperty(PropertyName = "properties")] + public ScheduleProperties Properties { get; set; } /// - /// Gets or sets the task type of the schedule (e.g. - /// LabVmsShutdownTask, LabVmAutoStart). + /// Gets the system metadata relating to this resource /// - [JsonProperty(PropertyName = "properties.taskType")] - public string TaskType { get; set; } + [JsonProperty(PropertyName = "systemData")] + public SystemData SystemData { get; private set; } /// - /// Gets or sets if the schedule will occur only some days of the week, - /// specify the weekly recurrence. + /// Validate the object. /// - [JsonProperty(PropertyName = "properties.weeklyRecurrence")] - public WeekDetails WeeklyRecurrence { get; set; } - - /// - /// Gets or sets if the schedule will occur once each day of the week, - /// specify the daily recurrence. - /// - [JsonProperty(PropertyName = "properties.dailyRecurrence")] - public DayDetails DailyRecurrence { get; set; } - - /// - /// Gets or sets if the schedule will occur multiple times a day, - /// specify the hourly recurrence. - /// - [JsonProperty(PropertyName = "properties.hourlyRecurrence")] - public HourDetails HourlyRecurrence { get; set; } - - /// - /// Gets or sets the time zone ID (e.g. Pacific Standard time). - /// - [JsonProperty(PropertyName = "properties.timeZoneId")] - public string TimeZoneId { get; set; } - - /// - /// Gets or sets notification settings. - /// - [JsonProperty(PropertyName = "properties.notificationSettings")] - public NotificationSettings NotificationSettings { get; set; } - - /// - /// Gets the creation date of the schedule. - /// - [JsonProperty(PropertyName = "properties.createdDate")] - public System.DateTime? CreatedDate { get; private set; } - - /// - /// Gets or sets the resource ID to which the schedule belongs - /// - [JsonProperty(PropertyName = "properties.targetResourceId")] - public string TargetResourceId { get; set; } - - /// - /// Gets the provisioning status of the resource. - /// - [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; private set; } - - /// - /// Gets the unique immutable identifier of a resource (Guid). - /// - [JsonProperty(PropertyName = "properties.uniqueIdentifier")] - public string UniqueIdentifier { get; private set; } - + /// + /// Thrown if validation fails + /// + public override void Validate() + { + base.Validate(); + if (Properties == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Properties"); + } + } } } diff --git a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/ScheduleCreationParameter.cs b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/ScheduleCreationParameter.cs index d73b511d7111..faaf5b4da57a 100644 --- a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/ScheduleCreationParameter.cs +++ b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/ScheduleCreationParameter.cs @@ -38,32 +38,59 @@ public ScheduleCreationParameter() /// Disabled). Possible values include: 'Enabled', 'Disabled' /// The task type of the schedule (e.g. /// LabVmsShutdownTask, LabVmAutoStart). - /// If the schedule will occur only some - /// days of the week, specify the weekly recurrence. - /// If the schedule will occur once each - /// day of the week, specify the daily recurrence. - /// If the schedule will occur multiple - /// times a day, specify the hourly recurrence. + /// The days of the week for which the schedule + /// is set (e.g. Sunday, Monday, Tuesday, etc.). + /// The time of the day the schedule will + /// occur. + /// The time of day the schedule will + /// occur. + /// Minutes of the hour the schedule will + /// run. /// The time zone ID (e.g. Pacific Standard /// time). - /// Notification settings. + /// If notifications are enabled for this + /// schedule (i.e. Enabled, Disabled). Possible values include: + /// 'Enabled', 'Disabled' + /// Time in minutes before event at which + /// notification will be sent. + /// The webhook URL to which the notification + /// will be sent. + /// The email recipient to send + /// notifications to (can be a list of semi-colon separated email + /// addresses). + /// The locale to use when sending a + /// notification (fallback for unsupported languages is EN). + /// The creation date of the + /// schedule. /// The resource ID to which the /// schedule belongs + /// The provisioning status of the + /// resource. + /// The unique immutable identifier of a + /// resource (Guid). /// The name of the virtual machine or /// environment /// The location of the new virtual machine or /// environment /// The tags of the resource. - public ScheduleCreationParameter(string status = default(string), string taskType = default(string), WeekDetails weeklyRecurrence = default(WeekDetails), DayDetails dailyRecurrence = default(DayDetails), HourDetails hourlyRecurrence = default(HourDetails), string timeZoneId = default(string), NotificationSettings notificationSettings = default(NotificationSettings), string targetResourceId = default(string), string name = default(string), string location = default(string), IDictionary tags = default(IDictionary)) + public ScheduleCreationParameter(string status = default(string), string taskType = default(string), IList weekdays = default(IList), string time = default(string), string time1 = default(string), int? minute = default(int?), string timeZoneId = default(string), string status1 = default(string), int? timeInMinutes = default(int?), string webhookUrl = default(string), string emailRecipient = default(string), string notificationLocale = default(string), System.DateTime? createdDate = default(System.DateTime?), string targetResourceId = default(string), string provisioningState = default(string), string uniqueIdentifier = default(string), string name = default(string), string location = default(string), IDictionary tags = default(IDictionary)) { Status = status; TaskType = taskType; - WeeklyRecurrence = weeklyRecurrence; - DailyRecurrence = dailyRecurrence; - HourlyRecurrence = hourlyRecurrence; + Weekdays = weekdays; + Time = time; + Time1 = time1; + Minute = minute; TimeZoneId = timeZoneId; - NotificationSettings = notificationSettings; + Status1 = status1; + TimeInMinutes = timeInMinutes; + WebhookUrl = webhookUrl; + EmailRecipient = emailRecipient; + NotificationLocale = notificationLocale; + CreatedDate = createdDate; TargetResourceId = targetResourceId; + ProvisioningState = provisioningState; + UniqueIdentifier = uniqueIdentifier; Name = name; Location = location; Tags = tags; @@ -90,25 +117,29 @@ public ScheduleCreationParameter() public string TaskType { get; set; } /// - /// Gets or sets if the schedule will occur only some days of the week, - /// specify the weekly recurrence. + /// Gets or sets the days of the week for which the schedule is set + /// (e.g. Sunday, Monday, Tuesday, etc.). /// - [JsonProperty(PropertyName = "properties.weeklyRecurrence")] - public WeekDetails WeeklyRecurrence { get; set; } + [JsonProperty(PropertyName = "properties.weeklyRecurrence.weekdays")] + public IList Weekdays { get; set; } /// - /// Gets or sets if the schedule will occur once each day of the week, - /// specify the daily recurrence. + /// Gets or sets the time of the day the schedule will occur. /// - [JsonProperty(PropertyName = "properties.dailyRecurrence")] - public DayDetails DailyRecurrence { get; set; } + [JsonProperty(PropertyName = "properties.weeklyRecurrence.time")] + public string Time { get; set; } /// - /// Gets or sets if the schedule will occur multiple times a day, - /// specify the hourly recurrence. + /// Gets or sets the time of day the schedule will occur. /// - [JsonProperty(PropertyName = "properties.hourlyRecurrence")] - public HourDetails HourlyRecurrence { get; set; } + [JsonProperty(PropertyName = "properties.dailyRecurrence.time")] + public string Time1 { get; set; } + + /// + /// Gets or sets minutes of the hour the schedule will run. + /// + [JsonProperty(PropertyName = "properties.hourlyRecurrence.minute")] + public int? Minute { get; set; } /// /// Gets or sets the time zone ID (e.g. Pacific Standard time). @@ -117,10 +148,45 @@ public ScheduleCreationParameter() public string TimeZoneId { get; set; } /// - /// Gets or sets notification settings. + /// Gets or sets if notifications are enabled for this schedule (i.e. + /// Enabled, Disabled). Possible values include: 'Enabled', 'Disabled' + /// + [JsonProperty(PropertyName = "properties.notificationSettings.status")] + public string Status1 { get; set; } + + /// + /// Gets or sets time in minutes before event at which notification + /// will be sent. + /// + [JsonProperty(PropertyName = "properties.notificationSettings.timeInMinutes")] + public int? TimeInMinutes { get; set; } + + /// + /// Gets or sets the webhook URL to which the notification will be + /// sent. + /// + [JsonProperty(PropertyName = "properties.notificationSettings.webhookUrl")] + public string WebhookUrl { get; set; } + + /// + /// Gets or sets the email recipient to send notifications to (can be a + /// list of semi-colon separated email addresses). /// - [JsonProperty(PropertyName = "properties.notificationSettings")] - public NotificationSettings NotificationSettings { get; set; } + [JsonProperty(PropertyName = "properties.notificationSettings.emailRecipient")] + public string EmailRecipient { get; set; } + + /// + /// Gets or sets the locale to use when sending a notification + /// (fallback for unsupported languages is EN). + /// + [JsonProperty(PropertyName = "properties.notificationSettings.notificationLocale")] + public string NotificationLocale { get; set; } + + /// + /// Gets the creation date of the schedule. + /// + [JsonProperty(PropertyName = "properties.createdDate")] + public System.DateTime? CreatedDate { get; private set; } /// /// Gets or sets the resource ID to which the schedule belongs @@ -128,6 +194,18 @@ public ScheduleCreationParameter() [JsonProperty(PropertyName = "properties.targetResourceId")] public string TargetResourceId { get; set; } + /// + /// Gets the provisioning status of the resource. + /// + [JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState { get; private set; } + + /// + /// Gets the unique immutable identifier of a resource (Guid). + /// + [JsonProperty(PropertyName = "properties.uniqueIdentifier")] + public string UniqueIdentifier { get; private set; } + /// /// Gets or sets the name of the virtual machine or environment /// diff --git a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/ScheduleCreationParameterFragment.cs b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/ScheduleCreationParameterFragment.cs deleted file mode 100644 index 1defb029e514..000000000000 --- a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/ScheduleCreationParameterFragment.cs +++ /dev/null @@ -1,152 +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.DevTestLabs.Models -{ - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - - /// - /// Properties for creating a schedule. - /// - [Rest.Serialization.JsonTransformation] - public partial class ScheduleCreationParameterFragment - { - /// - /// Initializes a new instance of the ScheduleCreationParameterFragment - /// class. - /// - public ScheduleCreationParameterFragment() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the ScheduleCreationParameterFragment - /// class. - /// - /// The status of the schedule (i.e. Enabled, - /// Disabled). Possible values include: 'Enabled', 'Disabled' - /// The task type of the schedule (e.g. - /// LabVmsShutdownTask, LabVmAutoStart). - /// If the schedule will occur only some - /// days of the week, specify the weekly recurrence. - /// If the schedule will occur once each - /// day of the week, specify the daily recurrence. - /// If the schedule will occur multiple - /// times a day, specify the hourly recurrence. - /// The time zone ID (e.g. Pacific Standard - /// time). - /// Notification settings. - /// The resource ID to which the - /// schedule belongs - /// The name of the virtual machine or - /// environment - /// The location of the new virtual machine or - /// environment - /// The tags of the resource. - public ScheduleCreationParameterFragment(string status = default(string), string taskType = default(string), WeekDetailsFragment weeklyRecurrence = default(WeekDetailsFragment), DayDetailsFragment dailyRecurrence = default(DayDetailsFragment), HourDetailsFragment hourlyRecurrence = default(HourDetailsFragment), string timeZoneId = default(string), NotificationSettingsFragment notificationSettings = default(NotificationSettingsFragment), string targetResourceId = default(string), string name = default(string), string location = default(string), IDictionary tags = default(IDictionary)) - { - Status = status; - TaskType = taskType; - WeeklyRecurrence = weeklyRecurrence; - DailyRecurrence = dailyRecurrence; - HourlyRecurrence = hourlyRecurrence; - TimeZoneId = timeZoneId; - NotificationSettings = notificationSettings; - TargetResourceId = targetResourceId; - Name = name; - Location = location; - Tags = tags; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the status of the schedule (i.e. Enabled, Disabled). - /// Possible values include: 'Enabled', 'Disabled' - /// - [JsonProperty(PropertyName = "properties.status")] - public string Status { get; set; } - - /// - /// Gets or sets the task type of the schedule (e.g. - /// LabVmsShutdownTask, LabVmAutoStart). - /// - [JsonProperty(PropertyName = "properties.taskType")] - public string TaskType { get; set; } - - /// - /// Gets or sets if the schedule will occur only some days of the week, - /// specify the weekly recurrence. - /// - [JsonProperty(PropertyName = "properties.weeklyRecurrence")] - public WeekDetailsFragment WeeklyRecurrence { get; set; } - - /// - /// Gets or sets if the schedule will occur once each day of the week, - /// specify the daily recurrence. - /// - [JsonProperty(PropertyName = "properties.dailyRecurrence")] - public DayDetailsFragment DailyRecurrence { get; set; } - - /// - /// Gets or sets if the schedule will occur multiple times a day, - /// specify the hourly recurrence. - /// - [JsonProperty(PropertyName = "properties.hourlyRecurrence")] - public HourDetailsFragment HourlyRecurrence { get; set; } - - /// - /// Gets or sets the time zone ID (e.g. Pacific Standard time). - /// - [JsonProperty(PropertyName = "properties.timeZoneId")] - public string TimeZoneId { get; set; } - - /// - /// Gets or sets notification settings. - /// - [JsonProperty(PropertyName = "properties.notificationSettings")] - public NotificationSettingsFragment NotificationSettings { get; set; } - - /// - /// Gets or sets the resource ID to which the schedule belongs - /// - [JsonProperty(PropertyName = "properties.targetResourceId")] - public string TargetResourceId { get; set; } - - /// - /// Gets or sets the name of the virtual machine or environment - /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } - - /// - /// Gets or sets the location of the new virtual machine or environment - /// - [JsonProperty(PropertyName = "location")] - public string Location { get; set; } - - /// - /// Gets or sets the tags of the resource. - /// - [JsonProperty(PropertyName = "tags")] - public IDictionary Tags { get; set; } - - } -} diff --git a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/ScheduleFragment.cs b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/ScheduleFragment.cs index 4828a9706c46..996b6623fc9b 100644 --- a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/ScheduleFragment.cs +++ b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/ScheduleFragment.cs @@ -10,18 +10,14 @@ namespace Microsoft.Azure.Management.DevTestLabs.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; using System.Collections; using System.Collections.Generic; using System.Linq; /// - /// A schedule. + /// Patch /// - [Rest.Serialization.JsonTransformation] - public partial class ScheduleFragment : UpdateResource + public partial class ScheduleFragment : Tags { /// /// Initializes a new instance of the ScheduleFragment class. @@ -34,33 +30,10 @@ public ScheduleFragment() /// /// Initializes a new instance of the ScheduleFragment class. /// - /// The tags of the resource. - /// The status of the schedule (i.e. Enabled, - /// Disabled). Possible values include: 'Enabled', 'Disabled' - /// The task type of the schedule (e.g. - /// LabVmsShutdownTask, LabVmAutoStart). - /// If the schedule will occur only some - /// days of the week, specify the weekly recurrence. - /// If the schedule will occur once each - /// day of the week, specify the daily recurrence. - /// If the schedule will occur multiple - /// times a day, specify the hourly recurrence. - /// The time zone ID (e.g. Pacific Standard - /// time). - /// Notification settings. - /// The resource ID to which the - /// schedule belongs - public ScheduleFragment(IDictionary tags = default(IDictionary), string status = default(string), string taskType = default(string), WeekDetailsFragment weeklyRecurrence = default(WeekDetailsFragment), DayDetailsFragment dailyRecurrence = default(DayDetailsFragment), HourDetailsFragment hourlyRecurrence = default(HourDetailsFragment), string timeZoneId = default(string), NotificationSettingsFragment notificationSettings = default(NotificationSettingsFragment), string targetResourceId = default(string)) - : base(tags) + /// Resource tags + public ScheduleFragment(IDictionary tagsProperty = default(IDictionary)) + : base(tagsProperty) { - Status = status; - TaskType = taskType; - WeeklyRecurrence = weeklyRecurrence; - DailyRecurrence = dailyRecurrence; - HourlyRecurrence = hourlyRecurrence; - TimeZoneId = timeZoneId; - NotificationSettings = notificationSettings; - TargetResourceId = targetResourceId; CustomInit(); } @@ -69,58 +42,5 @@ public ScheduleFragment() /// partial void CustomInit(); - /// - /// Gets or sets the status of the schedule (i.e. Enabled, Disabled). - /// Possible values include: 'Enabled', 'Disabled' - /// - [JsonProperty(PropertyName = "properties.status")] - public string Status { get; set; } - - /// - /// Gets or sets the task type of the schedule (e.g. - /// LabVmsShutdownTask, LabVmAutoStart). - /// - [JsonProperty(PropertyName = "properties.taskType")] - public string TaskType { get; set; } - - /// - /// Gets or sets if the schedule will occur only some days of the week, - /// specify the weekly recurrence. - /// - [JsonProperty(PropertyName = "properties.weeklyRecurrence")] - public WeekDetailsFragment WeeklyRecurrence { get; set; } - - /// - /// Gets or sets if the schedule will occur once each day of the week, - /// specify the daily recurrence. - /// - [JsonProperty(PropertyName = "properties.dailyRecurrence")] - public DayDetailsFragment DailyRecurrence { get; set; } - - /// - /// Gets or sets if the schedule will occur multiple times a day, - /// specify the hourly recurrence. - /// - [JsonProperty(PropertyName = "properties.hourlyRecurrence")] - public HourDetailsFragment HourlyRecurrence { get; set; } - - /// - /// Gets or sets the time zone ID (e.g. Pacific Standard time). - /// - [JsonProperty(PropertyName = "properties.timeZoneId")] - public string TimeZoneId { get; set; } - - /// - /// Gets or sets notification settings. - /// - [JsonProperty(PropertyName = "properties.notificationSettings")] - public NotificationSettingsFragment NotificationSettings { get; set; } - - /// - /// Gets or sets the resource ID to which the schedule belongs - /// - [JsonProperty(PropertyName = "properties.targetResourceId")] - public string TargetResourceId { get; set; } - } } diff --git a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/Secret.cs b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/Secret.cs index 8bd71cbbba36..ec2da5e36308 100644 --- a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/Secret.cs +++ b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/Secret.cs @@ -21,7 +21,7 @@ namespace Microsoft.Azure.Management.DevTestLabs.Models /// A secret. /// [Rest.Serialization.JsonTransformation] - public partial class Secret : Resource + public partial class Secret : TrackedResource { /// /// Initializes a new instance of the Secret class. @@ -34,23 +34,30 @@ public Secret() /// /// Initializes a new instance of the Secret class. /// - /// The identifier of the resource. - /// The name of the resource. - /// The type of the resource. - /// The location of the resource. - /// The tags of the resource. + /// The geo-location where the resource + /// lives + /// Fully qualified resource ID for the resource. Ex - + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + /// The name of the resource + /// The type of the resource. E.g. + /// "Microsoft.Compute/virtualMachines" or + /// "Microsoft.Storage/storageAccounts" + /// Resource tags. /// The value of the secret for secret /// creation. /// The provisioning status of the /// resource. /// The unique immutable identifier of a /// resource (Guid). - public Secret(string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), string value = default(string), string provisioningState = default(string), string uniqueIdentifier = default(string)) - : base(id, name, type, location, tags) + /// The system metadata relating to this + /// resource + public Secret(string location, string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), string value = default(string), string provisioningState = default(string), string uniqueIdentifier = default(string), SystemData systemData = default(SystemData)) + : base(location, id, name, type, tags) { Value = value; ProvisioningState = provisioningState; UniqueIdentifier = uniqueIdentifier; + SystemData = systemData; CustomInit(); } @@ -77,5 +84,21 @@ public Secret() [JsonProperty(PropertyName = "properties.uniqueIdentifier")] public string UniqueIdentifier { get; private set; } + /// + /// Gets the system metadata relating to this resource + /// + [JsonProperty(PropertyName = "systemData")] + public SystemData SystemData { get; private set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public override void Validate() + { + base.Validate(); + } } } diff --git a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/SecretFragment.cs b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/SecretFragment.cs index 05a5861fdcca..f81a818385e7 100644 --- a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/SecretFragment.cs +++ b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/SecretFragment.cs @@ -10,18 +10,14 @@ namespace Microsoft.Azure.Management.DevTestLabs.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; using System.Collections; using System.Collections.Generic; using System.Linq; /// - /// A secret. + /// Patch /// - [Rest.Serialization.JsonTransformation] - public partial class SecretFragment : UpdateResource + public partial class SecretFragment : Tags { /// /// Initializes a new instance of the SecretFragment class. @@ -34,13 +30,10 @@ public SecretFragment() /// /// Initializes a new instance of the SecretFragment class. /// - /// The tags of the resource. - /// The value of the secret for secret - /// creation. - public SecretFragment(IDictionary tags = default(IDictionary), string value = default(string)) - : base(tags) + /// Resource tags + public SecretFragment(IDictionary tagsProperty = default(IDictionary)) + : base(tagsProperty) { - Value = value; CustomInit(); } @@ -49,11 +42,5 @@ public SecretFragment() /// partial void CustomInit(); - /// - /// Gets or sets the value of the secret for secret creation. - /// - [JsonProperty(PropertyName = "properties.value")] - public string Value { get; set; } - } } diff --git a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/ServiceFabric.cs b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/ServiceFabric.cs index dcde63d1e395..943ccaeca3f7 100644 --- a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/ServiceFabric.cs +++ b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/ServiceFabric.cs @@ -21,7 +21,7 @@ namespace Microsoft.Azure.Management.DevTestLabs.Models /// A Service Fabric. /// [Rest.Serialization.JsonTransformation] - public partial class ServiceFabric : Resource + public partial class ServiceFabric : TrackedResource { /// /// Initializes a new instance of the ServiceFabric class. @@ -34,29 +34,174 @@ public ServiceFabric() /// /// Initializes a new instance of the ServiceFabric class. /// - /// The identifier of the resource. - /// The name of the resource. - /// The type of the resource. - /// The location of the resource. - /// The tags of the resource. + /// The geo-location where the resource + /// lives + /// The geo-location where the + /// resource lives + /// The geo-location where the resource + /// lives + /// Fully qualified resource ID for the resource. Ex - + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + /// The name of the resource + /// The type of the resource. E.g. + /// "Microsoft.Compute/virtualMachines" or + /// "Microsoft.Storage/storageAccounts" + /// Resource tags. /// The backing service fabric /// resource's id /// The resource id of the environment /// under which the service fabric resource is present - /// The applicable schedule for the - /// virtual machine. + /// Resource tags + /// Fully qualified resource ID for the + /// resource. Ex - + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + /// The name of the resource + /// The type of the resource. E.g. + /// "Microsoft.Compute/virtualMachines" or + /// "Microsoft.Storage/storageAccounts" + /// Resource tags. + /// The status of the schedule (i.e. Enabled, + /// Disabled). Possible values include: 'Enabled', 'Disabled' + /// The task type of the schedule (e.g. + /// LabVmsShutdownTask, LabVmAutoStart). + /// The days of the week for which the schedule + /// is set (e.g. Sunday, Monday, Tuesday, etc.). + /// The time of the day the schedule will + /// occur. + /// The time of day the schedule will + /// occur. + /// Minutes of the hour the schedule will + /// run. + /// The time zone ID (e.g. Pacific Standard + /// time). + /// If notifications are enabled for this + /// schedule (i.e. Enabled, Disabled). Possible values include: + /// 'Enabled', 'Disabled' + /// Time in minutes before event at which + /// notification will be sent. + /// The webhook URL to which the notification + /// will be sent. + /// The email recipient to send + /// notifications to (can be a list of semi-colon separated email + /// addresses). + /// The locale to use when sending a + /// notification (fallback for unsupported languages is EN). + /// The creation date of the + /// schedule. + /// The resource ID to which the + /// schedule belongs /// The provisioning status of the /// resource. /// The unique immutable identifier of a /// resource (Guid). - public ServiceFabric(string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), string externalServiceFabricId = default(string), string environmentId = default(string), ApplicableSchedule applicableSchedule = default(ApplicableSchedule), string provisioningState = default(string), string uniqueIdentifier = default(string)) - : base(id, name, type, location, tags) + /// The system metadata relating to + /// this resource + /// Fully qualified resource ID for the resource. Ex + /// - + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + /// The name of the resource + /// The type of the resource. E.g. + /// "Microsoft.Compute/virtualMachines" or + /// "Microsoft.Storage/storageAccounts" + /// Resource tags. + /// The status of the schedule (i.e. Enabled, + /// Disabled). Possible values include: 'Enabled', 'Disabled' + /// The task type of the schedule (e.g. + /// LabVmsShutdownTask, LabVmAutoStart). + /// The days of the week for which the schedule + /// is set (e.g. Sunday, Monday, Tuesday, etc.). + /// The time of the day the schedule will + /// occur. + /// The time of day the schedule will + /// occur. + /// Minutes of the hour the schedule will + /// run. + /// The time zone ID (e.g. Pacific Standard + /// time). + /// If notifications are enabled for this + /// schedule (i.e. Enabled, Disabled). Possible values include: + /// 'Enabled', 'Disabled' + /// Time in minutes before event at which + /// notification will be sent. + /// The webhook URL to which the notification + /// will be sent. + /// The email recipient to send + /// notifications to (can be a list of semi-colon separated email + /// addresses). + /// The locale to use when sending a + /// notification (fallback for unsupported languages is EN). + /// The creation date of the + /// schedule. + /// The resource ID to which the + /// schedule belongs + /// The provisioning status of the + /// resource. + /// The unique immutable identifier of + /// a resource (Guid). + /// The system metadata relating to this + /// resource + /// The system metadata relating to this + /// resource + /// The provisioning status of the + /// resource. + /// The unique immutable identifier of + /// a resource (Guid). + /// The system metadata relating to this + /// resource + public ServiceFabric(string location, string serviceFabricLocation, string location1, string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), string externalServiceFabricId = default(string), string environmentId = default(string), IDictionary tagsProperty = default(IDictionary), string serviceFabricId = default(string), string serviceFabricName = default(string), string serviceFabricType = default(string), IDictionary serviceFabricTags = default(IDictionary), string status = default(string), string taskType = default(string), IList weekdays = default(IList), string time = default(string), string time1 = default(string), int? minute = default(int?), string timeZoneId = default(string), string status1 = default(string), int? timeInMinutes = default(int?), string webhookUrl = default(string), string emailRecipient = default(string), string notificationLocale = default(string), System.DateTime? createdDate = default(System.DateTime?), string targetResourceId = default(string), string provisioningState = default(string), string uniqueIdentifier = default(string), SystemData scheduleSystemData = default(SystemData), string id1 = default(string), string name1 = default(string), string type1 = default(string), IDictionary tags1 = default(IDictionary), string status2 = default(string), string taskType1 = default(string), IList weekdays1 = default(IList), string time2 = default(string), string time3 = default(string), int? minute1 = default(int?), string timeZoneId1 = default(string), string status3 = default(string), int? timeInMinutes1 = default(int?), string webhookUrl1 = default(string), string emailRecipient1 = default(string), string notificationLocale1 = default(string), System.DateTime? createdDate1 = default(System.DateTime?), string targetResourceId1 = default(string), string provisioningState1 = default(string), string uniqueIdentifier1 = default(string), SystemData systemData1 = default(SystemData), SystemData systemData2 = default(SystemData), string provisioningState2 = default(string), string uniqueIdentifier2 = default(string), SystemData systemData = default(SystemData)) + : base(location, id, name, type, tags) { ExternalServiceFabricId = externalServiceFabricId; EnvironmentId = environmentId; - ApplicableSchedule = applicableSchedule; + TagsProperty = tagsProperty; + ServiceFabricId = serviceFabricId; + ServiceFabricName = serviceFabricName; + ServiceFabricType = serviceFabricType; + ServiceFabricTags = serviceFabricTags; + ServiceFabricLocation = serviceFabricLocation; + Status = status; + TaskType = taskType; + Weekdays = weekdays; + Time = time; + Time1 = time1; + Minute = minute; + TimeZoneId = timeZoneId; + Status1 = status1; + TimeInMinutes = timeInMinutes; + WebhookUrl = webhookUrl; + EmailRecipient = emailRecipient; + NotificationLocale = notificationLocale; + CreatedDate = createdDate; + TargetResourceId = targetResourceId; ProvisioningState = provisioningState; UniqueIdentifier = uniqueIdentifier; + ScheduleSystemData = scheduleSystemData; + Id1 = id1; + Name1 = name1; + Type1 = type1; + Tags1 = tags1; + Location1 = location1; + Status2 = status2; + TaskType1 = taskType1; + Weekdays1 = weekdays1; + Time2 = time2; + Time3 = time3; + Minute1 = minute1; + TimeZoneId1 = timeZoneId1; + Status3 = status3; + TimeInMinutes1 = timeInMinutes1; + WebhookUrl1 = webhookUrl1; + EmailRecipient1 = emailRecipient1; + NotificationLocale1 = notificationLocale1; + CreatedDate1 = createdDate1; + TargetResourceId1 = targetResourceId1; + ProvisioningState1 = provisioningState1; + UniqueIdentifier1 = uniqueIdentifier1; + SystemData1 = systemData1; + SystemData2 = systemData2; + ProvisioningState2 = provisioningState2; + UniqueIdentifier2 = uniqueIdentifier2; + SystemData = systemData; CustomInit(); } @@ -79,22 +224,338 @@ public ServiceFabric() public string EnvironmentId { get; set; } /// - /// Gets the applicable schedule for the virtual machine. + /// Gets or sets resource tags + /// + [JsonProperty(PropertyName = "properties.applicableSchedule.tags")] + public IDictionary TagsProperty { get; set; } + + /// + /// Gets fully qualified resource ID for the resource. Ex - + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + /// + [JsonProperty(PropertyName = "properties.applicableSchedule.properties.labVmsShutdown.id")] + public string ServiceFabricId { get; private set; } + + /// + /// Gets the name of the resource + /// + [JsonProperty(PropertyName = "properties.applicableSchedule.properties.labVmsShutdown.name")] + public string ServiceFabricName { get; private set; } + + /// + /// Gets the type of the resource. E.g. + /// "Microsoft.Compute/virtualMachines" or + /// "Microsoft.Storage/storageAccounts" + /// + [JsonProperty(PropertyName = "properties.applicableSchedule.properties.labVmsShutdown.type")] + public string ServiceFabricType { get; private set; } + + /// + /// Gets or sets resource tags. + /// + [JsonProperty(PropertyName = "properties.applicableSchedule.properties.labVmsShutdown.tags")] + public IDictionary ServiceFabricTags { get; set; } + + /// + /// Gets or sets the geo-location where the resource lives + /// + [JsonProperty(PropertyName = "properties.applicableSchedule.properties.labVmsShutdown.location")] + public string ServiceFabricLocation { get; set; } + + /// + /// Gets or sets the status of the schedule (i.e. Enabled, Disabled). + /// Possible values include: 'Enabled', 'Disabled' + /// + [JsonProperty(PropertyName = "properties.applicableSchedule.properties.labVmsShutdown.properties.status")] + public string Status { get; set; } + + /// + /// Gets or sets the task type of the schedule (e.g. + /// LabVmsShutdownTask, LabVmAutoStart). + /// + [JsonProperty(PropertyName = "properties.applicableSchedule.properties.labVmsShutdown.properties.taskType")] + public string TaskType { get; set; } + + /// + /// Gets or sets the days of the week for which the schedule is set + /// (e.g. Sunday, Monday, Tuesday, etc.). + /// + [JsonProperty(PropertyName = "properties.applicableSchedule.properties.labVmsShutdown.properties.weeklyRecurrence.weekdays")] + public IList Weekdays { get; set; } + + /// + /// Gets or sets the time of the day the schedule will occur. + /// + [JsonProperty(PropertyName = "properties.applicableSchedule.properties.labVmsShutdown.properties.weeklyRecurrence.time")] + public string Time { get; set; } + + /// + /// Gets or sets the time of day the schedule will occur. + /// + [JsonProperty(PropertyName = "properties.applicableSchedule.properties.labVmsShutdown.properties.dailyRecurrence.time")] + public string Time1 { get; set; } + + /// + /// Gets or sets minutes of the hour the schedule will run. + /// + [JsonProperty(PropertyName = "properties.applicableSchedule.properties.labVmsShutdown.properties.hourlyRecurrence.minute")] + public int? Minute { get; set; } + + /// + /// Gets or sets the time zone ID (e.g. Pacific Standard time). /// - [JsonProperty(PropertyName = "properties.applicableSchedule")] - public ApplicableSchedule ApplicableSchedule { get; private set; } + [JsonProperty(PropertyName = "properties.applicableSchedule.properties.labVmsShutdown.properties.timeZoneId")] + public string TimeZoneId { get; set; } + + /// + /// Gets or sets if notifications are enabled for this schedule (i.e. + /// Enabled, Disabled). Possible values include: 'Enabled', 'Disabled' + /// + [JsonProperty(PropertyName = "properties.applicableSchedule.properties.labVmsShutdown.properties.notificationSettings.status")] + public string Status1 { get; set; } + + /// + /// Gets or sets time in minutes before event at which notification + /// will be sent. + /// + [JsonProperty(PropertyName = "properties.applicableSchedule.properties.labVmsShutdown.properties.notificationSettings.timeInMinutes")] + public int? TimeInMinutes { get; set; } + + /// + /// Gets or sets the webhook URL to which the notification will be + /// sent. + /// + [JsonProperty(PropertyName = "properties.applicableSchedule.properties.labVmsShutdown.properties.notificationSettings.webhookUrl")] + public string WebhookUrl { get; set; } + + /// + /// Gets or sets the email recipient to send notifications to (can be a + /// list of semi-colon separated email addresses). + /// + [JsonProperty(PropertyName = "properties.applicableSchedule.properties.labVmsShutdown.properties.notificationSettings.emailRecipient")] + public string EmailRecipient { get; set; } + + /// + /// Gets or sets the locale to use when sending a notification + /// (fallback for unsupported languages is EN). + /// + [JsonProperty(PropertyName = "properties.applicableSchedule.properties.labVmsShutdown.properties.notificationSettings.notificationLocale")] + public string NotificationLocale { get; set; } + + /// + /// Gets the creation date of the schedule. + /// + [JsonProperty(PropertyName = "properties.applicableSchedule.properties.labVmsShutdown.properties.createdDate")] + public System.DateTime? CreatedDate { get; private set; } + + /// + /// Gets or sets the resource ID to which the schedule belongs + /// + [JsonProperty(PropertyName = "properties.applicableSchedule.properties.labVmsShutdown.properties.targetResourceId")] + public string TargetResourceId { get; set; } /// /// Gets the provisioning status of the resource. /// - [JsonProperty(PropertyName = "properties.provisioningState")] + [JsonProperty(PropertyName = "properties.applicableSchedule.properties.labVmsShutdown.properties.provisioningState")] public string ProvisioningState { get; private set; } /// /// Gets the unique immutable identifier of a resource (Guid). /// - [JsonProperty(PropertyName = "properties.uniqueIdentifier")] + [JsonProperty(PropertyName = "properties.applicableSchedule.properties.labVmsShutdown.properties.uniqueIdentifier")] public string UniqueIdentifier { get; private set; } + /// + /// Gets the system metadata relating to this resource + /// + [JsonProperty(PropertyName = "properties.applicableSchedule.properties.labVmsShutdown.systemData")] + public SystemData ScheduleSystemData { get; private set; } + + /// + /// Gets fully qualified resource ID for the resource. Ex - + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + /// + [JsonProperty(PropertyName = "properties.applicableSchedule.properties.labVmsStartup.id")] + public string Id1 { get; private set; } + + /// + /// Gets the name of the resource + /// + [JsonProperty(PropertyName = "properties.applicableSchedule.properties.labVmsStartup.name")] + public string Name1 { get; private set; } + + /// + /// Gets the type of the resource. E.g. + /// "Microsoft.Compute/virtualMachines" or + /// "Microsoft.Storage/storageAccounts" + /// + [JsonProperty(PropertyName = "properties.applicableSchedule.properties.labVmsStartup.type")] + public string Type1 { get; private set; } + + /// + /// Gets or sets resource tags. + /// + [JsonProperty(PropertyName = "properties.applicableSchedule.properties.labVmsStartup.tags")] + public IDictionary Tags1 { get; set; } + + /// + /// Gets or sets the geo-location where the resource lives + /// + [JsonProperty(PropertyName = "properties.applicableSchedule.properties.labVmsStartup.location")] + public string Location1 { get; set; } + + /// + /// Gets or sets the status of the schedule (i.e. Enabled, Disabled). + /// Possible values include: 'Enabled', 'Disabled' + /// + [JsonProperty(PropertyName = "properties.applicableSchedule.properties.labVmsStartup.properties.status")] + public string Status2 { get; set; } + + /// + /// Gets or sets the task type of the schedule (e.g. + /// LabVmsShutdownTask, LabVmAutoStart). + /// + [JsonProperty(PropertyName = "properties.applicableSchedule.properties.labVmsStartup.properties.taskType")] + public string TaskType1 { get; set; } + + /// + /// Gets or sets the days of the week for which the schedule is set + /// (e.g. Sunday, Monday, Tuesday, etc.). + /// + [JsonProperty(PropertyName = "properties.applicableSchedule.properties.labVmsStartup.properties.weeklyRecurrence.weekdays")] + public IList Weekdays1 { get; set; } + + /// + /// Gets or sets the time of the day the schedule will occur. + /// + [JsonProperty(PropertyName = "properties.applicableSchedule.properties.labVmsStartup.properties.weeklyRecurrence.time")] + public string Time2 { get; set; } + + /// + /// Gets or sets the time of day the schedule will occur. + /// + [JsonProperty(PropertyName = "properties.applicableSchedule.properties.labVmsStartup.properties.dailyRecurrence.time")] + public string Time3 { get; set; } + + /// + /// Gets or sets minutes of the hour the schedule will run. + /// + [JsonProperty(PropertyName = "properties.applicableSchedule.properties.labVmsStartup.properties.hourlyRecurrence.minute")] + public int? Minute1 { get; set; } + + /// + /// Gets or sets the time zone ID (e.g. Pacific Standard time). + /// + [JsonProperty(PropertyName = "properties.applicableSchedule.properties.labVmsStartup.properties.timeZoneId")] + public string TimeZoneId1 { get; set; } + + /// + /// Gets or sets if notifications are enabled for this schedule (i.e. + /// Enabled, Disabled). Possible values include: 'Enabled', 'Disabled' + /// + [JsonProperty(PropertyName = "properties.applicableSchedule.properties.labVmsStartup.properties.notificationSettings.status")] + public string Status3 { get; set; } + + /// + /// Gets or sets time in minutes before event at which notification + /// will be sent. + /// + [JsonProperty(PropertyName = "properties.applicableSchedule.properties.labVmsStartup.properties.notificationSettings.timeInMinutes")] + public int? TimeInMinutes1 { get; set; } + + /// + /// Gets or sets the webhook URL to which the notification will be + /// sent. + /// + [JsonProperty(PropertyName = "properties.applicableSchedule.properties.labVmsStartup.properties.notificationSettings.webhookUrl")] + public string WebhookUrl1 { get; set; } + + /// + /// Gets or sets the email recipient to send notifications to (can be a + /// list of semi-colon separated email addresses). + /// + [JsonProperty(PropertyName = "properties.applicableSchedule.properties.labVmsStartup.properties.notificationSettings.emailRecipient")] + public string EmailRecipient1 { get; set; } + + /// + /// Gets or sets the locale to use when sending a notification + /// (fallback for unsupported languages is EN). + /// + [JsonProperty(PropertyName = "properties.applicableSchedule.properties.labVmsStartup.properties.notificationSettings.notificationLocale")] + public string NotificationLocale1 { get; set; } + + /// + /// Gets the creation date of the schedule. + /// + [JsonProperty(PropertyName = "properties.applicableSchedule.properties.labVmsStartup.properties.createdDate")] + public System.DateTime? CreatedDate1 { get; private set; } + + /// + /// Gets or sets the resource ID to which the schedule belongs + /// + [JsonProperty(PropertyName = "properties.applicableSchedule.properties.labVmsStartup.properties.targetResourceId")] + public string TargetResourceId1 { get; set; } + + /// + /// Gets the provisioning status of the resource. + /// + [JsonProperty(PropertyName = "properties.applicableSchedule.properties.labVmsStartup.properties.provisioningState")] + public string ProvisioningState1 { get; private set; } + + /// + /// Gets the unique immutable identifier of a resource (Guid). + /// + [JsonProperty(PropertyName = "properties.applicableSchedule.properties.labVmsStartup.properties.uniqueIdentifier")] + public string UniqueIdentifier1 { get; private set; } + + /// + /// Gets the system metadata relating to this resource + /// + [JsonProperty(PropertyName = "properties.applicableSchedule.properties.labVmsStartup.systemData")] + public SystemData SystemData1 { get; private set; } + + /// + /// Gets the system metadata relating to this resource + /// + [JsonProperty(PropertyName = "properties.applicableSchedule.systemData")] + public SystemData SystemData2 { get; private set; } + + /// + /// Gets the provisioning status of the resource. + /// + [JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState2 { get; private set; } + + /// + /// Gets the unique immutable identifier of a resource (Guid). + /// + [JsonProperty(PropertyName = "properties.uniqueIdentifier")] + public string UniqueIdentifier2 { get; private set; } + + /// + /// Gets the system metadata relating to this resource + /// + [JsonProperty(PropertyName = "systemData")] + public SystemData SystemData { get; private set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public override void Validate() + { + base.Validate(); + if (ServiceFabricLocation == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "ServiceFabricLocation"); + } + if (Location1 == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Location1"); + } + } } } diff --git a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/ServiceFabricFragment.cs b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/ServiceFabricFragment.cs index a652b7e4785a..ae017c71eb91 100644 --- a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/ServiceFabricFragment.cs +++ b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/ServiceFabricFragment.cs @@ -10,18 +10,14 @@ namespace Microsoft.Azure.Management.DevTestLabs.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; using System.Collections; using System.Collections.Generic; using System.Linq; /// - /// A Service Fabric. + /// Patch /// - [Rest.Serialization.JsonTransformation] - public partial class ServiceFabricFragment : UpdateResource + public partial class ServiceFabricFragment : Tags { /// /// Initializes a new instance of the ServiceFabricFragment class. @@ -34,16 +30,10 @@ public ServiceFabricFragment() /// /// Initializes a new instance of the ServiceFabricFragment class. /// - /// The tags of the resource. - /// The backing service fabric - /// resource's id - /// The resource id of the environment - /// under which the service fabric resource is present - public ServiceFabricFragment(IDictionary tags = default(IDictionary), string externalServiceFabricId = default(string), string environmentId = default(string)) - : base(tags) + /// Resource tags + public ServiceFabricFragment(IDictionary tagsProperty = default(IDictionary)) + : base(tagsProperty) { - ExternalServiceFabricId = externalServiceFabricId; - EnvironmentId = environmentId; CustomInit(); } @@ -52,18 +42,5 @@ public ServiceFabricFragment() /// partial void CustomInit(); - /// - /// Gets or sets the backing service fabric resource's id - /// - [JsonProperty(PropertyName = "properties.externalServiceFabricId")] - public string ExternalServiceFabricId { get; set; } - - /// - /// Gets or sets the resource id of the environment under which the - /// service fabric resource is present - /// - [JsonProperty(PropertyName = "properties.environmentId")] - public string EnvironmentId { get; set; } - } } diff --git a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/ServiceRunner.cs b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/ServiceRunner.cs index b6bec3e30b71..98bb92155fa4 100644 --- a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/ServiceRunner.cs +++ b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/ServiceRunner.cs @@ -10,6 +10,8 @@ namespace Microsoft.Azure.Management.DevTestLabs.Models { + using Microsoft.Rest; + using Microsoft.Rest.Serialization; using Newtonsoft.Json; using System.Collections; using System.Collections.Generic; @@ -18,7 +20,8 @@ namespace Microsoft.Azure.Management.DevTestLabs.Models /// /// A container for a managed identity to execute DevTest lab services. /// - public partial class ServiceRunner : Resource + [Rest.Serialization.JsonTransformation] + public partial class ServiceRunner : TrackedResource { /// /// Initializes a new instance of the ServiceRunner class. @@ -31,16 +34,47 @@ public ServiceRunner() /// /// Initializes a new instance of the ServiceRunner class. /// - /// The identifier of the resource. - /// The name of the resource. - /// The type of the resource. - /// The location of the resource. - /// The tags of the resource. - /// The identity of the resource. - public ServiceRunner(string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), IdentityProperties identity = default(IdentityProperties)) - : base(id, name, type, location, tags) + /// The geo-location where the resource + /// lives + /// Fully qualified resource ID for the resource. Ex - + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + /// The name of the resource + /// The type of the resource. E.g. + /// "Microsoft.Compute/virtualMachines" or + /// "Microsoft.Storage/storageAccounts" + /// Resource tags. + /// The purpose of bringing the + /// identity to the lab. Ex: To use during Environment creation or to + /// deploy on the VMs. + /// The provisioning status of the + /// resource. + /// The unique immutable identifier of a + /// resource (Guid). + /// Type of identity (SystemAssigned, + /// UserAssigned, None). Possible values include: 'None', + /// 'SystemAssigned', 'UserAssigned', + /// 'SystemAssigned,UserAssigned' + /// The principal id of resource + /// identity. + /// The tenant identifier of resource. + /// The client secret URL of the + /// identity. + /// If Type is 'UserAssigned': + /// List of user assigned identities. + /// The system metadata relating to this + /// resource + public ServiceRunner(string location, string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), string identityUsageType = default(string), string provisioningState = default(string), string uniqueIdentifier = default(string), string serviceRunnerType = default(string), string principalId = default(string), string tenantId = default(string), string clientSecretUrl = default(string), IDictionary userAssignedIdentities = default(IDictionary), SystemData systemData = default(SystemData)) + : base(location, id, name, type, tags) { - Identity = identity; + IdentityUsageType = identityUsageType; + ProvisioningState = provisioningState; + UniqueIdentifier = uniqueIdentifier; + ServiceRunnerType = serviceRunnerType; + PrincipalId = principalId; + TenantId = tenantId; + ClientSecretUrl = clientSecretUrl; + UserAssignedIdentities = userAssignedIdentities; + SystemData = systemData; CustomInit(); } @@ -50,10 +84,72 @@ public ServiceRunner() partial void CustomInit(); /// - /// Gets or sets the identity of the resource. + /// Gets or sets the purpose of bringing the identity to the lab. Ex: + /// To use during Environment creation or to deploy on the VMs. /// - [JsonProperty(PropertyName = "identity")] - public IdentityProperties Identity { get; set; } + [JsonProperty(PropertyName = "properties.identityUsageType")] + public string IdentityUsageType { get; set; } + /// + /// Gets the provisioning status of the resource. + /// + [JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState { get; private set; } + + /// + /// Gets the unique immutable identifier of a resource (Guid). + /// + [JsonProperty(PropertyName = "properties.uniqueIdentifier")] + public string UniqueIdentifier { get; private set; } + + /// + /// Gets or sets type of identity (SystemAssigned, UserAssigned, None). + /// Possible values include: 'None', 'SystemAssigned', 'UserAssigned', + /// 'SystemAssigned,UserAssigned' + /// + [JsonProperty(PropertyName = "identity.type")] + public string ServiceRunnerType { get; set; } + + /// + /// Gets or sets the principal id of resource identity. + /// + [JsonProperty(PropertyName = "identity.principalId")] + public string PrincipalId { get; set; } + + /// + /// Gets or sets the tenant identifier of resource. + /// + [JsonProperty(PropertyName = "identity.tenantId")] + public string TenantId { get; set; } + + /// + /// Gets or sets the client secret URL of the identity. + /// + [JsonProperty(PropertyName = "identity.clientSecretUrl")] + public string ClientSecretUrl { get; set; } + + /// + /// Gets or sets if Type is 'UserAssigned': List of user assigned + /// identities. + /// + [JsonProperty(PropertyName = "identity.userAssignedIdentities")] + public IDictionary UserAssignedIdentities { get; set; } + + /// + /// Gets the system metadata relating to this resource + /// + [JsonProperty(PropertyName = "systemData")] + public SystemData SystemData { get; private set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public override void Validate() + { + base.Validate(); + } } } diff --git a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/SharedGallery.cs b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/SharedGallery.cs new file mode 100644 index 000000000000..eac79da30aa9 --- /dev/null +++ b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/SharedGallery.cs @@ -0,0 +1,117 @@ +// +// 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.DevTestLabs.Models +{ + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Properties of a shared gallery + /// + [Rest.Serialization.JsonTransformation] + public partial class SharedGallery : TrackedResource + { + /// + /// Initializes a new instance of the SharedGallery class. + /// + public SharedGallery() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the SharedGallery class. + /// + /// The geo-location where the resource + /// lives + /// Fully qualified resource ID for the resource. Ex - + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + /// The name of the resource + /// The type of the resource. E.g. + /// "Microsoft.Compute/virtualMachines" or + /// "Microsoft.Storage/storageAccounts" + /// Resource tags. + /// The shared image gallery resource + /// Id + /// Enables all images in the gallery to + /// be available in the lab for VM creation. This will override the + /// EnableState on shared images. Possible values include: 'Disabled', + /// 'Enabled' + /// The provisioning status of the + /// resource. + /// The unique immutable identifier of a + /// resource (Guid). + /// The system metadata relating to this + /// resource + public SharedGallery(string location, string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), string galleryId = default(string), string allowAllImages = default(string), string provisioningState = default(string), string uniqueIdentifier = default(string), SystemData systemData = default(SystemData)) + : base(location, id, name, type, tags) + { + GalleryId = galleryId; + AllowAllImages = allowAllImages; + ProvisioningState = provisioningState; + UniqueIdentifier = uniqueIdentifier; + SystemData = systemData; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the shared image gallery resource Id + /// + [JsonProperty(PropertyName = "properties.galleryId")] + public string GalleryId { get; set; } + + /// + /// Gets or sets enables all images in the gallery to be available in + /// the lab for VM creation. This will override the EnableState on + /// shared images. Possible values include: 'Disabled', 'Enabled' + /// + [JsonProperty(PropertyName = "properties.allowAllImages")] + public string AllowAllImages { get; set; } + + /// + /// Gets the provisioning status of the resource. + /// + [JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState { get; private set; } + + /// + /// Gets the unique immutable identifier of a resource (Guid). + /// + [JsonProperty(PropertyName = "properties.uniqueIdentifier")] + public string UniqueIdentifier { get; private set; } + + /// + /// Gets the system metadata relating to this resource + /// + [JsonProperty(PropertyName = "systemData")] + public SystemData SystemData { get; private set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public override void Validate() + { + base.Validate(); + } + } +} diff --git a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/SharedGalleryFragment.cs b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/SharedGalleryFragment.cs new file mode 100644 index 000000000000..3b7e9928795c --- /dev/null +++ b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/SharedGalleryFragment.cs @@ -0,0 +1,46 @@ +// +// 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.DevTestLabs.Models +{ + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Patch + /// + public partial class SharedGalleryFragment : Tags + { + /// + /// Initializes a new instance of the SharedGalleryFragment class. + /// + public SharedGalleryFragment() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the SharedGalleryFragment class. + /// + /// Resource tags + public SharedGalleryFragment(IDictionary tagsProperty = default(IDictionary)) + : base(tagsProperty) + { + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + } +} diff --git a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/SharedImage.cs b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/SharedImage.cs new file mode 100644 index 000000000000..97efbe69f7c5 --- /dev/null +++ b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/SharedImage.cs @@ -0,0 +1,151 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.DevTestLabs.Models +{ + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Properties of a shared image + /// + [Rest.Serialization.JsonTransformation] + public partial class SharedImage : TrackedResource + { + /// + /// Initializes a new instance of the SharedImage class. + /// + public SharedImage() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the SharedImage class. + /// + /// The geo-location where the resource + /// lives + /// Fully qualified resource ID for the resource. Ex - + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + /// The name of the resource + /// The type of the resource. E.g. + /// "Microsoft.Compute/virtualMachines" or + /// "Microsoft.Storage/storageAccounts" + /// Resource tags. + /// Shared Image definition name in shared + /// image gallery + /// The operating system of the image. Possible + /// values include: 'Windows', 'Linux' + /// The type of image in the gallery + /// (generalized or specialized). Possible values include: + /// 'Generalized', 'Specialized' + /// Whether or not the image is enabled. + /// Possible values include: 'Disabled', 'Enabled' + /// Display name of the image + /// List of image versions in definition + /// The provisioning status of the + /// resource. + /// The unique immutable identifier of a + /// resource (Guid). + /// The system metadata relating to this + /// resource + public SharedImage(string location, string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), string definitionName = default(string), string osType = default(string), string imageType = default(string), string enableState = default(string), string displayName = default(string), IList versions = default(IList), string provisioningState = default(string), string uniqueIdentifier = default(string), SystemData systemData = default(SystemData)) + : base(location, id, name, type, tags) + { + DefinitionName = definitionName; + OsType = osType; + ImageType = imageType; + EnableState = enableState; + DisplayName = displayName; + Versions = versions; + ProvisioningState = provisioningState; + UniqueIdentifier = uniqueIdentifier; + SystemData = systemData; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets shared Image definition name in shared image gallery + /// + [JsonProperty(PropertyName = "properties.definitionName")] + public string DefinitionName { get; set; } + + /// + /// Gets or sets the operating system of the image. Possible values + /// include: 'Windows', 'Linux' + /// + [JsonProperty(PropertyName = "properties.osType")] + public string OsType { get; set; } + + /// + /// Gets or sets the type of image in the gallery (generalized or + /// specialized). Possible values include: 'Generalized', 'Specialized' + /// + [JsonProperty(PropertyName = "properties.imageType")] + public string ImageType { get; set; } + + /// + /// Gets or sets whether or not the image is enabled. Possible values + /// include: 'Disabled', 'Enabled' + /// + [JsonProperty(PropertyName = "properties.enableState")] + public string EnableState { get; set; } + + /// + /// Gets or sets display name of the image + /// + [JsonProperty(PropertyName = "properties.displayName")] + public string DisplayName { get; set; } + + /// + /// Gets or sets list of image versions in definition + /// + [JsonProperty(PropertyName = "properties.versions")] + public IList Versions { get; set; } + + /// + /// Gets the provisioning status of the resource. + /// + [JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState { get; private set; } + + /// + /// Gets the unique immutable identifier of a resource (Guid). + /// + [JsonProperty(PropertyName = "properties.uniqueIdentifier")] + public string UniqueIdentifier { get; private set; } + + /// + /// Gets the system metadata relating to this resource + /// + [JsonProperty(PropertyName = "systemData")] + public SystemData SystemData { get; private set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public override void Validate() + { + base.Validate(); + } + } +} diff --git a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/HourDetailsFragment.cs b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/SharedImageFragment.cs similarity index 56% rename from sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/HourDetailsFragment.cs rename to sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/SharedImageFragment.cs index 9abc4c1f633f..e4d7d469c6f6 100644 --- a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/HourDetailsFragment.cs +++ b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/SharedImageFragment.cs @@ -10,30 +10,30 @@ namespace Microsoft.Azure.Management.DevTestLabs.Models { - using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; using System.Linq; /// - /// Properties of an hourly schedule. + /// Patch /// - public partial class HourDetailsFragment + public partial class SharedImageFragment : Tags { /// - /// Initializes a new instance of the HourDetailsFragment class. + /// Initializes a new instance of the SharedImageFragment class. /// - public HourDetailsFragment() + public SharedImageFragment() { CustomInit(); } /// - /// Initializes a new instance of the HourDetailsFragment class. + /// Initializes a new instance of the SharedImageFragment class. /// - /// Minutes of the hour the schedule will - /// run. - public HourDetailsFragment(int? minute = default(int?)) + /// Resource tags + public SharedImageFragment(IDictionary tagsProperty = default(IDictionary)) + : base(tagsProperty) { - Minute = minute; CustomInit(); } @@ -42,11 +42,5 @@ public HourDetailsFragment() /// partial void CustomInit(); - /// - /// Gets or sets minutes of the hour the schedule will run. - /// - [JsonProperty(PropertyName = "minute")] - public int? Minute { get; set; } - } } diff --git a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/SharedPublicIpAddressConfiguration.cs b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/SharedPublicIpAddressConfiguration.cs deleted file mode 100644 index 710a96cbe20a..000000000000 --- a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/SharedPublicIpAddressConfiguration.cs +++ /dev/null @@ -1,56 +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.DevTestLabs.Models -{ - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - - /// - /// Properties of a virtual machine that determine how it is connected to a - /// load balancer. - /// - public partial class SharedPublicIpAddressConfiguration - { - /// - /// Initializes a new instance of the - /// SharedPublicIpAddressConfiguration class. - /// - public SharedPublicIpAddressConfiguration() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the - /// SharedPublicIpAddressConfiguration class. - /// - /// The incoming NAT rules - public SharedPublicIpAddressConfiguration(IList inboundNatRules = default(IList)) - { - InboundNatRules = inboundNatRules; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the incoming NAT rules - /// - [JsonProperty(PropertyName = "inboundNatRules")] - public IList InboundNatRules { get; set; } - - } -} diff --git a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/SharedPublicIpAddressConfigurationFragment.cs b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/SharedPublicIpAddressConfigurationFragment.cs deleted file mode 100644 index 336c77faa8cd..000000000000 --- a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/SharedPublicIpAddressConfigurationFragment.cs +++ /dev/null @@ -1,56 +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.DevTestLabs.Models -{ - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - - /// - /// Properties of a virtual machine that determine how it is connected to a - /// load balancer. - /// - public partial class SharedPublicIpAddressConfigurationFragment - { - /// - /// Initializes a new instance of the - /// SharedPublicIpAddressConfigurationFragment class. - /// - public SharedPublicIpAddressConfigurationFragment() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the - /// SharedPublicIpAddressConfigurationFragment class. - /// - /// The incoming NAT rules - public SharedPublicIpAddressConfigurationFragment(IList inboundNatRules = default(IList)) - { - InboundNatRules = inboundNatRules; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the incoming NAT rules - /// - [JsonProperty(PropertyName = "inboundNatRules")] - public IList InboundNatRules { get; set; } - - } -} diff --git a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/ShutdownNotificationContent.cs b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/ShutdownNotificationContent.cs deleted file mode 100644 index 4e70356a1587..000000000000 --- a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/ShutdownNotificationContent.cs +++ /dev/null @@ -1,158 +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.DevTestLabs.Models -{ - using Newtonsoft.Json; - using System.Linq; - - /// - /// The contents of a shutdown notification. Webhooks can use this type to - /// deserialize the request body when they get notified of an imminent - /// shutdown. - /// - public partial class ShutdownNotificationContent - { - /// - /// Initializes a new instance of the ShutdownNotificationContent - /// class. - /// - public ShutdownNotificationContent() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the ShutdownNotificationContent - /// class. - /// - /// The URL to skip auto-shutdown. - /// The URL to delay shutdown by 60 - /// minutes. - /// The URL to delay shutdown by 2 - /// hours. - /// The virtual machine to be shut down. - /// The GUID for the virtual machine to be shut - /// down. - /// The owner of the virtual machine. - /// The URL of the virtual machine. - /// Minutes remaining until - /// shutdown - /// The event for which a notification will be - /// sent. - /// The text for the notification. - /// The subscription ID for the - /// schedule. - /// The resource group name for the - /// schedule. - /// The lab for the schedule. - public ShutdownNotificationContent(string skipUrl = default(string), string delayUrl60 = default(string), string delayUrl120 = default(string), string vmName = default(string), string guid = default(string), string owner = default(string), string vmUrl = default(string), string minutesUntilShutdown = default(string), string eventType = default(string), string text = default(string), string subscriptionId = default(string), string resourceGroupName = default(string), string labName = default(string)) - { - SkipUrl = skipUrl; - DelayUrl60 = delayUrl60; - DelayUrl120 = delayUrl120; - VmName = vmName; - Guid = guid; - Owner = owner; - VmUrl = vmUrl; - MinutesUntilShutdown = minutesUntilShutdown; - EventType = eventType; - Text = text; - SubscriptionId = subscriptionId; - ResourceGroupName = resourceGroupName; - LabName = labName; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the URL to skip auto-shutdown. - /// - [JsonProperty(PropertyName = "skipUrl")] - public string SkipUrl { get; set; } - - /// - /// Gets or sets the URL to delay shutdown by 60 minutes. - /// - [JsonProperty(PropertyName = "delayUrl60")] - public string DelayUrl60 { get; set; } - - /// - /// Gets or sets the URL to delay shutdown by 2 hours. - /// - [JsonProperty(PropertyName = "delayUrl120")] - public string DelayUrl120 { get; set; } - - /// - /// Gets or sets the virtual machine to be shut down. - /// - [JsonProperty(PropertyName = "vmName")] - public string VmName { get; set; } - - /// - /// Gets or sets the GUID for the virtual machine to be shut down. - /// - [JsonProperty(PropertyName = "guid")] - public string Guid { get; set; } - - /// - /// Gets or sets the owner of the virtual machine. - /// - [JsonProperty(PropertyName = "owner")] - public string Owner { get; set; } - - /// - /// Gets or sets the URL of the virtual machine. - /// - [JsonProperty(PropertyName = "vmUrl")] - public string VmUrl { get; set; } - - /// - /// Gets or sets minutes remaining until shutdown - /// - [JsonProperty(PropertyName = "minutesUntilShutdown")] - public string MinutesUntilShutdown { get; set; } - - /// - /// Gets or sets the event for which a notification will be sent. - /// - [JsonProperty(PropertyName = "eventType")] - public string EventType { get; set; } - - /// - /// Gets or sets the text for the notification. - /// - [JsonProperty(PropertyName = "text")] - public string Text { get; set; } - - /// - /// Gets or sets the subscription ID for the schedule. - /// - [JsonProperty(PropertyName = "subscriptionId")] - public string SubscriptionId { get; set; } - - /// - /// Gets or sets the resource group name for the schedule. - /// - [JsonProperty(PropertyName = "resourceGroupName")] - public string ResourceGroupName { get; set; } - - /// - /// Gets or sets the lab for the schedule. - /// - [JsonProperty(PropertyName = "labName")] - public string LabName { get; set; } - - } -} diff --git a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/Sku.cs b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/Sku.cs new file mode 100644 index 000000000000..a5a59198d580 --- /dev/null +++ b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/Sku.cs @@ -0,0 +1,114 @@ +// +// 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.DevTestLabs.Models +{ + using Microsoft.Rest; + using Newtonsoft.Json; + using System.Linq; + + /// + /// The resource model definition representing SKU + /// + public partial class Sku + { + /// + /// Initializes a new instance of the Sku class. + /// + public Sku() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the Sku class. + /// + /// The name of the SKU. Ex - P3. It is typically a + /// letter+number code + /// This field is required to be implemented by the + /// Resource Provider if the service has more than one tier, but is not + /// required on a PUT. Possible values include: 'Free', 'Basic', + /// 'Standard', 'Premium' + /// The SKU size. When the name field is the + /// combination of tier and some other value, this would be the + /// standalone code. + /// If the service has different generations of + /// hardware, for the same SKU, then that can be captured here. + /// If the SKU supports scale out/in then the + /// capacity integer should be included. If scale out/in is not + /// possible for the resource this may be omitted. + public Sku(string name, SkuTier? tier = default(SkuTier?), string size = default(string), string family = default(string), int? capacity = default(int?)) + { + Name = name; + Tier = tier; + Size = size; + Family = family; + Capacity = capacity; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the name of the SKU. Ex - P3. It is typically a + /// letter+number code + /// + [JsonProperty(PropertyName = "name")] + public string Name { get; set; } + + /// + /// Gets or sets this field is required to be implemented by the + /// Resource Provider if the service has more than one tier, but is not + /// required on a PUT. Possible values include: 'Free', 'Basic', + /// 'Standard', 'Premium' + /// + [JsonProperty(PropertyName = "tier")] + public SkuTier? Tier { get; set; } + + /// + /// Gets or sets the SKU size. When the name field is the combination + /// of tier and some other value, this would be the standalone code. + /// + [JsonProperty(PropertyName = "size")] + public string Size { get; set; } + + /// + /// Gets or sets if the service has different generations of hardware, + /// for the same SKU, then that can be captured here. + /// + [JsonProperty(PropertyName = "family")] + public string Family { get; set; } + + /// + /// Gets or sets if the SKU supports scale out/in then the capacity + /// integer should be included. If scale out/in is not possible for the + /// resource this may be omitted. + /// + [JsonProperty(PropertyName = "capacity")] + public int? Capacity { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (Name == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Name"); + } + } + } +} diff --git a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/SkuTier.cs b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/SkuTier.cs new file mode 100644 index 000000000000..0ad226a5c67d --- /dev/null +++ b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/SkuTier.cs @@ -0,0 +1,72 @@ +// +// 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.DevTestLabs.Models +{ + using Newtonsoft.Json; + using Newtonsoft.Json.Converters; + using System.Runtime; + using System.Runtime.Serialization; + + /// + /// Defines values for SkuTier. + /// + [JsonConverter(typeof(StringEnumConverter))] + public enum SkuTier + { + [EnumMember(Value = "Free")] + Free, + [EnumMember(Value = "Basic")] + Basic, + [EnumMember(Value = "Standard")] + Standard, + [EnumMember(Value = "Premium")] + Premium + } + internal static class SkuTierEnumExtension + { + internal static string ToSerializedValue(this SkuTier? value) + { + return value == null ? null : ((SkuTier)value).ToSerializedValue(); + } + + internal static string ToSerializedValue(this SkuTier value) + { + switch( value ) + { + case SkuTier.Free: + return "Free"; + case SkuTier.Basic: + return "Basic"; + case SkuTier.Standard: + return "Standard"; + case SkuTier.Premium: + return "Premium"; + } + return null; + } + + internal static SkuTier? ParseSkuTier(this string value) + { + switch( value ) + { + case "Free": + return SkuTier.Free; + case "Basic": + return SkuTier.Basic; + case "Standard": + return SkuTier.Standard; + case "Premium": + return SkuTier.Premium; + } + return null; + } + } +} diff --git a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/SourceControlType.cs b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/SourceControlType.cs index 971c18e93a54..1698430059e8 100644 --- a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/SourceControlType.cs +++ b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/SourceControlType.cs @@ -18,5 +18,6 @@ public static class SourceControlType { public const string VsoGit = "VsoGit"; public const string GitHub = "GitHub"; + public const string StorageAccount = "StorageAccount"; } } diff --git a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/StorageType.cs b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/StorageType.cs index 54e99c938c3e..b0c4f7954536 100644 --- a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/StorageType.cs +++ b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/StorageType.cs @@ -18,5 +18,6 @@ public static class StorageType { public const string Standard = "Standard"; public const string Premium = "Premium"; + public const string StandardSSD = "StandardSSD"; } } diff --git a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/StorageTypes.cs b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/StorageTypes.cs new file mode 100644 index 000000000000..4885cf766906 --- /dev/null +++ b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/StorageTypes.cs @@ -0,0 +1,23 @@ +// +// 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.DevTestLabs.Models +{ + + /// + /// Defines values for StorageTypes. + /// + public static class StorageTypes + { + public const string Standard = "Standard"; + public const string Premium = "Premium"; + public const string StandardSSD = "StandardSSD"; + } +} diff --git a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/SubnetFragment.cs b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/SubnetFragment.cs deleted file mode 100644 index 4d98ebc44731..000000000000 --- a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/SubnetFragment.cs +++ /dev/null @@ -1,72 +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.DevTestLabs.Models -{ - using Newtonsoft.Json; - using System.Linq; - - /// - /// Subnet information. - /// - public partial class SubnetFragment - { - /// - /// Initializes a new instance of the SubnetFragment class. - /// - public SubnetFragment() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the SubnetFragment class. - /// - /// The resource ID of the subnet. - /// The name of the subnet as seen in the - /// lab. - /// The permission policy of the subnet for - /// allowing public IP addresses (i.e. Allow, Deny)). Possible values - /// include: 'Default', 'Deny', 'Allow' - public SubnetFragment(string resourceId = default(string), string labSubnetName = default(string), string allowPublicIp = default(string)) - { - ResourceId = resourceId; - LabSubnetName = labSubnetName; - AllowPublicIp = allowPublicIp; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the resource ID of the subnet. - /// - [JsonProperty(PropertyName = "resourceId")] - public string ResourceId { get; set; } - - /// - /// Gets or sets the name of the subnet as seen in the lab. - /// - [JsonProperty(PropertyName = "labSubnetName")] - public string LabSubnetName { get; set; } - - /// - /// Gets or sets the permission policy of the subnet for allowing - /// public IP addresses (i.e. Allow, Deny)). Possible values include: - /// 'Default', 'Deny', 'Allow' - /// - [JsonProperty(PropertyName = "allowPublicIp")] - public string AllowPublicIp { get; set; } - - } -} diff --git a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/SubnetOverride.cs b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/SubnetOverride.cs index 8c3389b70183..8eb694937616 100644 --- a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/SubnetOverride.cs +++ b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/SubnetOverride.cs @@ -10,12 +10,17 @@ namespace Microsoft.Azure.Management.DevTestLabs.Models { + using Microsoft.Rest; + using Microsoft.Rest.Serialization; using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; using System.Linq; /// /// Property overrides on a subnet of a virtual network. /// + [Rest.Serialization.JsonTransformation] public partial class SubnetOverride { /// @@ -39,17 +44,17 @@ public SubnetOverride() /// IP addresses can be assigned to virtual machines on this subnet /// (i.e. Allow, Deny). Possible values include: 'Default', 'Deny', /// 'Allow' - /// Properties that - /// virtual machines on this subnet will share. + /// Backend ports that virtual machines on + /// this subnet are allowed to expose /// The virtual network pool /// associated with this subnet. - public SubnetOverride(string resourceId = default(string), string labSubnetName = default(string), string useInVmCreationPermission = default(string), string usePublicIpAddressPermission = default(string), SubnetSharedPublicIpAddressConfiguration sharedPublicIpAddressConfiguration = default(SubnetSharedPublicIpAddressConfiguration), string virtualNetworkPoolName = default(string)) + public SubnetOverride(string resourceId = default(string), string labSubnetName = default(string), string useInVmCreationPermission = default(string), string usePublicIpAddressPermission = default(string), IList allowedPorts = default(IList), string virtualNetworkPoolName = default(string)) { ResourceId = resourceId; LabSubnetName = labSubnetName; UseInVmCreationPermission = useInVmCreationPermission; UsePublicIpAddressPermission = usePublicIpAddressPermission; - SharedPublicIpAddressConfiguration = sharedPublicIpAddressConfiguration; + AllowedPorts = allowedPorts; VirtualNetworkPoolName = virtualNetworkPoolName; CustomInit(); } @@ -88,11 +93,11 @@ public SubnetOverride() public string UsePublicIpAddressPermission { get; set; } /// - /// Gets or sets properties that virtual machines on this subnet will - /// share. + /// Gets or sets backend ports that virtual machines on this subnet are + /// allowed to expose /// - [JsonProperty(PropertyName = "sharedPublicIpAddressConfiguration")] - public SubnetSharedPublicIpAddressConfiguration SharedPublicIpAddressConfiguration { get; set; } + [JsonProperty(PropertyName = "sharedPublicIpAddressConfiguration.allowedPorts")] + public IList AllowedPorts { get; set; } /// /// Gets or sets the virtual network pool associated with this subnet. diff --git a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/SubnetOverrideFragment.cs b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/SubnetOverrideFragment.cs deleted file mode 100644 index 4aa35009a12b..000000000000 --- a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/SubnetOverrideFragment.cs +++ /dev/null @@ -1,104 +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.DevTestLabs.Models -{ - using Newtonsoft.Json; - using System.Linq; - - /// - /// Property overrides on a subnet of a virtual network. - /// - public partial class SubnetOverrideFragment - { - /// - /// Initializes a new instance of the SubnetOverrideFragment class. - /// - public SubnetOverrideFragment() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the SubnetOverrideFragment class. - /// - /// The resource ID of the subnet. - /// The name given to the subnet within the - /// lab. - /// Indicates whether this - /// subnet can be used during virtual machine creation (i.e. Allow, - /// Deny). Possible values include: 'Default', 'Deny', 'Allow' - /// Indicates whether public - /// IP addresses can be assigned to virtual machines on this subnet - /// (i.e. Allow, Deny). Possible values include: 'Default', 'Deny', - /// 'Allow' - /// Properties that - /// virtual machines on this subnet will share. - /// The virtual network pool - /// associated with this subnet. - public SubnetOverrideFragment(string resourceId = default(string), string labSubnetName = default(string), string useInVmCreationPermission = default(string), string usePublicIpAddressPermission = default(string), SubnetSharedPublicIpAddressConfigurationFragment sharedPublicIpAddressConfiguration = default(SubnetSharedPublicIpAddressConfigurationFragment), string virtualNetworkPoolName = default(string)) - { - ResourceId = resourceId; - LabSubnetName = labSubnetName; - UseInVmCreationPermission = useInVmCreationPermission; - UsePublicIpAddressPermission = usePublicIpAddressPermission; - SharedPublicIpAddressConfiguration = sharedPublicIpAddressConfiguration; - VirtualNetworkPoolName = virtualNetworkPoolName; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the resource ID of the subnet. - /// - [JsonProperty(PropertyName = "resourceId")] - public string ResourceId { get; set; } - - /// - /// Gets or sets the name given to the subnet within the lab. - /// - [JsonProperty(PropertyName = "labSubnetName")] - public string LabSubnetName { get; set; } - - /// - /// Gets or sets indicates whether this subnet can be used during - /// virtual machine creation (i.e. Allow, Deny). Possible values - /// include: 'Default', 'Deny', 'Allow' - /// - [JsonProperty(PropertyName = "useInVmCreationPermission")] - public string UseInVmCreationPermission { get; set; } - - /// - /// Gets or sets indicates whether public IP addresses can be assigned - /// to virtual machines on this subnet (i.e. Allow, Deny). Possible - /// values include: 'Default', 'Deny', 'Allow' - /// - [JsonProperty(PropertyName = "usePublicIpAddressPermission")] - public string UsePublicIpAddressPermission { get; set; } - - /// - /// Gets or sets properties that virtual machines on this subnet will - /// share. - /// - [JsonProperty(PropertyName = "sharedPublicIpAddressConfiguration")] - public SubnetSharedPublicIpAddressConfigurationFragment SharedPublicIpAddressConfiguration { get; set; } - - /// - /// Gets or sets the virtual network pool associated with this subnet. - /// - [JsonProperty(PropertyName = "virtualNetworkPoolName")] - public string VirtualNetworkPoolName { get; set; } - - } -} diff --git a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/SubnetSharedPublicIpAddressConfiguration.cs b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/SubnetSharedPublicIpAddressConfiguration.cs deleted file mode 100644 index 611403e7b2e5..000000000000 --- a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/SubnetSharedPublicIpAddressConfiguration.cs +++ /dev/null @@ -1,57 +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.DevTestLabs.Models -{ - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - - /// - /// Configuration for public IP address sharing. - /// - public partial class SubnetSharedPublicIpAddressConfiguration - { - /// - /// Initializes a new instance of the - /// SubnetSharedPublicIpAddressConfiguration class. - /// - public SubnetSharedPublicIpAddressConfiguration() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the - /// SubnetSharedPublicIpAddressConfiguration class. - /// - /// Backend ports that virtual machines on - /// this subnet are allowed to expose - public SubnetSharedPublicIpAddressConfiguration(IList allowedPorts = default(IList)) - { - AllowedPorts = allowedPorts; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets backend ports that virtual machines on this subnet are - /// allowed to expose - /// - [JsonProperty(PropertyName = "allowedPorts")] - public IList AllowedPorts { get; set; } - - } -} diff --git a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/SubnetSharedPublicIpAddressConfigurationFragment.cs b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/SubnetSharedPublicIpAddressConfigurationFragment.cs deleted file mode 100644 index 561d700b10e7..000000000000 --- a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/SubnetSharedPublicIpAddressConfigurationFragment.cs +++ /dev/null @@ -1,57 +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.DevTestLabs.Models -{ - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - - /// - /// Configuration for public IP address sharing. - /// - public partial class SubnetSharedPublicIpAddressConfigurationFragment - { - /// - /// Initializes a new instance of the - /// SubnetSharedPublicIpAddressConfigurationFragment class. - /// - public SubnetSharedPublicIpAddressConfigurationFragment() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the - /// SubnetSharedPublicIpAddressConfigurationFragment class. - /// - /// Backend ports that virtual machines on - /// this subnet are allowed to expose - public SubnetSharedPublicIpAddressConfigurationFragment(IList allowedPorts = default(IList)) - { - AllowedPorts = allowedPorts; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets backend ports that virtual machines on this subnet are - /// allowed to expose - /// - [JsonProperty(PropertyName = "allowedPorts")] - public IList AllowedPorts { get; set; } - - } -} diff --git a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/SystemData.cs b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/SystemData.cs new file mode 100644 index 000000000000..a941a5b651f6 --- /dev/null +++ b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/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.DevTestLabs.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/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/UpdateResource.cs b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/Tags.cs similarity index 65% rename from sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/UpdateResource.cs rename to sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/Tags.cs index b37614587664..ea6631c91608 100644 --- a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/UpdateResource.cs +++ b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/Tags.cs @@ -16,25 +16,25 @@ namespace Microsoft.Azure.Management.DevTestLabs.Models using System.Linq; /// - /// Represents an update resource + /// Resource tags /// - public partial class UpdateResource + public partial class Tags { /// - /// Initializes a new instance of the UpdateResource class. + /// Initializes a new instance of the Tags class. /// - public UpdateResource() + public Tags() { CustomInit(); } /// - /// Initializes a new instance of the UpdateResource class. + /// Initializes a new instance of the Tags class. /// - /// The tags of the resource. - public UpdateResource(IDictionary tags = default(IDictionary)) + /// Resource tags + public Tags(IDictionary tagsProperty = default(IDictionary)) { - Tags = tags; + TagsProperty = tagsProperty; CustomInit(); } @@ -44,10 +44,10 @@ public UpdateResource() partial void CustomInit(); /// - /// Gets or sets the tags of the resource. + /// Gets or sets resource tags /// [JsonProperty(PropertyName = "tags")] - public IDictionary Tags { get; set; } + public IDictionary TagsProperty { get; set; } } } diff --git a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/TargetCostProperties.cs b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/TargetCostProperties.cs deleted file mode 100644 index b873e4154670..000000000000 --- a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/TargetCostProperties.cs +++ /dev/null @@ -1,98 +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.DevTestLabs.Models -{ - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - - /// - /// Properties of a cost target. - /// - public partial class TargetCostProperties - { - /// - /// Initializes a new instance of the TargetCostProperties class. - /// - public TargetCostProperties() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the TargetCostProperties class. - /// - /// Target cost status. Possible values include: - /// 'Enabled', 'Disabled' - /// Lab target cost - /// Cost thresholds. - /// Reporting cycle start - /// date. - /// Reporting cycle end date. - /// Reporting cycle type. Possible values - /// include: 'CalendarMonth', 'Custom' - public TargetCostProperties(string status = default(string), int? target = default(int?), IList costThresholds = default(IList), System.DateTime? cycleStartDateTime = default(System.DateTime?), System.DateTime? cycleEndDateTime = default(System.DateTime?), string cycleType = default(string)) - { - Status = status; - Target = target; - CostThresholds = costThresholds; - CycleStartDateTime = cycleStartDateTime; - CycleEndDateTime = cycleEndDateTime; - CycleType = cycleType; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets target cost status. Possible values include: - /// 'Enabled', 'Disabled' - /// - [JsonProperty(PropertyName = "status")] - public string Status { get; set; } - - /// - /// Gets or sets lab target cost - /// - [JsonProperty(PropertyName = "target")] - public int? Target { get; set; } - - /// - /// Gets or sets cost thresholds. - /// - [JsonProperty(PropertyName = "costThresholds")] - public IList CostThresholds { get; set; } - - /// - /// Gets or sets reporting cycle start date. - /// - [JsonProperty(PropertyName = "cycleStartDateTime")] - public System.DateTime? CycleStartDateTime { get; set; } - - /// - /// Gets or sets reporting cycle end date. - /// - [JsonProperty(PropertyName = "cycleEndDateTime")] - public System.DateTime? CycleEndDateTime { get; set; } - - /// - /// Gets or sets reporting cycle type. Possible values include: - /// 'CalendarMonth', 'Custom' - /// - [JsonProperty(PropertyName = "cycleType")] - public string CycleType { get; set; } - - } -} diff --git a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/TrackedResource.cs b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/TrackedResource.cs new file mode 100644 index 000000000000..ef8b0ae95a54 --- /dev/null +++ b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/TrackedResource.cs @@ -0,0 +1,87 @@ +// +// 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.DevTestLabs.Models +{ + using Microsoft.Rest; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Tracked Resource + /// + /// + /// The resource model definition for an Azure Resource Manager tracked top + /// level resource which has 'tags' and a 'location' + /// + public partial class TrackedResource : Resource + { + /// + /// Initializes a new instance of the TrackedResource class. + /// + public TrackedResource() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the TrackedResource class. + /// + /// The geo-location where the resource + /// lives + /// Fully qualified resource ID for the resource. Ex - + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + /// The name of the resource + /// The type of the resource. E.g. + /// "Microsoft.Compute/virtualMachines" or + /// "Microsoft.Storage/storageAccounts" + /// Resource tags. + public TrackedResource(string location, string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary)) + : base(id, name, type) + { + Tags = tags; + Location = location; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets resource tags. + /// + [JsonProperty(PropertyName = "tags")] + public IDictionary Tags { get; set; } + + /// + /// Gets or sets the geo-location where the resource lives + /// + [JsonProperty(PropertyName = "location")] + public string Location { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (Location == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Location"); + } + } + } +} diff --git a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/User.cs b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/User.cs index 8d3523eaa857..70720d1bcdc9 100644 --- a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/User.cs +++ b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/User.cs @@ -21,7 +21,7 @@ namespace Microsoft.Azure.Management.DevTestLabs.Models /// Profile of a lab user. /// [Rest.Serialization.JsonTransformation] - public partial class User : Resource + public partial class User : TrackedResource { /// /// Initializes a new instance of the User class. @@ -34,27 +34,52 @@ public User() /// /// Initializes a new instance of the User class. /// - /// The identifier of the resource. - /// The name of the resource. - /// The type of the resource. - /// The location of the resource. - /// The tags of the resource. - /// The identity of the user. - /// The secret store of the user. + /// The geo-location where the resource + /// lives + /// Fully qualified resource ID for the resource. Ex - + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + /// The name of the resource + /// The type of the resource. E.g. + /// "Microsoft.Compute/virtualMachines" or + /// "Microsoft.Storage/storageAccounts" + /// Resource tags. + /// Set to the principal name / UPN of the + /// client JWT making the request. + /// Set to the principal Id of the client JWT + /// making the request. Service principal will not have the principal + /// Id. + /// Set to the tenant ID of the client JWT + /// making the request. + /// Set to the object Id of the client JWT + /// making the request. Not all users have object Id. For CSP + /// (reseller) scenarios for example, object Id is not + /// available. + /// Set to the app Id of the client JWT making the + /// request. + /// The URI of the user's Key vault. + /// The ID of the user's Key vault. /// The creation date of the user /// profile. /// The provisioning status of the /// resource. /// The unique immutable identifier of a /// resource (Guid). - public User(string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), UserIdentity identity = default(UserIdentity), UserSecretStore secretStore = default(UserSecretStore), System.DateTime? createdDate = default(System.DateTime?), string provisioningState = default(string), string uniqueIdentifier = default(string)) - : base(id, name, type, location, tags) + /// The system metadata relating to this + /// resource + public User(string location, string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), string principalName = default(string), string principalId = default(string), string tenantId = default(string), string objectId = default(string), string appId = default(string), string keyVaultUri = default(string), string keyVaultId = default(string), System.DateTime? createdDate = default(System.DateTime?), string provisioningState = default(string), string uniqueIdentifier = default(string), SystemData systemData = default(SystemData)) + : base(location, id, name, type, tags) { - Identity = identity; - SecretStore = secretStore; + PrincipalName = principalName; + PrincipalId = principalId; + TenantId = tenantId; + ObjectId = objectId; + AppId = appId; + KeyVaultUri = keyVaultUri; + KeyVaultId = keyVaultId; CreatedDate = createdDate; ProvisioningState = provisioningState; UniqueIdentifier = uniqueIdentifier; + SystemData = systemData; CustomInit(); } @@ -64,16 +89,52 @@ public User() partial void CustomInit(); /// - /// Gets or sets the identity of the user. + /// Gets or sets set to the principal name / UPN of the client JWT + /// making the request. /// - [JsonProperty(PropertyName = "properties.identity")] - public UserIdentity Identity { get; set; } + [JsonProperty(PropertyName = "properties.identity.principalName")] + public string PrincipalName { get; set; } /// - /// Gets or sets the secret store of the user. + /// Gets or sets set to the principal Id of the client JWT making the + /// request. Service principal will not have the principal Id. /// - [JsonProperty(PropertyName = "properties.secretStore")] - public UserSecretStore SecretStore { get; set; } + [JsonProperty(PropertyName = "properties.identity.principalId")] + public string PrincipalId { get; set; } + + /// + /// Gets or sets set to the tenant ID of the client JWT making the + /// request. + /// + [JsonProperty(PropertyName = "properties.identity.tenantId")] + public string TenantId { get; set; } + + /// + /// Gets or sets set to the object Id of the client JWT making the + /// request. Not all users have object Id. For CSP (reseller) scenarios + /// for example, object Id is not available. + /// + [JsonProperty(PropertyName = "properties.identity.objectId")] + public string ObjectId { get; set; } + + /// + /// Gets or sets set to the app Id of the client JWT making the + /// request. + /// + [JsonProperty(PropertyName = "properties.identity.appId")] + public string AppId { get; set; } + + /// + /// Gets or sets the URI of the user's Key vault. + /// + [JsonProperty(PropertyName = "properties.secretStore.keyVaultUri")] + public string KeyVaultUri { get; set; } + + /// + /// Gets or sets the ID of the user's Key vault. + /// + [JsonProperty(PropertyName = "properties.secretStore.keyVaultId")] + public string KeyVaultId { get; set; } /// /// Gets the creation date of the user profile. @@ -93,5 +154,21 @@ public User() [JsonProperty(PropertyName = "properties.uniqueIdentifier")] public string UniqueIdentifier { get; private set; } + /// + /// Gets the system metadata relating to this resource + /// + [JsonProperty(PropertyName = "systemData")] + public SystemData SystemData { get; private set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public override void Validate() + { + base.Validate(); + } } } diff --git a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/UserFragment.cs b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/UserFragment.cs index 9882a2c4c9c4..9d378996a57c 100644 --- a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/UserFragment.cs +++ b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/UserFragment.cs @@ -10,18 +10,14 @@ namespace Microsoft.Azure.Management.DevTestLabs.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; using System.Collections; using System.Collections.Generic; using System.Linq; /// - /// Profile of a lab user. + /// Patch /// - [Rest.Serialization.JsonTransformation] - public partial class UserFragment : UpdateResource + public partial class UserFragment : Tags { /// /// Initializes a new instance of the UserFragment class. @@ -34,14 +30,10 @@ public UserFragment() /// /// Initializes a new instance of the UserFragment class. /// - /// The tags of the resource. - /// The identity of the user. - /// The secret store of the user. - public UserFragment(IDictionary tags = default(IDictionary), UserIdentityFragment identity = default(UserIdentityFragment), UserSecretStoreFragment secretStore = default(UserSecretStoreFragment)) - : base(tags) + /// Resource tags + public UserFragment(IDictionary tagsProperty = default(IDictionary)) + : base(tagsProperty) { - Identity = identity; - SecretStore = secretStore; CustomInit(); } @@ -50,17 +42,5 @@ public UserFragment() /// partial void CustomInit(); - /// - /// Gets or sets the identity of the user. - /// - [JsonProperty(PropertyName = "properties.identity")] - public UserIdentityFragment Identity { get; set; } - - /// - /// Gets or sets the secret store of the user. - /// - [JsonProperty(PropertyName = "properties.secretStore")] - public UserSecretStoreFragment SecretStore { get; set; } - } } diff --git a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/UserIdentity.cs b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/UserIdentity.cs deleted file mode 100644 index 4300315e3bd8..000000000000 --- a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/UserIdentity.cs +++ /dev/null @@ -1,97 +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.DevTestLabs.Models -{ - using Newtonsoft.Json; - using System.Linq; - - /// - /// Identity attributes of a lab user. - /// - public partial class UserIdentity - { - /// - /// Initializes a new instance of the UserIdentity class. - /// - public UserIdentity() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the UserIdentity class. - /// - /// Set to the principal name / UPN of the - /// client JWT making the request. - /// Set to the principal Id of the client JWT - /// making the request. Service principal will not have the principal - /// Id. - /// Set to the tenant ID of the client JWT - /// making the request. - /// Set to the object Id of the client JWT - /// making the request. Not all users have object Id. For CSP - /// (reseller) scenarios for example, object Id is not - /// available. - /// Set to the app Id of the client JWT making the - /// request. - public UserIdentity(string principalName = default(string), string principalId = default(string), string tenantId = default(string), string objectId = default(string), string appId = default(string)) - { - PrincipalName = principalName; - PrincipalId = principalId; - TenantId = tenantId; - ObjectId = objectId; - AppId = appId; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets set to the principal name / UPN of the client JWT - /// making the request. - /// - [JsonProperty(PropertyName = "principalName")] - public string PrincipalName { get; set; } - - /// - /// Gets or sets set to the principal Id of the client JWT making the - /// request. Service principal will not have the principal Id. - /// - [JsonProperty(PropertyName = "principalId")] - public string PrincipalId { get; set; } - - /// - /// Gets or sets set to the tenant ID of the client JWT making the - /// request. - /// - [JsonProperty(PropertyName = "tenantId")] - public string TenantId { get; set; } - - /// - /// Gets or sets set to the object Id of the client JWT making the - /// request. Not all users have object Id. For CSP (reseller) scenarios - /// for example, object Id is not available. - /// - [JsonProperty(PropertyName = "objectId")] - public string ObjectId { get; set; } - - /// - /// Gets or sets set to the app Id of the client JWT making the - /// request. - /// - [JsonProperty(PropertyName = "appId")] - public string AppId { get; set; } - - } -} diff --git a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/UserIdentityFragment.cs b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/UserIdentityFragment.cs deleted file mode 100644 index da124b736c0c..000000000000 --- a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/UserIdentityFragment.cs +++ /dev/null @@ -1,97 +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.DevTestLabs.Models -{ - using Newtonsoft.Json; - using System.Linq; - - /// - /// Identity attributes of a lab user. - /// - public partial class UserIdentityFragment - { - /// - /// Initializes a new instance of the UserIdentityFragment class. - /// - public UserIdentityFragment() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the UserIdentityFragment class. - /// - /// Set to the principal name / UPN of the - /// client JWT making the request. - /// Set to the principal Id of the client JWT - /// making the request. Service principal will not have the principal - /// Id. - /// Set to the tenant ID of the client JWT - /// making the request. - /// Set to the object Id of the client JWT - /// making the request. Not all users have object Id. For CSP - /// (reseller) scenarios for example, object Id is not - /// available. - /// Set to the app Id of the client JWT making the - /// request. - public UserIdentityFragment(string principalName = default(string), string principalId = default(string), string tenantId = default(string), string objectId = default(string), string appId = default(string)) - { - PrincipalName = principalName; - PrincipalId = principalId; - TenantId = tenantId; - ObjectId = objectId; - AppId = appId; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets set to the principal name / UPN of the client JWT - /// making the request. - /// - [JsonProperty(PropertyName = "principalName")] - public string PrincipalName { get; set; } - - /// - /// Gets or sets set to the principal Id of the client JWT making the - /// request. Service principal will not have the principal Id. - /// - [JsonProperty(PropertyName = "principalId")] - public string PrincipalId { get; set; } - - /// - /// Gets or sets set to the tenant ID of the client JWT making the - /// request. - /// - [JsonProperty(PropertyName = "tenantId")] - public string TenantId { get; set; } - - /// - /// Gets or sets set to the object Id of the client JWT making the - /// request. Not all users have object Id. For CSP (reseller) scenarios - /// for example, object Id is not available. - /// - [JsonProperty(PropertyName = "objectId")] - public string ObjectId { get; set; } - - /// - /// Gets or sets set to the app Id of the client JWT making the - /// request. - /// - [JsonProperty(PropertyName = "appId")] - public string AppId { get; set; } - - } -} diff --git a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/UserSecretStore.cs b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/UserSecretStore.cs deleted file mode 100644 index 009e9f5bc1c7..000000000000 --- a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/UserSecretStore.cs +++ /dev/null @@ -1,59 +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.DevTestLabs.Models -{ - using Newtonsoft.Json; - using System.Linq; - - /// - /// Properties of a user's secret store. - /// - public partial class UserSecretStore - { - /// - /// Initializes a new instance of the UserSecretStore class. - /// - public UserSecretStore() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the UserSecretStore class. - /// - /// The URI of the user's Key vault. - /// The ID of the user's Key vault. - public UserSecretStore(string keyVaultUri = default(string), string keyVaultId = default(string)) - { - KeyVaultUri = keyVaultUri; - KeyVaultId = keyVaultId; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the URI of the user's Key vault. - /// - [JsonProperty(PropertyName = "keyVaultUri")] - public string KeyVaultUri { get; set; } - - /// - /// Gets or sets the ID of the user's Key vault. - /// - [JsonProperty(PropertyName = "keyVaultId")] - public string KeyVaultId { get; set; } - - } -} diff --git a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/UserSecretStoreFragment.cs b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/UserSecretStoreFragment.cs deleted file mode 100644 index b0c2bf8da693..000000000000 --- a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/UserSecretStoreFragment.cs +++ /dev/null @@ -1,59 +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.DevTestLabs.Models -{ - using Newtonsoft.Json; - using System.Linq; - - /// - /// Properties of a user's secret store. - /// - public partial class UserSecretStoreFragment - { - /// - /// Initializes a new instance of the UserSecretStoreFragment class. - /// - public UserSecretStoreFragment() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the UserSecretStoreFragment class. - /// - /// The URI of the user's Key vault. - /// The ID of the user's Key vault. - public UserSecretStoreFragment(string keyVaultUri = default(string), string keyVaultId = default(string)) - { - KeyVaultUri = keyVaultUri; - KeyVaultId = keyVaultId; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the URI of the user's Key vault. - /// - [JsonProperty(PropertyName = "keyVaultUri")] - public string KeyVaultUri { get; set; } - - /// - /// Gets or sets the ID of the user's Key vault. - /// - [JsonProperty(PropertyName = "keyVaultId")] - public string KeyVaultId { get; set; } - - } -} diff --git a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/VirtualMachineCreationSource.cs b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/VirtualMachineCreationSource.cs index 4899e4d31fb4..02bfd0b57a8e 100644 --- a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/VirtualMachineCreationSource.cs +++ b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/VirtualMachineCreationSource.cs @@ -18,5 +18,6 @@ public static class VirtualMachineCreationSource { public const string FromCustomImage = "FromCustomImage"; public const string FromGalleryImage = "FromGalleryImage"; + public const string FromSharedGalleryImage = "FromSharedGalleryImage"; } } diff --git a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/VirtualNetwork.cs b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/VirtualNetwork.cs index 59fe1a1ae8e7..83d1e7f69a3c 100644 --- a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/VirtualNetwork.cs +++ b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/VirtualNetwork.cs @@ -21,7 +21,7 @@ namespace Microsoft.Azure.Management.DevTestLabs.Models /// A virtual network. /// [Rest.Serialization.JsonTransformation] - public partial class VirtualNetwork : Resource + public partial class VirtualNetwork : TrackedResource { /// /// Initializes a new instance of the VirtualNetwork class. @@ -34,11 +34,15 @@ public VirtualNetwork() /// /// Initializes a new instance of the VirtualNetwork class. /// - /// The identifier of the resource. - /// The name of the resource. - /// The type of the resource. - /// The location of the resource. - /// The tags of the resource. + /// The geo-location where the resource + /// lives + /// Fully qualified resource ID for the resource. Ex - + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + /// The name of the resource + /// The type of the resource. E.g. + /// "Microsoft.Compute/virtualMachines" or + /// "Microsoft.Storage/storageAccounts" + /// Resource tags. /// The allowed subnets of the virtual /// network. /// The description of the virtual @@ -55,8 +59,10 @@ public VirtualNetwork() /// resource. /// The unique immutable identifier of a /// resource (Guid). - public VirtualNetwork(string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), IList allowedSubnets = default(IList), string description = default(string), string externalProviderResourceId = default(string), IList externalSubnets = default(IList), IList subnetOverrides = default(IList), System.DateTime? createdDate = default(System.DateTime?), string provisioningState = default(string), string uniqueIdentifier = default(string)) - : base(id, name, type, location, tags) + /// The system metadata relating to this + /// resource + public VirtualNetwork(string location, string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), IList allowedSubnets = default(IList), string description = default(string), string externalProviderResourceId = default(string), IList externalSubnets = default(IList), IList subnetOverrides = default(IList), System.DateTime? createdDate = default(System.DateTime?), string provisioningState = default(string), string uniqueIdentifier = default(string), SystemData systemData = default(SystemData)) + : base(location, id, name, type, tags) { AllowedSubnets = allowedSubnets; Description = description; @@ -66,6 +72,7 @@ public VirtualNetwork() CreatedDate = createdDate; ProvisioningState = provisioningState; UniqueIdentifier = uniqueIdentifier; + SystemData = systemData; CustomInit(); } @@ -123,5 +130,21 @@ public VirtualNetwork() [JsonProperty(PropertyName = "properties.uniqueIdentifier")] public string UniqueIdentifier { get; private set; } + /// + /// Gets the system metadata relating to this resource + /// + [JsonProperty(PropertyName = "systemData")] + public SystemData SystemData { get; private set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public override void Validate() + { + base.Validate(); + } } } diff --git a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/VirtualNetworkFragment.cs b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/VirtualNetworkFragment.cs index 57dfabe0840f..47e60382efb0 100644 --- a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/VirtualNetworkFragment.cs +++ b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/VirtualNetworkFragment.cs @@ -10,18 +10,14 @@ namespace Microsoft.Azure.Management.DevTestLabs.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; using System.Collections; using System.Collections.Generic; using System.Linq; /// - /// A virtual network. + /// Patch /// - [Rest.Serialization.JsonTransformation] - public partial class VirtualNetworkFragment : UpdateResource + public partial class VirtualNetworkFragment : Tags { /// /// Initializes a new instance of the VirtualNetworkFragment class. @@ -34,22 +30,10 @@ public VirtualNetworkFragment() /// /// Initializes a new instance of the VirtualNetworkFragment class. /// - /// The tags of the resource. - /// The allowed subnets of the virtual - /// network. - /// The description of the virtual - /// network. - /// The Microsoft.Network - /// resource identifier of the virtual network. - /// The subnet overrides of the virtual - /// network. - public VirtualNetworkFragment(IDictionary tags = default(IDictionary), IList allowedSubnets = default(IList), string description = default(string), string externalProviderResourceId = default(string), IList subnetOverrides = default(IList)) - : base(tags) + /// Resource tags + public VirtualNetworkFragment(IDictionary tagsProperty = default(IDictionary)) + : base(tagsProperty) { - AllowedSubnets = allowedSubnets; - Description = description; - ExternalProviderResourceId = externalProviderResourceId; - SubnetOverrides = subnetOverrides; CustomInit(); } @@ -58,30 +42,5 @@ public VirtualNetworkFragment() /// partial void CustomInit(); - /// - /// Gets or sets the allowed subnets of the virtual network. - /// - [JsonProperty(PropertyName = "properties.allowedSubnets")] - public IList AllowedSubnets { get; set; } - - /// - /// Gets or sets the description of the virtual network. - /// - [JsonProperty(PropertyName = "properties.description")] - public string Description { get; set; } - - /// - /// Gets or sets the Microsoft.Network resource identifier of the - /// virtual network. - /// - [JsonProperty(PropertyName = "properties.externalProviderResourceId")] - public string ExternalProviderResourceId { get; set; } - - /// - /// Gets or sets the subnet overrides of the virtual network. - /// - [JsonProperty(PropertyName = "properties.subnetOverrides")] - public IList SubnetOverrides { get; set; } - } } diff --git a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/WeekDetails.cs b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/WeekDetails.cs deleted file mode 100644 index 528ecce78b17..000000000000 --- a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/WeekDetails.cs +++ /dev/null @@ -1,64 +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.DevTestLabs.Models -{ - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - - /// - /// Properties of a weekly schedule. - /// - public partial class WeekDetails - { - /// - /// Initializes a new instance of the WeekDetails class. - /// - public WeekDetails() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the WeekDetails class. - /// - /// The days of the week for which the schedule - /// is set (e.g. Sunday, Monday, Tuesday, etc.). - /// The time of the day the schedule will - /// occur. - public WeekDetails(IList weekdays = default(IList), string time = default(string)) - { - Weekdays = weekdays; - Time = time; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the days of the week for which the schedule is set - /// (e.g. Sunday, Monday, Tuesday, etc.). - /// - [JsonProperty(PropertyName = "weekdays")] - public IList Weekdays { get; set; } - - /// - /// Gets or sets the time of the day the schedule will occur. - /// - [JsonProperty(PropertyName = "time")] - public string Time { get; set; } - - } -} diff --git a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/WindowsOsInfo.cs b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/WindowsOsInfo.cs deleted file mode 100644 index ecd2c48d18eb..000000000000 --- a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/WindowsOsInfo.cs +++ /dev/null @@ -1,56 +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.DevTestLabs.Models -{ - using Newtonsoft.Json; - using System.Linq; - - /// - /// Information about a Windows OS. - /// - public partial class WindowsOsInfo - { - /// - /// Initializes a new instance of the WindowsOsInfo class. - /// - public WindowsOsInfo() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the WindowsOsInfo class. - /// - /// The state of the Windows OS (i.e. - /// NonSysprepped, SysprepRequested, SysprepApplied). Possible values - /// include: 'NonSysprepped', 'SysprepRequested', - /// 'SysprepApplied' - public WindowsOsInfo(string windowsOsState = default(string)) - { - WindowsOsState = windowsOsState; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the state of the Windows OS (i.e. NonSysprepped, - /// SysprepRequested, SysprepApplied). Possible values include: - /// 'NonSysprepped', 'SysprepRequested', 'SysprepApplied' - /// - [JsonProperty(PropertyName = "windowsOsState")] - public string WindowsOsState { get; set; } - - } -} diff --git a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/WindowsOsInfoFragment.cs b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/WindowsOsInfoFragment.cs deleted file mode 100644 index 90e4e3199297..000000000000 --- a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Models/WindowsOsInfoFragment.cs +++ /dev/null @@ -1,56 +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.DevTestLabs.Models -{ - using Newtonsoft.Json; - using System.Linq; - - /// - /// Information about a Windows OS. - /// - public partial class WindowsOsInfoFragment - { - /// - /// Initializes a new instance of the WindowsOsInfoFragment class. - /// - public WindowsOsInfoFragment() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the WindowsOsInfoFragment class. - /// - /// The state of the Windows OS (i.e. - /// NonSysprepped, SysprepRequested, SysprepApplied). Possible values - /// include: 'NonSysprepped', 'SysprepRequested', - /// 'SysprepApplied' - public WindowsOsInfoFragment(string windowsOsState = default(string)) - { - WindowsOsState = windowsOsState; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the state of the Windows OS (i.e. NonSysprepped, - /// SysprepRequested, SysprepApplied). Possible values include: - /// 'NonSysprepped', 'SysprepRequested', 'SysprepApplied' - /// - [JsonProperty(PropertyName = "windowsOsState")] - public string WindowsOsState { get; set; } - - } -} diff --git a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/NotificationChannelsOperations.cs b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/NotificationChannelsOperations.cs index 6ae26e6c6117..bb174388060e 100644 --- a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/NotificationChannelsOperations.cs +++ b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/NotificationChannelsOperations.cs @@ -52,7 +52,7 @@ internal NotificationChannelsOperations(DevTestLabsClient client) public DevTestLabsClient Client { get; private set; } /// - /// List notificationchannels in a given lab. + /// List notification channels in a given lab. /// /// /// The name of the resource group. @@ -260,7 +260,7 @@ internal NotificationChannelsOperations(DevTestLabsClient client) } /// - /// Get notificationchannel. + /// Get notification channel. /// /// /// The name of the resource group. @@ -269,10 +269,7 @@ internal NotificationChannelsOperations(DevTestLabsClient client) /// The name of the lab. /// /// - /// The name of the notificationChannel. - /// - /// - /// Specify the $expand query. Example: 'properties($select=webHookUrl)' + /// The name of the notification channel. /// /// /// Headers that will be added to request. @@ -295,7 +292,7 @@ internal NotificationChannelsOperations(DevTestLabsClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string labName, string name, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string labName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (Client.SubscriptionId == null) { @@ -327,7 +324,6 @@ internal NotificationChannelsOperations(DevTestLabsClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("labName", labName); tracingParameters.Add("name", name); - tracingParameters.Add("expand", expand); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } @@ -339,10 +335,6 @@ internal NotificationChannelsOperations(DevTestLabsClient client) _url = _url.Replace("{labName}", System.Uri.EscapeDataString(labName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); List _queryParameters = new List(); - if (expand != null) - { - _queryParameters.Add(string.Format("$expand={0}", System.Uri.EscapeDataString(expand))); - } if (Client.ApiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); @@ -473,7 +465,7 @@ internal NotificationChannelsOperations(DevTestLabsClient client) } /// - /// Create or replace an existing notificationChannel. + /// Create or replace an existing Notification Channel. /// /// /// The name of the resource group. @@ -482,7 +474,7 @@ internal NotificationChannelsOperations(DevTestLabsClient client) /// The name of the lab. /// /// - /// The name of the notificationChannel. + /// The name of the notification channel. /// /// /// A notification. @@ -530,6 +522,10 @@ internal NotificationChannelsOperations(DevTestLabsClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "notificationChannel"); } + if (notificationChannel != null) + { + notificationChannel.Validate(); + } if (Client.ApiVersion == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); @@ -710,7 +706,7 @@ internal NotificationChannelsOperations(DevTestLabsClient client) } /// - /// Delete notificationchannel. + /// Delete notification channel. /// /// /// The name of the resource group. @@ -719,7 +715,7 @@ internal NotificationChannelsOperations(DevTestLabsClient client) /// The name of the lab. /// /// - /// The name of the notificationChannel. + /// The name of the notification channel. /// /// /// Headers that will be added to request. @@ -894,7 +890,8 @@ internal NotificationChannelsOperations(DevTestLabsClient client) } /// - /// Modify properties of notificationchannels. + /// Allows modifying tags of notification channels. All other properties will + /// be ignored. /// /// /// The name of the resource group. @@ -903,10 +900,11 @@ internal NotificationChannelsOperations(DevTestLabsClient client) /// The name of the lab. /// /// - /// The name of the notificationChannel. + /// The name of the notification channel. /// /// - /// A notification. + /// Allows modifying tags of notification channels. All other properties will + /// be ignored. /// /// /// Headers that will be added to request. @@ -1122,7 +1120,7 @@ internal NotificationChannelsOperations(DevTestLabsClient client) /// The name of the lab. /// /// - /// The name of the notificationChannel. + /// The name of the notification channel. /// /// /// Properties for generating a Notification. @@ -1311,7 +1309,7 @@ internal NotificationChannelsOperations(DevTestLabsClient client) } /// - /// List notificationchannels in a given lab. + /// List notification channels in a given lab. /// /// /// The NextLink from the previous successful call to List operation. diff --git a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/NotificationChannelsOperationsExtensions.cs b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/NotificationChannelsOperationsExtensions.cs index 064d2cd4251e..9c11f650521a 100644 --- a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/NotificationChannelsOperationsExtensions.cs +++ b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/NotificationChannelsOperationsExtensions.cs @@ -23,7 +23,7 @@ namespace Microsoft.Azure.Management.DevTestLabs public static partial class NotificationChannelsOperationsExtensions { /// - /// List notificationchannels in a given lab. + /// List notification channels in a given lab. /// /// /// The operations group for this extension method. @@ -43,7 +43,7 @@ public static partial class NotificationChannelsOperationsExtensions } /// - /// List notificationchannels in a given lab. + /// List notification channels in a given lab. /// /// /// The operations group for this extension method. @@ -69,7 +69,7 @@ public static partial class NotificationChannelsOperationsExtensions } /// - /// Get notificationchannel. + /// Get notification channel. /// /// /// The operations group for this extension method. @@ -81,18 +81,15 @@ public static partial class NotificationChannelsOperationsExtensions /// The name of the lab. /// /// - /// The name of the notificationChannel. + /// The name of the notification channel. /// - /// - /// Specify the $expand query. Example: 'properties($select=webHookUrl)' - /// - public static NotificationChannel Get(this INotificationChannelsOperations operations, string resourceGroupName, string labName, string name, string expand = default(string)) + public static NotificationChannel Get(this INotificationChannelsOperations operations, string resourceGroupName, string labName, string name) { - return operations.GetAsync(resourceGroupName, labName, name, expand).GetAwaiter().GetResult(); + return operations.GetAsync(resourceGroupName, labName, name).GetAwaiter().GetResult(); } /// - /// Get notificationchannel. + /// Get notification channel. /// /// /// The operations group for this extension method. @@ -104,24 +101,21 @@ public static partial class NotificationChannelsOperationsExtensions /// The name of the lab. /// /// - /// The name of the notificationChannel. - /// - /// - /// Specify the $expand query. Example: 'properties($select=webHookUrl)' + /// The name of the notification channel. /// /// /// The cancellation token. /// - public static async Task GetAsync(this INotificationChannelsOperations operations, string resourceGroupName, string labName, string name, string expand = default(string), CancellationToken cancellationToken = default(CancellationToken)) + public static async Task GetAsync(this INotificationChannelsOperations operations, string resourceGroupName, string labName, string name, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, labName, name, expand, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, labName, name, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Create or replace an existing notificationChannel. + /// Create or replace an existing Notification Channel. /// /// /// The operations group for this extension method. @@ -133,7 +127,7 @@ public static partial class NotificationChannelsOperationsExtensions /// The name of the lab. /// /// - /// The name of the notificationChannel. + /// The name of the notification channel. /// /// /// A notification. @@ -144,7 +138,7 @@ public static NotificationChannel CreateOrUpdate(this INotificationChannelsOpera } /// - /// Create or replace an existing notificationChannel. + /// Create or replace an existing Notification Channel. /// /// /// The operations group for this extension method. @@ -156,7 +150,7 @@ public static NotificationChannel CreateOrUpdate(this INotificationChannelsOpera /// The name of the lab. /// /// - /// The name of the notificationChannel. + /// The name of the notification channel. /// /// /// A notification. @@ -173,7 +167,7 @@ public static NotificationChannel CreateOrUpdate(this INotificationChannelsOpera } /// - /// Delete notificationchannel. + /// Delete notification channel. /// /// /// The operations group for this extension method. @@ -185,7 +179,7 @@ public static NotificationChannel CreateOrUpdate(this INotificationChannelsOpera /// The name of the lab. /// /// - /// The name of the notificationChannel. + /// The name of the notification channel. /// public static void Delete(this INotificationChannelsOperations operations, string resourceGroupName, string labName, string name) { @@ -193,7 +187,7 @@ public static void Delete(this INotificationChannelsOperations operations, strin } /// - /// Delete notificationchannel. + /// Delete notification channel. /// /// /// The operations group for this extension method. @@ -205,7 +199,7 @@ public static void Delete(this INotificationChannelsOperations operations, strin /// The name of the lab. /// /// - /// The name of the notificationChannel. + /// The name of the notification channel. /// /// /// The cancellation token. @@ -216,7 +210,8 @@ public static void Delete(this INotificationChannelsOperations operations, strin } /// - /// Modify properties of notificationchannels. + /// Allows modifying tags of notification channels. All other properties will + /// be ignored. /// /// /// The operations group for this extension method. @@ -228,10 +223,11 @@ public static void Delete(this INotificationChannelsOperations operations, strin /// The name of the lab. /// /// - /// The name of the notificationChannel. + /// The name of the notification channel. /// /// - /// A notification. + /// Allows modifying tags of notification channels. All other properties will + /// be ignored. /// public static NotificationChannel Update(this INotificationChannelsOperations operations, string resourceGroupName, string labName, string name, NotificationChannelFragment notificationChannel) { @@ -239,7 +235,8 @@ public static NotificationChannel Update(this INotificationChannelsOperations op } /// - /// Modify properties of notificationchannels. + /// Allows modifying tags of notification channels. All other properties will + /// be ignored. /// /// /// The operations group for this extension method. @@ -251,10 +248,11 @@ public static NotificationChannel Update(this INotificationChannelsOperations op /// The name of the lab. /// /// - /// The name of the notificationChannel. + /// The name of the notification channel. /// /// - /// A notification. + /// Allows modifying tags of notification channels. All other properties will + /// be ignored. /// /// /// The cancellation token. @@ -280,7 +278,7 @@ public static NotificationChannel Update(this INotificationChannelsOperations op /// The name of the lab. /// /// - /// The name of the notificationChannel. + /// The name of the notification channel. /// /// /// Properties for generating a Notification. @@ -303,7 +301,7 @@ public static void Notify(this INotificationChannelsOperations operations, strin /// The name of the lab. /// /// - /// The name of the notificationChannel. + /// The name of the notification channel. /// /// /// Properties for generating a Notification. @@ -317,7 +315,7 @@ public static void Notify(this INotificationChannelsOperations operations, strin } /// - /// List notificationchannels in a given lab. + /// List notification channels in a given lab. /// /// /// The operations group for this extension method. @@ -331,7 +329,7 @@ public static IPage ListNext(this INotificationChannelsOper } /// - /// List notificationchannels in a given lab. + /// List notification channels in a given lab. /// /// /// The operations group for this extension method. diff --git a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Operations.cs b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Operations.cs index 3b0bae030203..6cf05310b762 100644 --- a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Operations.cs +++ b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/Operations.cs @@ -94,6 +94,13 @@ internal Operations(DevTestLabsClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } + if (name != null) + { + if (name.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "name", 1); + } + } if (Client.ApiVersion == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); diff --git a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/PoliciesOperations.cs b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/PoliciesOperations.cs index 74fafef9a6ed..9d5526bf2841 100644 --- a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/PoliciesOperations.cs +++ b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/PoliciesOperations.cs @@ -283,9 +283,6 @@ internal PoliciesOperations(DevTestLabsClient client) /// /// The name of the policy. /// - /// - /// Specify the $expand query. Example: 'properties($select=description)' - /// /// /// Headers that will be added to request. /// @@ -307,7 +304,7 @@ internal PoliciesOperations(DevTestLabsClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string labName, string policySetName, string name, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string labName, string policySetName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (Client.SubscriptionId == null) { @@ -344,7 +341,6 @@ internal PoliciesOperations(DevTestLabsClient client) tracingParameters.Add("labName", labName); tracingParameters.Add("policySetName", policySetName); tracingParameters.Add("name", name); - tracingParameters.Add("expand", expand); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } @@ -357,10 +353,6 @@ internal PoliciesOperations(DevTestLabsClient client) _url = _url.Replace("{policySetName}", System.Uri.EscapeDataString(policySetName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); List _queryParameters = new List(); - if (expand != null) - { - _queryParameters.Add(string.Format("$expand={0}", System.Uri.EscapeDataString(expand))); - } if (Client.ApiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); @@ -555,6 +547,10 @@ internal PoliciesOperations(DevTestLabsClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "policy"); } + if (policy != null) + { + policy.Validate(); + } if (Client.ApiVersion == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); @@ -930,7 +926,7 @@ internal PoliciesOperations(DevTestLabsClient client) } /// - /// Modify properties of policies. + /// Allows modifying tags of policies. All other properties will be ignored. /// /// /// The name of the resource group. @@ -945,7 +941,7 @@ internal PoliciesOperations(DevTestLabsClient client) /// The name of the policy. /// /// - /// A Policy. + /// Allows modifying tags of policies. All other properties will be ignored. /// /// /// Headers that will be added to request. diff --git a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/PoliciesOperationsExtensions.cs b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/PoliciesOperationsExtensions.cs index 6723927d73ae..154f7cdeb64b 100644 --- a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/PoliciesOperationsExtensions.cs +++ b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/PoliciesOperationsExtensions.cs @@ -92,12 +92,9 @@ public static partial class PoliciesOperationsExtensions /// /// The name of the policy. /// - /// - /// Specify the $expand query. Example: 'properties($select=description)' - /// - public static Policy Get(this IPoliciesOperations operations, string resourceGroupName, string labName, string policySetName, string name, string expand = default(string)) + public static Policy Get(this IPoliciesOperations operations, string resourceGroupName, string labName, string policySetName, string name) { - return operations.GetAsync(resourceGroupName, labName, policySetName, name, expand).GetAwaiter().GetResult(); + return operations.GetAsync(resourceGroupName, labName, policySetName, name).GetAwaiter().GetResult(); } /// @@ -118,15 +115,12 @@ public static partial class PoliciesOperationsExtensions /// /// The name of the policy. /// - /// - /// Specify the $expand query. Example: 'properties($select=description)' - /// /// /// The cancellation token. /// - public static async Task GetAsync(this IPoliciesOperations operations, string resourceGroupName, string labName, string policySetName, string name, string expand = default(string), CancellationToken cancellationToken = default(CancellationToken)) + public static async Task GetAsync(this IPoliciesOperations operations, string resourceGroupName, string labName, string policySetName, string name, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, labName, policySetName, name, expand, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, labName, policySetName, name, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } @@ -240,7 +234,7 @@ public static void Delete(this IPoliciesOperations operations, string resourceGr } /// - /// Modify properties of policies. + /// Allows modifying tags of policies. All other properties will be ignored. /// /// /// The operations group for this extension method. @@ -258,7 +252,7 @@ public static void Delete(this IPoliciesOperations operations, string resourceGr /// The name of the policy. /// /// - /// A Policy. + /// Allows modifying tags of policies. All other properties will be ignored. /// public static Policy Update(this IPoliciesOperations operations, string resourceGroupName, string labName, string policySetName, string name, PolicyFragment policy) { @@ -266,7 +260,7 @@ public static Policy Update(this IPoliciesOperations operations, string resource } /// - /// Modify properties of policies. + /// Allows modifying tags of policies. All other properties will be ignored. /// /// /// The operations group for this extension method. @@ -284,7 +278,7 @@ public static Policy Update(this IPoliciesOperations operations, string resource /// The name of the policy. /// /// - /// A Policy. + /// Allows modifying tags of policies. All other properties will be ignored. /// /// /// The cancellation token. diff --git a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/PolicySetsOperations.cs b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/PolicySetsOperations.cs index 49dfadb1381d..d9a4f308471f 100644 --- a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/PolicySetsOperations.cs +++ b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/PolicySetsOperations.cs @@ -12,6 +12,7 @@ namespace Microsoft.Azure.Management.DevTestLabs { using Microsoft.Rest; using Microsoft.Rest.Azure; + using Microsoft.Rest.Azure.OData; using Models; using Newtonsoft.Json; using System.Collections; @@ -50,6 +51,214 @@ internal PolicySetsOperations(DevTestLabsClient client) /// public DevTestLabsClient Client { get; private set; } + /// + /// List policy sets in a given lab. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the lab. + /// + /// + /// OData parameters to apply to the 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>> ListWithHttpMessagesAsync(string resourceGroupName, string labName, ODataQuery odataQuery = default(ODataQuery), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (labName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "labName"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("odataQuery", odataQuery); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("labName", labName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/policysets").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{labName}", System.Uri.EscapeDataString(labName)); + List _queryParameters = new List(); + if (odataQuery != null) + { + var _odataFilter = odataQuery.ToString(); + if (!string.IsNullOrEmpty(_odataFilter)) + { + _queryParameters.Add(_odataFilter); + } + } + 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); + } + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + 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); + } + _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; + } + /// /// Evaluates lab policy. /// @@ -269,5 +478,178 @@ internal PolicySetsOperations(DevTestLabsClient client) return _result; } + /// + /// List policy sets in a given lab. + /// + /// + /// 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>> ListNextWithHttpMessagesAsync(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, "ListNext", 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); + } + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + 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); + } + _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; + } + } } diff --git a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/PolicySetsOperationsExtensions.cs b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/PolicySetsOperationsExtensions.cs index 1139c6158a57..4d63c474204f 100644 --- a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/PolicySetsOperationsExtensions.cs +++ b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/PolicySetsOperationsExtensions.cs @@ -12,6 +12,7 @@ namespace Microsoft.Azure.Management.DevTestLabs { using Microsoft.Rest; using Microsoft.Rest.Azure; + using Microsoft.Rest.Azure.OData; using Models; using System.Threading; using System.Threading.Tasks; @@ -21,6 +22,52 @@ namespace Microsoft.Azure.Management.DevTestLabs /// public static partial class PolicySetsOperationsExtensions { + /// + /// List policy sets in a given lab. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the lab. + /// + /// + /// OData parameters to apply to the operation. + /// + public static IPage List(this IPolicySetsOperations operations, string resourceGroupName, string labName, ODataQuery odataQuery = default(ODataQuery)) + { + return operations.ListAsync(resourceGroupName, labName, odataQuery).GetAwaiter().GetResult(); + } + + /// + /// List policy sets in a given lab. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the lab. + /// + /// + /// OData parameters to apply to the operation. + /// + /// + /// The cancellation token. + /// + public static async Task> ListAsync(this IPolicySetsOperations operations, string resourceGroupName, string labName, ODataQuery odataQuery = default(ODataQuery), CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, labName, odataQuery, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// /// Evaluates lab policy. /// @@ -73,5 +120,39 @@ public static EvaluatePoliciesResponse EvaluatePolicies(this IPolicySetsOperatio } } + /// + /// List policy sets in a given lab. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage ListNext(this IPolicySetsOperations operations, string nextPageLink) + { + return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// List policy sets in a given lab. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async Task> ListNextAsync(this IPolicySetsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + } } diff --git a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/SchedulesOperations.cs b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/SchedulesOperations.cs index 255af83eae5a..c79db4f1e49c 100644 --- a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/SchedulesOperations.cs +++ b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/SchedulesOperations.cs @@ -271,9 +271,6 @@ internal SchedulesOperations(DevTestLabsClient client) /// /// The name of the schedule. /// - /// - /// Specify the $expand query. Example: 'properties($select=status)' - /// /// /// Headers that will be added to request. /// @@ -295,7 +292,7 @@ internal SchedulesOperations(DevTestLabsClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string labName, string name, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string labName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (Client.SubscriptionId == null) { @@ -327,7 +324,6 @@ internal SchedulesOperations(DevTestLabsClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("labName", labName); tracingParameters.Add("name", name); - tracingParameters.Add("expand", expand); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } @@ -339,10 +335,6 @@ internal SchedulesOperations(DevTestLabsClient client) _url = _url.Replace("{labName}", System.Uri.EscapeDataString(labName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); List _queryParameters = new List(); - if (expand != null) - { - _queryParameters.Add(string.Format("$expand={0}", System.Uri.EscapeDataString(expand))); - } if (Client.ApiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); @@ -530,6 +522,10 @@ internal SchedulesOperations(DevTestLabsClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "schedule"); } + if (schedule != null) + { + schedule.Validate(); + } if (Client.ApiVersion == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); @@ -894,7 +890,7 @@ internal SchedulesOperations(DevTestLabsClient client) } /// - /// Modify properties of schedules. + /// Allows modifying tags of schedules. All other properties will be ignored. /// /// /// The name of the resource group. @@ -906,7 +902,7 @@ internal SchedulesOperations(DevTestLabsClient client) /// The name of the schedule. /// /// - /// A schedule. + /// Allows modifying tags of schedules. All other properties will be ignored. /// /// /// Headers that will be added to request. diff --git a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/SchedulesOperationsExtensions.cs b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/SchedulesOperationsExtensions.cs index 6e9842798bf7..13260235f81f 100644 --- a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/SchedulesOperationsExtensions.cs +++ b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/SchedulesOperationsExtensions.cs @@ -83,12 +83,9 @@ public static partial class SchedulesOperationsExtensions /// /// The name of the schedule. /// - /// - /// Specify the $expand query. Example: 'properties($select=status)' - /// - public static Schedule Get(this ISchedulesOperations operations, string resourceGroupName, string labName, string name, string expand = default(string)) + public static Schedule Get(this ISchedulesOperations operations, string resourceGroupName, string labName, string name) { - return operations.GetAsync(resourceGroupName, labName, name, expand).GetAwaiter().GetResult(); + return operations.GetAsync(resourceGroupName, labName, name).GetAwaiter().GetResult(); } /// @@ -106,15 +103,12 @@ public static partial class SchedulesOperationsExtensions /// /// The name of the schedule. /// - /// - /// Specify the $expand query. Example: 'properties($select=status)' - /// /// /// The cancellation token. /// - public static async Task GetAsync(this ISchedulesOperations operations, string resourceGroupName, string labName, string name, string expand = default(string), CancellationToken cancellationToken = default(CancellationToken)) + public static async Task GetAsync(this ISchedulesOperations operations, string resourceGroupName, string labName, string name, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, labName, name, expand, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, labName, name, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } @@ -216,7 +210,7 @@ public static void Delete(this ISchedulesOperations operations, string resourceG } /// - /// Modify properties of schedules. + /// Allows modifying tags of schedules. All other properties will be ignored. /// /// /// The operations group for this extension method. @@ -231,7 +225,7 @@ public static void Delete(this ISchedulesOperations operations, string resourceG /// The name of the schedule. /// /// - /// A schedule. + /// Allows modifying tags of schedules. All other properties will be ignored. /// public static Schedule Update(this ISchedulesOperations operations, string resourceGroupName, string labName, string name, ScheduleFragment schedule) { @@ -239,7 +233,7 @@ public static Schedule Update(this ISchedulesOperations operations, string resou } /// - /// Modify properties of schedules. + /// Allows modifying tags of schedules. All other properties will be ignored. /// /// /// The operations group for this extension method. @@ -254,7 +248,7 @@ public static Schedule Update(this ISchedulesOperations operations, string resou /// The name of the schedule. /// /// - /// A schedule. + /// Allows modifying tags of schedules. All other properties will be ignored. /// /// /// The cancellation token. diff --git a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/SdkInfo_DevTestLabsClient.cs b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/SdkInfo_DevTestLabsClient.cs index 312a8fda9e91..223c86b5abef 100644 --- a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/SdkInfo_DevTestLabsClient.cs +++ b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/SdkInfo_DevTestLabsClient.cs @@ -19,44 +19,37 @@ public static IEnumerable> ApiInfo_DevTestLabsClie { return new Tuple[] { - new Tuple("DevTestLab", "ArmTemplates", "2018-09-15"), - new Tuple("DevTestLab", "ArtifactSources", "2018-09-15"), - new Tuple("DevTestLab", "Artifacts", "2018-09-15"), - new Tuple("DevTestLab", "Costs", "2018-09-15"), - new Tuple("DevTestLab", "CustomImages", "2018-09-15"), - new Tuple("DevTestLab", "Disks", "2018-09-15"), - new Tuple("DevTestLab", "Environments", "2018-09-15"), - new Tuple("DevTestLab", "Formulas", "2018-09-15"), - new Tuple("DevTestLab", "GalleryImages", "2018-09-15"), - new Tuple("DevTestLab", "GlobalSchedules", "2018-09-15"), - new Tuple("DevTestLab", "Labs", "2018-09-15"), - new Tuple("DevTestLab", "NotificationChannels", "2018-09-15"), - new Tuple("DevTestLab", "Operations", "2018-09-15"), - new Tuple("DevTestLab", "Policies", "2018-09-15"), - new Tuple("DevTestLab", "PolicySets", "2018-09-15"), - new Tuple("DevTestLab", "ProviderOperations", "2018-09-15"), - new Tuple("DevTestLab", "Schedules", "2018-09-15"), - new Tuple("DevTestLab", "Secrets", "2018-09-15"), - new Tuple("DevTestLab", "ServiceFabricSchedules", "2018-09-15"), - new Tuple("DevTestLab", "ServiceFabrics", "2018-09-15"), - new Tuple("DevTestLab", "ServiceRunners", "2018-09-15"), - new Tuple("DevTestLab", "Users", "2018-09-15"), - new Tuple("DevTestLab", "VirtualMachineSchedules", "2018-09-15"), - new Tuple("DevTestLab", "VirtualMachines", "2018-09-15"), - new Tuple("DevTestLab", "VirtualNetworks", "2018-09-15"), + new Tuple("DevTestLab", "ArmTemplates", "2021-09-01"), + new Tuple("DevTestLab", "ArtifactSources", "2021-09-01"), + new Tuple("DevTestLab", "Artifacts", "2021-09-01"), + new Tuple("DevTestLab", "BastionHosts", "2021-09-01"), + new Tuple("DevTestLab", "Costs", "2021-09-01"), + new Tuple("DevTestLab", "CustomImages", "2021-09-01"), + new Tuple("DevTestLab", "Disks", "2021-09-01"), + new Tuple("DevTestLab", "Environments", "2021-09-01"), + new Tuple("DevTestLab", "Formulas", "2021-09-01"), + new Tuple("DevTestLab", "GalleryImages", "2021-09-01"), + new Tuple("DevTestLab", "GlobalSchedules", "2021-09-01"), + new Tuple("DevTestLab", "LabSecrets", "2021-09-01"), + new Tuple("DevTestLab", "Labs", "2021-09-01"), + new Tuple("DevTestLab", "NotificationChannels", "2021-09-01"), + new Tuple("DevTestLab", "Operations", "2021-09-01"), + new Tuple("DevTestLab", "Policies", "2021-09-01"), + new Tuple("DevTestLab", "PolicySets", "2021-09-01"), + new Tuple("DevTestLab", "ProviderOperations", "2021-09-01"), + new Tuple("DevTestLab", "Schedules", "2021-09-01"), + new Tuple("DevTestLab", "Secrets", "2021-09-01"), + new Tuple("DevTestLab", "ServiceFabricSchedules", "2021-09-01"), + new Tuple("DevTestLab", "ServiceFabrics", "2021-09-01"), + new Tuple("DevTestLab", "ServiceRunners", "2021-09-01"), + new Tuple("DevTestLab", "SharedGalleries", "2021-09-01"), + new Tuple("DevTestLab", "SharedImages", "2021-09-01"), + new Tuple("DevTestLab", "Users", "2021-09-01"), + new Tuple("DevTestLab", "VirtualMachineSchedules", "2021-09-01"), + new Tuple("DevTestLab", "VirtualMachines", "2021-09-01"), + new Tuple("DevTestLab", "VirtualNetworks", "2021-09-01"), }.AsEnumerable(); } } - // BEGIN: Code Generation Metadata Section - public static readonly String AutoRestVersion = "latest"; - public static readonly String AutoRestBootStrapperVersion = "autorest@2.0.4283"; - public static readonly String AutoRestCmdExecuted = "cmd.exe /c autorest.cmd https://github.com/Azure/azure-rest-api-specs/blob/master/specification/devtestlabs/resource-manager/readme.md --csharp --version=latest --reflect-api-versions --csharp-sdks-folder=C:\\repos\\azure-sdk-for-net\\src\\SDKs"; - public static readonly String GithubForkName = "Azure"; - public static readonly String GithubBranchName = "master"; - public static readonly String GithubCommidId = "d4365e634050481a5d6966cd6dd2e4a361d519dd"; - public static readonly String CodeGenerationErrors = ""; - public static readonly String GithubRepoName = "azure-rest-api-specs"; - // END: Code Generation Metadata Section } } - diff --git a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/SecretsOperations.cs b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/SecretsOperations.cs index 320ddbd030af..b5c55a1c3a97 100644 --- a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/SecretsOperations.cs +++ b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/SecretsOperations.cs @@ -283,9 +283,6 @@ internal SecretsOperations(DevTestLabsClient client) /// /// The name of the secret. /// - /// - /// Specify the $expand query. Example: 'properties($select=value)' - /// /// /// Headers that will be added to request. /// @@ -307,7 +304,7 @@ internal SecretsOperations(DevTestLabsClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string labName, string userName, string name, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string labName, string userName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (Client.SubscriptionId == null) { @@ -344,7 +341,6 @@ internal SecretsOperations(DevTestLabsClient client) tracingParameters.Add("labName", labName); tracingParameters.Add("userName", userName); tracingParameters.Add("name", name); - tracingParameters.Add("expand", expand); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } @@ -357,10 +353,6 @@ internal SecretsOperations(DevTestLabsClient client) _url = _url.Replace("{userName}", System.Uri.EscapeDataString(userName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); List _queryParameters = new List(); - if (expand != null) - { - _queryParameters.Add(string.Format("$expand={0}", System.Uri.EscapeDataString(expand))); - } if (Client.ApiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); @@ -716,7 +708,7 @@ internal SecretsOperations(DevTestLabsClient client) } /// - /// Modify properties of secrets. + /// Allows modifying tags of secrets. All other properties will be ignored. /// /// /// The name of the resource group. @@ -731,7 +723,7 @@ internal SecretsOperations(DevTestLabsClient client) /// The name of the secret. /// /// - /// A secret. + /// Allows modifying tags of secrets. All other properties will be ignored. /// /// /// Headers that will be added to request. @@ -1009,6 +1001,10 @@ internal SecretsOperations(DevTestLabsClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "secret"); } + if (secret != null) + { + secret.Validate(); + } if (Client.ApiVersion == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); @@ -1105,7 +1101,7 @@ internal SecretsOperations(DevTestLabsClient client) System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 201) + if ((int)_statusCode != 200 && (int)_statusCode != 201 && (int)_statusCode != 202) { var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try diff --git a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/SecretsOperationsExtensions.cs b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/SecretsOperationsExtensions.cs index ec8527f3eabe..d1f95d273217 100644 --- a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/SecretsOperationsExtensions.cs +++ b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/SecretsOperationsExtensions.cs @@ -92,12 +92,9 @@ public static partial class SecretsOperationsExtensions /// /// The name of the secret. /// - /// - /// Specify the $expand query. Example: 'properties($select=value)' - /// - public static Secret Get(this ISecretsOperations operations, string resourceGroupName, string labName, string userName, string name, string expand = default(string)) + public static Secret Get(this ISecretsOperations operations, string resourceGroupName, string labName, string userName, string name) { - return operations.GetAsync(resourceGroupName, labName, userName, name, expand).GetAwaiter().GetResult(); + return operations.GetAsync(resourceGroupName, labName, userName, name).GetAwaiter().GetResult(); } /// @@ -118,15 +115,12 @@ public static partial class SecretsOperationsExtensions /// /// The name of the secret. /// - /// - /// Specify the $expand query. Example: 'properties($select=value)' - /// /// /// The cancellation token. /// - public static async Task GetAsync(this ISecretsOperations operations, string resourceGroupName, string labName, string userName, string name, string expand = default(string), CancellationToken cancellationToken = default(CancellationToken)) + public static async Task GetAsync(this ISecretsOperations operations, string resourceGroupName, string labName, string userName, string name, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, labName, userName, name, expand, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, labName, userName, name, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } @@ -242,7 +236,7 @@ public static void Delete(this ISecretsOperations operations, string resourceGro } /// - /// Modify properties of secrets. + /// Allows modifying tags of secrets. All other properties will be ignored. /// /// /// The operations group for this extension method. @@ -260,7 +254,7 @@ public static void Delete(this ISecretsOperations operations, string resourceGro /// The name of the secret. /// /// - /// A secret. + /// Allows modifying tags of secrets. All other properties will be ignored. /// public static Secret Update(this ISecretsOperations operations, string resourceGroupName, string labName, string userName, string name, SecretFragment secret) { @@ -268,7 +262,7 @@ public static Secret Update(this ISecretsOperations operations, string resourceG } /// - /// Modify properties of secrets. + /// Allows modifying tags of secrets. All other properties will be ignored. /// /// /// The operations group for this extension method. @@ -286,7 +280,7 @@ public static Secret Update(this ISecretsOperations operations, string resourceG /// The name of the secret. /// /// - /// A secret. + /// Allows modifying tags of secrets. All other properties will be ignored. /// /// /// The cancellation token. diff --git a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/ServiceFabricSchedulesOperations.cs b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/ServiceFabricSchedulesOperations.cs index 8521bda504ea..455e03857586 100644 --- a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/ServiceFabricSchedulesOperations.cs +++ b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/ServiceFabricSchedulesOperations.cs @@ -64,7 +64,7 @@ internal ServiceFabricSchedulesOperations(DevTestLabsClient client) /// The name of the user profile. /// /// - /// The name of the service Fabric. + /// The name of the service fabric. /// /// /// OData parameters to apply to the operation. @@ -290,14 +290,11 @@ internal ServiceFabricSchedulesOperations(DevTestLabsClient client) /// The name of the user profile. /// /// - /// The name of the service Fabric. + /// The name of the service fabric. /// /// /// The name of the schedule. /// - /// - /// Specify the $expand query. Example: 'properties($select=status)' - /// /// /// Headers that will be added to request. /// @@ -319,7 +316,7 @@ internal ServiceFabricSchedulesOperations(DevTestLabsClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string labName, string userName, string serviceFabricName, string name, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string labName, string userName, string serviceFabricName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (Client.SubscriptionId == null) { @@ -361,7 +358,6 @@ internal ServiceFabricSchedulesOperations(DevTestLabsClient client) tracingParameters.Add("userName", userName); tracingParameters.Add("serviceFabricName", serviceFabricName); tracingParameters.Add("name", name); - tracingParameters.Add("expand", expand); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } @@ -375,10 +371,6 @@ internal ServiceFabricSchedulesOperations(DevTestLabsClient client) _url = _url.Replace("{serviceFabricName}", System.Uri.EscapeDataString(serviceFabricName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); List _queryParameters = new List(); - if (expand != null) - { - _queryParameters.Add(string.Format("$expand={0}", System.Uri.EscapeDataString(expand))); - } if (Client.ApiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); @@ -521,7 +513,7 @@ internal ServiceFabricSchedulesOperations(DevTestLabsClient client) /// The name of the user profile. /// /// - /// The name of the service Fabric. + /// The name of the service fabric. /// /// /// The name of the schedule. @@ -580,6 +572,10 @@ internal ServiceFabricSchedulesOperations(DevTestLabsClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "schedule"); } + if (schedule != null) + { + schedule.Validate(); + } if (Client.ApiVersion == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); @@ -776,7 +772,7 @@ internal ServiceFabricSchedulesOperations(DevTestLabsClient client) /// The name of the user profile. /// /// - /// The name of the service Fabric. + /// The name of the service fabric. /// /// /// The name of the schedule. @@ -966,7 +962,7 @@ internal ServiceFabricSchedulesOperations(DevTestLabsClient client) } /// - /// Modify properties of schedules. + /// Allows modifying tags of schedules. All other properties will be ignored. /// /// /// The name of the resource group. @@ -978,13 +974,13 @@ internal ServiceFabricSchedulesOperations(DevTestLabsClient client) /// The name of the user profile. /// /// - /// The name of the service Fabric. + /// The name of the service fabric. /// /// /// The name of the schedule. /// /// - /// A schedule. + /// Allows modifying tags of schedules. All other properties will be ignored. /// /// /// Headers that will be added to request. @@ -1215,7 +1211,7 @@ internal ServiceFabricSchedulesOperations(DevTestLabsClient client) /// The name of the user profile. /// /// - /// The name of the service Fabric. + /// The name of the service fabric. /// /// /// The name of the schedule. @@ -1246,7 +1242,7 @@ internal ServiceFabricSchedulesOperations(DevTestLabsClient client) /// The name of the user profile. /// /// - /// The name of the service Fabric. + /// The name of the service fabric. /// /// /// The name of the schedule. diff --git a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/ServiceFabricSchedulesOperationsExtensions.cs b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/ServiceFabricSchedulesOperationsExtensions.cs index ef5012d3fd39..3890f3d4b271 100644 --- a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/ServiceFabricSchedulesOperationsExtensions.cs +++ b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/ServiceFabricSchedulesOperationsExtensions.cs @@ -38,7 +38,7 @@ public static partial class ServiceFabricSchedulesOperationsExtensions /// The name of the user profile. /// /// - /// The name of the service Fabric. + /// The name of the service fabric. /// /// /// OData parameters to apply to the operation. @@ -64,7 +64,7 @@ public static partial class ServiceFabricSchedulesOperationsExtensions /// The name of the user profile. /// /// - /// The name of the service Fabric. + /// The name of the service fabric. /// /// /// OData parameters to apply to the operation. @@ -96,17 +96,14 @@ public static partial class ServiceFabricSchedulesOperationsExtensions /// The name of the user profile. /// /// - /// The name of the service Fabric. + /// The name of the service fabric. /// /// /// The name of the schedule. /// - /// - /// Specify the $expand query. Example: 'properties($select=status)' - /// - public static Schedule Get(this IServiceFabricSchedulesOperations operations, string resourceGroupName, string labName, string userName, string serviceFabricName, string name, string expand = default(string)) + public static Schedule Get(this IServiceFabricSchedulesOperations operations, string resourceGroupName, string labName, string userName, string serviceFabricName, string name) { - return operations.GetAsync(resourceGroupName, labName, userName, serviceFabricName, name, expand).GetAwaiter().GetResult(); + return operations.GetAsync(resourceGroupName, labName, userName, serviceFabricName, name).GetAwaiter().GetResult(); } /// @@ -125,20 +122,17 @@ public static partial class ServiceFabricSchedulesOperationsExtensions /// The name of the user profile. /// /// - /// The name of the service Fabric. + /// The name of the service fabric. /// /// /// The name of the schedule. /// - /// - /// Specify the $expand query. Example: 'properties($select=status)' - /// /// /// The cancellation token. /// - public static async Task GetAsync(this IServiceFabricSchedulesOperations operations, string resourceGroupName, string labName, string userName, string serviceFabricName, string name, string expand = default(string), CancellationToken cancellationToken = default(CancellationToken)) + public static async Task GetAsync(this IServiceFabricSchedulesOperations operations, string resourceGroupName, string labName, string userName, string serviceFabricName, string name, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, labName, userName, serviceFabricName, name, expand, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, labName, userName, serviceFabricName, name, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } @@ -160,7 +154,7 @@ public static partial class ServiceFabricSchedulesOperationsExtensions /// The name of the user profile. /// /// - /// The name of the service Fabric. + /// The name of the service fabric. /// /// /// The name of the schedule. @@ -189,7 +183,7 @@ public static Schedule CreateOrUpdate(this IServiceFabricSchedulesOperations ope /// The name of the user profile. /// /// - /// The name of the service Fabric. + /// The name of the service fabric. /// /// /// The name of the schedule. @@ -224,7 +218,7 @@ public static Schedule CreateOrUpdate(this IServiceFabricSchedulesOperations ope /// The name of the user profile. /// /// - /// The name of the service Fabric. + /// The name of the service fabric. /// /// /// The name of the schedule. @@ -250,7 +244,7 @@ public static void Delete(this IServiceFabricSchedulesOperations operations, str /// The name of the user profile. /// /// - /// The name of the service Fabric. + /// The name of the service fabric. /// /// /// The name of the schedule. @@ -264,7 +258,7 @@ public static void Delete(this IServiceFabricSchedulesOperations operations, str } /// - /// Modify properties of schedules. + /// Allows modifying tags of schedules. All other properties will be ignored. /// /// /// The operations group for this extension method. @@ -279,13 +273,13 @@ public static void Delete(this IServiceFabricSchedulesOperations operations, str /// The name of the user profile. /// /// - /// The name of the service Fabric. + /// The name of the service fabric. /// /// /// The name of the schedule. /// /// - /// A schedule. + /// Allows modifying tags of schedules. All other properties will be ignored. /// public static Schedule Update(this IServiceFabricSchedulesOperations operations, string resourceGroupName, string labName, string userName, string serviceFabricName, string name, ScheduleFragment schedule) { @@ -293,7 +287,7 @@ public static Schedule Update(this IServiceFabricSchedulesOperations operations, } /// - /// Modify properties of schedules. + /// Allows modifying tags of schedules. All other properties will be ignored. /// /// /// The operations group for this extension method. @@ -308,13 +302,13 @@ public static Schedule Update(this IServiceFabricSchedulesOperations operations, /// The name of the user profile. /// /// - /// The name of the service Fabric. + /// The name of the service fabric. /// /// /// The name of the schedule. /// /// - /// A schedule. + /// Allows modifying tags of schedules. All other properties will be ignored. /// /// /// The cancellation token. @@ -343,7 +337,7 @@ public static Schedule Update(this IServiceFabricSchedulesOperations operations, /// The name of the user profile. /// /// - /// The name of the service Fabric. + /// The name of the service fabric. /// /// /// The name of the schedule. @@ -369,7 +363,7 @@ public static void Execute(this IServiceFabricSchedulesOperations operations, st /// The name of the user profile. /// /// - /// The name of the service Fabric. + /// The name of the service fabric. /// /// /// The name of the schedule. @@ -398,7 +392,7 @@ public static void Execute(this IServiceFabricSchedulesOperations operations, st /// The name of the user profile. /// /// - /// The name of the service Fabric. + /// The name of the service fabric. /// /// /// The name of the schedule. @@ -424,7 +418,7 @@ public static void BeginExecute(this IServiceFabricSchedulesOperations operation /// The name of the user profile. /// /// - /// The name of the service Fabric. + /// The name of the service fabric. /// /// /// The name of the schedule. diff --git a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/ServiceFabricsOperations.cs b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/ServiceFabricsOperations.cs index 06490f19d3a9..eafa1b461de8 100644 --- a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/ServiceFabricsOperations.cs +++ b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/ServiceFabricsOperations.cs @@ -281,7 +281,7 @@ internal ServiceFabricsOperations(DevTestLabsClient client) /// The name of the user profile. /// /// - /// The name of the service Fabric. + /// The name of the service fabric. /// /// /// Specify the $expand query. Example: @@ -505,7 +505,7 @@ internal ServiceFabricsOperations(DevTestLabsClient client) /// The name of the user profile. /// /// - /// The name of the service Fabric. + /// The name of the service fabric. /// /// /// A Service Fabric. @@ -536,7 +536,7 @@ internal ServiceFabricsOperations(DevTestLabsClient client) /// The name of the user profile. /// /// - /// The name of the service Fabric. + /// The name of the service fabric. /// /// /// The headers that will be added to request. @@ -552,7 +552,8 @@ internal ServiceFabricsOperations(DevTestLabsClient client) } /// - /// Modify properties of service fabrics. + /// Allows modifying tags of service fabrics. All other properties will be + /// ignored. /// /// /// The name of the resource group. @@ -564,10 +565,11 @@ internal ServiceFabricsOperations(DevTestLabsClient client) /// The name of the user profile. /// /// - /// The name of the service Fabric. + /// The name of the service fabric. /// /// - /// A Service Fabric. + /// Allows modifying tags of service fabrics. All other properties will be + /// ignored. /// /// /// Headers that will be added to request. @@ -792,7 +794,7 @@ internal ServiceFabricsOperations(DevTestLabsClient client) /// The name of the user profile. /// /// - /// The name of the service Fabric. + /// The name of the service fabric. /// /// /// Headers that will be added to request. @@ -1006,7 +1008,7 @@ internal ServiceFabricsOperations(DevTestLabsClient client) /// The name of the user profile. /// /// - /// The name of the service Fabric. + /// The name of the service fabric. /// /// /// The headers that will be added to request. @@ -1034,7 +1036,7 @@ internal ServiceFabricsOperations(DevTestLabsClient client) /// The name of the user profile. /// /// - /// The name of the service Fabric. + /// The name of the service fabric. /// /// /// The headers that will be added to request. @@ -1063,7 +1065,7 @@ internal ServiceFabricsOperations(DevTestLabsClient client) /// The name of the user profile. /// /// - /// The name of the service Fabric. + /// The name of the service fabric. /// /// /// A Service Fabric. @@ -1115,6 +1117,10 @@ internal ServiceFabricsOperations(DevTestLabsClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "serviceFabric"); } + if (serviceFabric != null) + { + serviceFabric.Validate(); + } if (Client.ApiVersion == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); @@ -1211,7 +1217,7 @@ internal ServiceFabricsOperations(DevTestLabsClient client) System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 201) + if ((int)_statusCode != 200 && (int)_statusCode != 201 && (int)_statusCode != 202) { var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -1309,7 +1315,7 @@ internal ServiceFabricsOperations(DevTestLabsClient client) /// The name of the user profile. /// /// - /// The name of the service Fabric. + /// The name of the service fabric. /// /// /// Headers that will be added to request. @@ -1502,7 +1508,7 @@ internal ServiceFabricsOperations(DevTestLabsClient client) /// The name of the user profile. /// /// - /// The name of the service Fabric. + /// The name of the service fabric. /// /// /// Headers that will be added to request. @@ -1695,7 +1701,7 @@ internal ServiceFabricsOperations(DevTestLabsClient client) /// The name of the user profile. /// /// - /// The name of the service Fabric. + /// The name of the service fabric. /// /// /// Headers that will be added to request. diff --git a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/ServiceFabricsOperationsExtensions.cs b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/ServiceFabricsOperationsExtensions.cs index 4507e03fd7b3..7dce36926c3b 100644 --- a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/ServiceFabricsOperationsExtensions.cs +++ b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/ServiceFabricsOperationsExtensions.cs @@ -90,7 +90,7 @@ public static partial class ServiceFabricsOperationsExtensions /// The name of the user profile. /// /// - /// The name of the service Fabric. + /// The name of the service fabric. /// /// /// Specify the $expand query. Example: @@ -117,7 +117,7 @@ public static partial class ServiceFabricsOperationsExtensions /// The name of the user profile. /// /// - /// The name of the service Fabric. + /// The name of the service fabric. /// /// /// Specify the $expand query. Example: @@ -151,7 +151,7 @@ public static partial class ServiceFabricsOperationsExtensions /// The name of the user profile. /// /// - /// The name of the service Fabric. + /// The name of the service fabric. /// /// /// A Service Fabric. @@ -178,7 +178,7 @@ public static ServiceFabric CreateOrUpdate(this IServiceFabricsOperations operat /// The name of the user profile. /// /// - /// The name of the service Fabric. + /// The name of the service fabric. /// /// /// A Service Fabric. @@ -210,7 +210,7 @@ public static ServiceFabric CreateOrUpdate(this IServiceFabricsOperations operat /// The name of the user profile. /// /// - /// The name of the service Fabric. + /// The name of the service fabric. /// public static void Delete(this IServiceFabricsOperations operations, string resourceGroupName, string labName, string userName, string name) { @@ -233,7 +233,7 @@ public static void Delete(this IServiceFabricsOperations operations, string reso /// The name of the user profile. /// /// - /// The name of the service Fabric. + /// The name of the service fabric. /// /// /// The cancellation token. @@ -244,7 +244,8 @@ public static void Delete(this IServiceFabricsOperations operations, string reso } /// - /// Modify properties of service fabrics. + /// Allows modifying tags of service fabrics. All other properties will be + /// ignored. /// /// /// The operations group for this extension method. @@ -259,10 +260,11 @@ public static void Delete(this IServiceFabricsOperations operations, string reso /// The name of the user profile. /// /// - /// The name of the service Fabric. + /// The name of the service fabric. /// /// - /// A Service Fabric. + /// Allows modifying tags of service fabrics. All other properties will be + /// ignored. /// public static ServiceFabric Update(this IServiceFabricsOperations operations, string resourceGroupName, string labName, string userName, string name, ServiceFabricFragment serviceFabric) { @@ -270,7 +272,8 @@ public static ServiceFabric Update(this IServiceFabricsOperations operations, st } /// - /// Modify properties of service fabrics. + /// Allows modifying tags of service fabrics. All other properties will be + /// ignored. /// /// /// The operations group for this extension method. @@ -285,10 +288,11 @@ public static ServiceFabric Update(this IServiceFabricsOperations operations, st /// The name of the user profile. /// /// - /// The name of the service Fabric. + /// The name of the service fabric. /// /// - /// A Service Fabric. + /// Allows modifying tags of service fabrics. All other properties will be + /// ignored. /// /// /// The cancellation token. @@ -317,7 +321,7 @@ public static ServiceFabric Update(this IServiceFabricsOperations operations, st /// The name of the user profile. /// /// - /// The name of the service Fabric. + /// The name of the service fabric. /// public static ApplicableSchedule ListApplicableSchedules(this IServiceFabricsOperations operations, string resourceGroupName, string labName, string userName, string name) { @@ -340,7 +344,7 @@ public static ApplicableSchedule ListApplicableSchedules(this IServiceFabricsOpe /// The name of the user profile. /// /// - /// The name of the service Fabric. + /// The name of the service fabric. /// /// /// The cancellation token. @@ -369,7 +373,7 @@ public static ApplicableSchedule ListApplicableSchedules(this IServiceFabricsOpe /// The name of the user profile. /// /// - /// The name of the service Fabric. + /// The name of the service fabric. /// public static void Start(this IServiceFabricsOperations operations, string resourceGroupName, string labName, string userName, string name) { @@ -392,7 +396,7 @@ public static void Start(this IServiceFabricsOperations operations, string resou /// The name of the user profile. /// /// - /// The name of the service Fabric. + /// The name of the service fabric. /// /// /// The cancellation token. @@ -418,7 +422,7 @@ public static void Start(this IServiceFabricsOperations operations, string resou /// The name of the user profile. /// /// - /// The name of the service Fabric. + /// The name of the service fabric. /// public static void Stop(this IServiceFabricsOperations operations, string resourceGroupName, string labName, string userName, string name) { @@ -441,7 +445,7 @@ public static void Stop(this IServiceFabricsOperations operations, string resour /// The name of the user profile. /// /// - /// The name of the service Fabric. + /// The name of the service fabric. /// /// /// The cancellation token. @@ -468,7 +472,7 @@ public static void Stop(this IServiceFabricsOperations operations, string resour /// The name of the user profile. /// /// - /// The name of the service Fabric. + /// The name of the service fabric. /// /// /// A Service Fabric. @@ -495,7 +499,7 @@ public static ServiceFabric BeginCreateOrUpdate(this IServiceFabricsOperations o /// The name of the user profile. /// /// - /// The name of the service Fabric. + /// The name of the service fabric. /// /// /// A Service Fabric. @@ -527,7 +531,7 @@ public static ServiceFabric BeginCreateOrUpdate(this IServiceFabricsOperations o /// The name of the user profile. /// /// - /// The name of the service Fabric. + /// The name of the service fabric. /// public static void BeginDelete(this IServiceFabricsOperations operations, string resourceGroupName, string labName, string userName, string name) { @@ -550,7 +554,7 @@ public static void BeginDelete(this IServiceFabricsOperations operations, string /// The name of the user profile. /// /// - /// The name of the service Fabric. + /// The name of the service fabric. /// /// /// The cancellation token. @@ -576,7 +580,7 @@ public static void BeginDelete(this IServiceFabricsOperations operations, string /// The name of the user profile. /// /// - /// The name of the service Fabric. + /// The name of the service fabric. /// public static void BeginStart(this IServiceFabricsOperations operations, string resourceGroupName, string labName, string userName, string name) { @@ -599,7 +603,7 @@ public static void BeginStart(this IServiceFabricsOperations operations, string /// The name of the user profile. /// /// - /// The name of the service Fabric. + /// The name of the service fabric. /// /// /// The cancellation token. @@ -625,7 +629,7 @@ public static void BeginStart(this IServiceFabricsOperations operations, string /// The name of the user profile. /// /// - /// The name of the service Fabric. + /// The name of the service fabric. /// public static void BeginStop(this IServiceFabricsOperations operations, string resourceGroupName, string labName, string userName, string name) { @@ -648,7 +652,7 @@ public static void BeginStop(this IServiceFabricsOperations operations, string r /// The name of the user profile. /// /// - /// The name of the service Fabric. + /// The name of the service fabric. /// /// /// The cancellation token. diff --git a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/ServiceRunnersOperations.cs b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/ServiceRunnersOperations.cs index d436fc9eae6c..5eb3682f854a 100644 --- a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/ServiceRunnersOperations.cs +++ b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/ServiceRunnersOperations.cs @@ -465,7 +465,62 @@ internal ServiceRunnersOperations(DevTestLabsClient client) } /// - /// Create or replace an existing Service runner. + /// Create or replace an existing Service runner. This operation can take a + /// while to complete. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the lab. + /// + /// + /// The name of the service runner. + /// + /// + /// A container for a managed identity to execute DevTest lab services. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string labName, string name, ServiceRunner serviceRunner, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send Request + AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, labName, name, serviceRunner, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Delete service runner. This operation can take a while to complete. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the lab. + /// + /// + /// The name of the service runner. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string labName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, labName, name, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Create or replace an existing Service runner. This operation can take a + /// while to complete. /// /// /// The name of the resource group. @@ -500,7 +555,7 @@ internal ServiceRunnersOperations(DevTestLabsClient client) /// /// A response object containing the response body and response headers. /// - public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string labName, string name, ServiceRunner serviceRunner, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string labName, string name, ServiceRunner serviceRunner, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (Client.SubscriptionId == null) { @@ -522,6 +577,10 @@ internal ServiceRunnersOperations(DevTestLabsClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "serviceRunner"); } + if (serviceRunner != null) + { + serviceRunner.Validate(); + } if (Client.ApiVersion == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); @@ -538,7 +597,7 @@ internal ServiceRunnersOperations(DevTestLabsClient client) tracingParameters.Add("name", name); tracingParameters.Add("serviceRunner", serviceRunner); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdate", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; @@ -616,7 +675,7 @@ internal ServiceRunnersOperations(DevTestLabsClient client) System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 201) + if ((int)_statusCode != 200 && (int)_statusCode != 201 && (int)_statusCode != 202) { var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -702,7 +761,7 @@ internal ServiceRunnersOperations(DevTestLabsClient client) } /// - /// Delete service runner. + /// Delete service runner. This operation can take a while to complete. /// /// /// The name of the resource group. @@ -731,7 +790,7 @@ internal ServiceRunnersOperations(DevTestLabsClient client) /// /// A response object containing the response body and response headers. /// - public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string labName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string labName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (Client.SubscriptionId == null) { @@ -764,7 +823,7 @@ internal ServiceRunnersOperations(DevTestLabsClient client) tracingParameters.Add("labName", labName); tracingParameters.Add("name", name); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Delete", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; @@ -836,7 +895,7 @@ internal ServiceRunnersOperations(DevTestLabsClient client) System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 204) + if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 204) { var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try diff --git a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/ServiceRunnersOperationsExtensions.cs b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/ServiceRunnersOperationsExtensions.cs index 0a5496deba78..d795bc2e8d3b 100644 --- a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/ServiceRunnersOperationsExtensions.cs +++ b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/ServiceRunnersOperationsExtensions.cs @@ -115,7 +115,8 @@ public static ServiceRunner Get(this IServiceRunnersOperations operations, strin } /// - /// Create or replace an existing Service runner. + /// Create or replace an existing Service runner. This operation can take a + /// while to complete. /// /// /// The operations group for this extension method. @@ -138,7 +139,8 @@ public static ServiceRunner CreateOrUpdate(this IServiceRunnersOperations operat } /// - /// Create or replace an existing Service runner. + /// Create or replace an existing Service runner. This operation can take a + /// while to complete. /// /// /// The operations group for this extension method. @@ -167,7 +169,7 @@ public static ServiceRunner CreateOrUpdate(this IServiceRunnersOperations operat } /// - /// Delete service runner. + /// Delete service runner. This operation can take a while to complete. /// /// /// The operations group for this extension method. @@ -187,7 +189,7 @@ public static void Delete(this IServiceRunnersOperations operations, string reso } /// - /// Delete service runner. + /// Delete service runner. This operation can take a while to complete. /// /// /// The operations group for this extension method. @@ -209,6 +211,103 @@ public static void Delete(this IServiceRunnersOperations operations, string reso (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, labName, name, null, cancellationToken).ConfigureAwait(false)).Dispose(); } + /// + /// Create or replace an existing Service runner. This operation can take a + /// while to complete. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the lab. + /// + /// + /// The name of the service runner. + /// + /// + /// A container for a managed identity to execute DevTest lab services. + /// + public static ServiceRunner BeginCreateOrUpdate(this IServiceRunnersOperations operations, string resourceGroupName, string labName, string name, ServiceRunner serviceRunner) + { + return operations.BeginCreateOrUpdateAsync(resourceGroupName, labName, name, serviceRunner).GetAwaiter().GetResult(); + } + + /// + /// Create or replace an existing Service runner. This operation can take a + /// while to complete. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the lab. + /// + /// + /// The name of the service runner. + /// + /// + /// A container for a managed identity to execute DevTest lab services. + /// + /// + /// The cancellation token. + /// + public static async Task BeginCreateOrUpdateAsync(this IServiceRunnersOperations operations, string resourceGroupName, string labName, string name, ServiceRunner serviceRunner, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, labName, name, serviceRunner, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Delete service runner. This operation can take a while to complete. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the lab. + /// + /// + /// The name of the service runner. + /// + public static void BeginDelete(this IServiceRunnersOperations operations, string resourceGroupName, string labName, string name) + { + operations.BeginDeleteAsync(resourceGroupName, labName, name).GetAwaiter().GetResult(); + } + + /// + /// Delete service runner. This operation can take a while to complete. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the lab. + /// + /// + /// The name of the service runner. + /// + /// + /// The cancellation token. + /// + public static async Task BeginDeleteAsync(this IServiceRunnersOperations operations, string resourceGroupName, string labName, string name, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, labName, name, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// /// List service runners in a given lab. /// diff --git a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/SharedGalleriesOperations.cs b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/SharedGalleriesOperations.cs new file mode 100644 index 000000000000..8dac905cd0c7 --- /dev/null +++ b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/SharedGalleriesOperations.cs @@ -0,0 +1,1287 @@ +// +// 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.DevTestLabs +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Microsoft.Rest.Azure.OData; + using Models; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + using System.Net; + using System.Net.Http; + using System.Threading; + using System.Threading.Tasks; + + /// + /// SharedGalleriesOperations operations. + /// + internal partial class SharedGalleriesOperations : IServiceOperations, ISharedGalleriesOperations + { + /// + /// Initializes a new instance of the SharedGalleriesOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal SharedGalleriesOperations(DevTestLabsClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the DevTestLabsClient + /// + public DevTestLabsClient Client { get; private set; } + + /// + /// List shared galleries in a given lab. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the lab. + /// + /// + /// OData parameters to apply to the 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>> ListWithHttpMessagesAsync(string resourceGroupName, string labName, ODataQuery odataQuery = default(ODataQuery), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (labName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "labName"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("odataQuery", odataQuery); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("labName", labName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/sharedgalleries").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{labName}", System.Uri.EscapeDataString(labName)); + List _queryParameters = new List(); + if (odataQuery != null) + { + var _odataFilter = odataQuery.ToString(); + if (!string.IsNullOrEmpty(_odataFilter)) + { + _queryParameters.Add(_odataFilter); + } + } + 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); + } + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + 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); + } + _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; + } + + /// + /// Get shared gallery. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the lab. + /// + /// + /// The name of the shared gallery. + /// + /// + /// 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> GetWithHttpMessagesAsync(string resourceGroupName, string labName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (labName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "labName"); + } + if (name == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "name"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("labName", labName); + tracingParameters.Add("name", name); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/sharedgalleries/{name}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{labName}", System.Uri.EscapeDataString(labName)); + _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + 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); + } + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + 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); + } + _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; + } + + /// + /// Create or replace an existing Shared Gallery. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the lab. + /// + /// + /// The name of the shared gallery. + /// + /// + /// Properties of a shared gallery + /// + /// + /// 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> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string labName, string name, SharedGallery sharedGallery, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (labName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "labName"); + } + if (name == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "name"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (sharedGallery == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "sharedGallery"); + } + if (sharedGallery != null) + { + sharedGallery.Validate(); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("labName", labName); + tracingParameters.Add("name", name); + tracingParameters.Add("sharedGallery", sharedGallery); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdate", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/sharedgalleries/{name}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{labName}", System.Uri.EscapeDataString(labName)); + _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + 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("PUT"); + _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; + if(sharedGallery != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(sharedGallery, Client.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 (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); + } + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 201) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + 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); + } + _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); + } + } + // 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); + } + return _result; + } + + /// + /// Delete shared gallery. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the lab. + /// + /// + /// The name of the shared gallery. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string labName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (labName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "labName"); + } + if (name == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "name"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("labName", labName); + tracingParameters.Add("name", name); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "Delete", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/sharedgalleries/{name}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{labName}", System.Uri.EscapeDataString(labName)); + _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + 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("DELETE"); + _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); + } + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 204) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + 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); + } + _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(); + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Allows modifying tags of shared galleries. All other properties will be + /// ignored. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the lab. + /// + /// + /// The name of the shared gallery. + /// + /// + /// Allows modifying tags of shared galleries. All other properties will be + /// ignored. + /// + /// + /// 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> UpdateWithHttpMessagesAsync(string resourceGroupName, string labName, string name, SharedGalleryFragment sharedGallery, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (labName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "labName"); + } + if (name == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "name"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (sharedGallery == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "sharedGallery"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("labName", labName); + tracingParameters.Add("name", name); + tracingParameters.Add("sharedGallery", sharedGallery); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "Update", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/sharedgalleries/{name}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{labName}", System.Uri.EscapeDataString(labName)); + _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + 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("PATCH"); + _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; + if(sharedGallery != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(sharedGallery, Client.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 (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); + } + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + 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); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// List shared galleries in a given lab. + /// + /// + /// 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>> ListNextWithHttpMessagesAsync(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, "ListNext", 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); + } + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + 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); + } + _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; + } + + } +} diff --git a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/SharedGalleriesOperationsExtensions.cs b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/SharedGalleriesOperationsExtensions.cs new file mode 100644 index 000000000000..4f13de1de806 --- /dev/null +++ b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/SharedGalleriesOperationsExtensions.cs @@ -0,0 +1,303 @@ +// +// 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.DevTestLabs +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Microsoft.Rest.Azure.OData; + using Models; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for SharedGalleriesOperations. + /// + public static partial class SharedGalleriesOperationsExtensions + { + /// + /// List shared galleries in a given lab. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the lab. + /// + /// + /// OData parameters to apply to the operation. + /// + public static IPage List(this ISharedGalleriesOperations operations, string resourceGroupName, string labName, ODataQuery odataQuery = default(ODataQuery)) + { + return operations.ListAsync(resourceGroupName, labName, odataQuery).GetAwaiter().GetResult(); + } + + /// + /// List shared galleries in a given lab. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the lab. + /// + /// + /// OData parameters to apply to the operation. + /// + /// + /// The cancellation token. + /// + public static async Task> ListAsync(this ISharedGalleriesOperations operations, string resourceGroupName, string labName, ODataQuery odataQuery = default(ODataQuery), CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, labName, odataQuery, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Get shared gallery. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the lab. + /// + /// + /// The name of the shared gallery. + /// + public static SharedGallery Get(this ISharedGalleriesOperations operations, string resourceGroupName, string labName, string name) + { + return operations.GetAsync(resourceGroupName, labName, name).GetAwaiter().GetResult(); + } + + /// + /// Get shared gallery. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the lab. + /// + /// + /// The name of the shared gallery. + /// + /// + /// The cancellation token. + /// + public static async Task GetAsync(this ISharedGalleriesOperations operations, string resourceGroupName, string labName, string name, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, labName, name, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Create or replace an existing Shared Gallery. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the lab. + /// + /// + /// The name of the shared gallery. + /// + /// + /// Properties of a shared gallery + /// + public static SharedGallery CreateOrUpdate(this ISharedGalleriesOperations operations, string resourceGroupName, string labName, string name, SharedGallery sharedGallery) + { + return operations.CreateOrUpdateAsync(resourceGroupName, labName, name, sharedGallery).GetAwaiter().GetResult(); + } + + /// + /// Create or replace an existing Shared Gallery. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the lab. + /// + /// + /// The name of the shared gallery. + /// + /// + /// Properties of a shared gallery + /// + /// + /// The cancellation token. + /// + public static async Task CreateOrUpdateAsync(this ISharedGalleriesOperations operations, string resourceGroupName, string labName, string name, SharedGallery sharedGallery, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, labName, name, sharedGallery, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Delete shared gallery. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the lab. + /// + /// + /// The name of the shared gallery. + /// + public static void Delete(this ISharedGalleriesOperations operations, string resourceGroupName, string labName, string name) + { + operations.DeleteAsync(resourceGroupName, labName, name).GetAwaiter().GetResult(); + } + + /// + /// Delete shared gallery. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the lab. + /// + /// + /// The name of the shared gallery. + /// + /// + /// The cancellation token. + /// + public static async Task DeleteAsync(this ISharedGalleriesOperations operations, string resourceGroupName, string labName, string name, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, labName, name, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// Allows modifying tags of shared galleries. All other properties will be + /// ignored. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the lab. + /// + /// + /// The name of the shared gallery. + /// + /// + /// Allows modifying tags of shared galleries. All other properties will be + /// ignored. + /// + public static SharedGallery Update(this ISharedGalleriesOperations operations, string resourceGroupName, string labName, string name, SharedGalleryFragment sharedGallery) + { + return operations.UpdateAsync(resourceGroupName, labName, name, sharedGallery).GetAwaiter().GetResult(); + } + + /// + /// Allows modifying tags of shared galleries. All other properties will be + /// ignored. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the lab. + /// + /// + /// The name of the shared gallery. + /// + /// + /// Allows modifying tags of shared galleries. All other properties will be + /// ignored. + /// + /// + /// The cancellation token. + /// + public static async Task UpdateAsync(this ISharedGalleriesOperations operations, string resourceGroupName, string labName, string name, SharedGalleryFragment sharedGallery, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.UpdateWithHttpMessagesAsync(resourceGroupName, labName, name, sharedGallery, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// List shared galleries in a given lab. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage ListNext(this ISharedGalleriesOperations operations, string nextPageLink) + { + return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// List shared galleries in a given lab. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async Task> ListNextAsync(this ISharedGalleriesOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +} diff --git a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/SharedImagesOperations.cs b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/SharedImagesOperations.cs new file mode 100644 index 000000000000..35f03cb6cc62 --- /dev/null +++ b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/SharedImagesOperations.cs @@ -0,0 +1,1340 @@ +// +// 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.DevTestLabs +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Microsoft.Rest.Azure.OData; + using Models; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + using System.Net; + using System.Net.Http; + using System.Threading; + using System.Threading.Tasks; + + /// + /// SharedImagesOperations operations. + /// + internal partial class SharedImagesOperations : IServiceOperations, ISharedImagesOperations + { + /// + /// Initializes a new instance of the SharedImagesOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal SharedImagesOperations(DevTestLabsClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the DevTestLabsClient + /// + public DevTestLabsClient Client { get; private set; } + + /// + /// List shared images in a given shared gallery. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the lab. + /// + /// + /// The name of the shared gallery. + /// + /// + /// OData parameters to apply to the 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>> ListWithHttpMessagesAsync(string resourceGroupName, string labName, string sharedGalleryName, ODataQuery odataQuery = default(ODataQuery), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (labName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "labName"); + } + if (sharedGalleryName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "sharedGalleryName"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("odataQuery", odataQuery); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("labName", labName); + tracingParameters.Add("sharedGalleryName", sharedGalleryName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/sharedgalleries/{sharedGalleryName}/sharedimages").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{labName}", System.Uri.EscapeDataString(labName)); + _url = _url.Replace("{sharedGalleryName}", System.Uri.EscapeDataString(sharedGalleryName)); + List _queryParameters = new List(); + if (odataQuery != null) + { + var _odataFilter = odataQuery.ToString(); + if (!string.IsNullOrEmpty(_odataFilter)) + { + _queryParameters.Add(_odataFilter); + } + } + 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); + } + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + 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); + } + _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; + } + + /// + /// Get shared image. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the lab. + /// + /// + /// The name of the shared gallery. + /// + /// + /// The name of the shared image. + /// + /// + /// Specify the $expand query. Example: 'properties($expand=versions)' + /// + /// + /// 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> GetWithHttpMessagesAsync(string resourceGroupName, string labName, string sharedGalleryName, string name, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (labName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "labName"); + } + if (sharedGalleryName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "sharedGalleryName"); + } + if (name == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "name"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("labName", labName); + tracingParameters.Add("sharedGalleryName", sharedGalleryName); + tracingParameters.Add("name", name); + tracingParameters.Add("expand", expand); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/sharedgalleries/{sharedGalleryName}/sharedimages/{name}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{labName}", System.Uri.EscapeDataString(labName)); + _url = _url.Replace("{sharedGalleryName}", System.Uri.EscapeDataString(sharedGalleryName)); + _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + List _queryParameters = new List(); + if (expand != null) + { + _queryParameters.Add(string.Format("$expand={0}", System.Uri.EscapeDataString(expand))); + } + 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); + } + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + 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); + } + _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; + } + + /// + /// Create or replace an existing Shared Image. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the lab. + /// + /// + /// The name of the shared gallery. + /// + /// + /// The name of the shared image. + /// + /// + /// Properties of a shared image + /// + /// + /// 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> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string labName, string sharedGalleryName, string name, SharedImage sharedImage, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (labName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "labName"); + } + if (sharedGalleryName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "sharedGalleryName"); + } + if (name == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "name"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (sharedImage == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "sharedImage"); + } + if (sharedImage != null) + { + sharedImage.Validate(); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("labName", labName); + tracingParameters.Add("sharedGalleryName", sharedGalleryName); + tracingParameters.Add("name", name); + tracingParameters.Add("sharedImage", sharedImage); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdate", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/sharedgalleries/{sharedGalleryName}/sharedimages/{name}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{labName}", System.Uri.EscapeDataString(labName)); + _url = _url.Replace("{sharedGalleryName}", System.Uri.EscapeDataString(sharedGalleryName)); + _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + 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("PUT"); + _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; + if(sharedImage != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(sharedImage, Client.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 (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); + } + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 201) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + 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); + } + _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); + } + } + // 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); + } + return _result; + } + + /// + /// Delete shared image. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the lab. + /// + /// + /// The name of the shared gallery. + /// + /// + /// The name of the shared image. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string labName, string sharedGalleryName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (labName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "labName"); + } + if (sharedGalleryName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "sharedGalleryName"); + } + if (name == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "name"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("labName", labName); + tracingParameters.Add("sharedGalleryName", sharedGalleryName); + tracingParameters.Add("name", name); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "Delete", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/sharedgalleries/{sharedGalleryName}/sharedimages/{name}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{labName}", System.Uri.EscapeDataString(labName)); + _url = _url.Replace("{sharedGalleryName}", System.Uri.EscapeDataString(sharedGalleryName)); + _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + 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("DELETE"); + _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); + } + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 204) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + 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); + } + _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(); + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Allows modifying tags of shared images. All other properties will be + /// ignored. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the lab. + /// + /// + /// The name of the shared gallery. + /// + /// + /// The name of the shared image. + /// + /// + /// Allows modifying tags of shared images. All other properties will be + /// ignored. + /// + /// + /// 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> UpdateWithHttpMessagesAsync(string resourceGroupName, string labName, string sharedGalleryName, string name, SharedImageFragment sharedImage, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (labName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "labName"); + } + if (sharedGalleryName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "sharedGalleryName"); + } + if (name == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "name"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (sharedImage == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "sharedImage"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("labName", labName); + tracingParameters.Add("sharedGalleryName", sharedGalleryName); + tracingParameters.Add("name", name); + tracingParameters.Add("sharedImage", sharedImage); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "Update", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/sharedgalleries/{sharedGalleryName}/sharedimages/{name}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{labName}", System.Uri.EscapeDataString(labName)); + _url = _url.Replace("{sharedGalleryName}", System.Uri.EscapeDataString(sharedGalleryName)); + _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + 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("PATCH"); + _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; + if(sharedImage != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(sharedImage, Client.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 (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); + } + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + 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); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// List shared images in a given shared gallery. + /// + /// + /// 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>> ListNextWithHttpMessagesAsync(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, "ListNext", 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); + } + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + 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); + } + _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; + } + + } +} diff --git a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/SharedImagesOperationsExtensions.cs b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/SharedImagesOperationsExtensions.cs new file mode 100644 index 000000000000..cd31b5033c1d --- /dev/null +++ b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/SharedImagesOperationsExtensions.cs @@ -0,0 +1,339 @@ +// +// 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.DevTestLabs +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Microsoft.Rest.Azure.OData; + using Models; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for SharedImagesOperations. + /// + public static partial class SharedImagesOperationsExtensions + { + /// + /// List shared images in a given shared gallery. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the lab. + /// + /// + /// The name of the shared gallery. + /// + /// + /// OData parameters to apply to the operation. + /// + public static IPage List(this ISharedImagesOperations operations, string resourceGroupName, string labName, string sharedGalleryName, ODataQuery odataQuery = default(ODataQuery)) + { + return operations.ListAsync(resourceGroupName, labName, sharedGalleryName, odataQuery).GetAwaiter().GetResult(); + } + + /// + /// List shared images in a given shared gallery. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the lab. + /// + /// + /// The name of the shared gallery. + /// + /// + /// OData parameters to apply to the operation. + /// + /// + /// The cancellation token. + /// + public static async Task> ListAsync(this ISharedImagesOperations operations, string resourceGroupName, string labName, string sharedGalleryName, ODataQuery odataQuery = default(ODataQuery), CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, labName, sharedGalleryName, odataQuery, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Get shared image. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the lab. + /// + /// + /// The name of the shared gallery. + /// + /// + /// The name of the shared image. + /// + /// + /// Specify the $expand query. Example: 'properties($expand=versions)' + /// + public static SharedImage Get(this ISharedImagesOperations operations, string resourceGroupName, string labName, string sharedGalleryName, string name, string expand = default(string)) + { + return operations.GetAsync(resourceGroupName, labName, sharedGalleryName, name, expand).GetAwaiter().GetResult(); + } + + /// + /// Get shared image. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the lab. + /// + /// + /// The name of the shared gallery. + /// + /// + /// The name of the shared image. + /// + /// + /// Specify the $expand query. Example: 'properties($expand=versions)' + /// + /// + /// The cancellation token. + /// + public static async Task GetAsync(this ISharedImagesOperations operations, string resourceGroupName, string labName, string sharedGalleryName, string name, string expand = default(string), CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, labName, sharedGalleryName, name, expand, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Create or replace an existing Shared Image. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the lab. + /// + /// + /// The name of the shared gallery. + /// + /// + /// The name of the shared image. + /// + /// + /// Properties of a shared image + /// + public static SharedImage CreateOrUpdate(this ISharedImagesOperations operations, string resourceGroupName, string labName, string sharedGalleryName, string name, SharedImage sharedImage) + { + return operations.CreateOrUpdateAsync(resourceGroupName, labName, sharedGalleryName, name, sharedImage).GetAwaiter().GetResult(); + } + + /// + /// Create or replace an existing Shared Image. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the lab. + /// + /// + /// The name of the shared gallery. + /// + /// + /// The name of the shared image. + /// + /// + /// Properties of a shared image + /// + /// + /// The cancellation token. + /// + public static async Task CreateOrUpdateAsync(this ISharedImagesOperations operations, string resourceGroupName, string labName, string sharedGalleryName, string name, SharedImage sharedImage, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, labName, sharedGalleryName, name, sharedImage, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Delete shared image. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the lab. + /// + /// + /// The name of the shared gallery. + /// + /// + /// The name of the shared image. + /// + public static void Delete(this ISharedImagesOperations operations, string resourceGroupName, string labName, string sharedGalleryName, string name) + { + operations.DeleteAsync(resourceGroupName, labName, sharedGalleryName, name).GetAwaiter().GetResult(); + } + + /// + /// Delete shared image. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the lab. + /// + /// + /// The name of the shared gallery. + /// + /// + /// The name of the shared image. + /// + /// + /// The cancellation token. + /// + public static async Task DeleteAsync(this ISharedImagesOperations operations, string resourceGroupName, string labName, string sharedGalleryName, string name, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, labName, sharedGalleryName, name, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// Allows modifying tags of shared images. All other properties will be + /// ignored. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the lab. + /// + /// + /// The name of the shared gallery. + /// + /// + /// The name of the shared image. + /// + /// + /// Allows modifying tags of shared images. All other properties will be + /// ignored. + /// + public static SharedImage Update(this ISharedImagesOperations operations, string resourceGroupName, string labName, string sharedGalleryName, string name, SharedImageFragment sharedImage) + { + return operations.UpdateAsync(resourceGroupName, labName, sharedGalleryName, name, sharedImage).GetAwaiter().GetResult(); + } + + /// + /// Allows modifying tags of shared images. All other properties will be + /// ignored. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the lab. + /// + /// + /// The name of the shared gallery. + /// + /// + /// The name of the shared image. + /// + /// + /// Allows modifying tags of shared images. All other properties will be + /// ignored. + /// + /// + /// The cancellation token. + /// + public static async Task UpdateAsync(this ISharedImagesOperations operations, string resourceGroupName, string labName, string sharedGalleryName, string name, SharedImageFragment sharedImage, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.UpdateWithHttpMessagesAsync(resourceGroupName, labName, sharedGalleryName, name, sharedImage, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// List shared images in a given shared gallery. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage ListNext(this ISharedImagesOperations operations, string nextPageLink) + { + return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// List shared images in a given shared gallery. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async Task> ListNextAsync(this ISharedImagesOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +} diff --git a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/UsersOperations.cs b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/UsersOperations.cs index cf41d091a4c5..b47c8f09bb70 100644 --- a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/UsersOperations.cs +++ b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/UsersOperations.cs @@ -271,9 +271,6 @@ internal UsersOperations(DevTestLabsClient client) /// /// The name of the user profile. /// - /// - /// Specify the $expand query. Example: 'properties($select=identity)' - /// /// /// Headers that will be added to request. /// @@ -295,7 +292,7 @@ internal UsersOperations(DevTestLabsClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string labName, string name, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string labName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (Client.SubscriptionId == null) { @@ -327,7 +324,6 @@ internal UsersOperations(DevTestLabsClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("labName", labName); tracingParameters.Add("name", name); - tracingParameters.Add("expand", expand); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } @@ -339,10 +335,6 @@ internal UsersOperations(DevTestLabsClient client) _url = _url.Replace("{labName}", System.Uri.EscapeDataString(labName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); List _queryParameters = new List(); - if (expand != null) - { - _queryParameters.Add(string.Format("$expand={0}", System.Uri.EscapeDataString(expand))); - } if (Client.ApiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); @@ -527,7 +519,8 @@ internal UsersOperations(DevTestLabsClient client) } /// - /// Modify properties of user profiles. + /// Allows modifying tags of user profiles. All other properties will be + /// ignored. /// /// /// The name of the resource group. @@ -539,7 +532,8 @@ internal UsersOperations(DevTestLabsClient client) /// The name of the user profile. /// /// - /// Profile of a lab user. + /// Allows modifying tags of user profiles. All other properties will be + /// ignored. /// /// /// Headers that will be added to request. @@ -580,14 +574,14 @@ internal UsersOperations(DevTestLabsClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (user == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "user"); - } if (Client.ApiVersion == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } + if (user == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "user"); + } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -800,13 +794,17 @@ internal UsersOperations(DevTestLabsClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } if (user == null) { throw new ValidationException(ValidationRules.CannotBeNull, "user"); } - if (Client.ApiVersion == null) + if (user != null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + user.Validate(); } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; @@ -898,7 +896,7 @@ internal UsersOperations(DevTestLabsClient client) System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 201) + if ((int)_statusCode != 200 && (int)_statusCode != 201 && (int)_statusCode != 202) { var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try diff --git a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/UsersOperationsExtensions.cs b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/UsersOperationsExtensions.cs index dbafd0da6ced..e16dd8d9ebb9 100644 --- a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/UsersOperationsExtensions.cs +++ b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/UsersOperationsExtensions.cs @@ -83,12 +83,9 @@ public static partial class UsersOperationsExtensions /// /// The name of the user profile. /// - /// - /// Specify the $expand query. Example: 'properties($select=identity)' - /// - public static User Get(this IUsersOperations operations, string resourceGroupName, string labName, string name, string expand = default(string)) + public static User Get(this IUsersOperations operations, string resourceGroupName, string labName, string name) { - return operations.GetAsync(resourceGroupName, labName, name, expand).GetAwaiter().GetResult(); + return operations.GetAsync(resourceGroupName, labName, name).GetAwaiter().GetResult(); } /// @@ -106,15 +103,12 @@ public static partial class UsersOperationsExtensions /// /// The name of the user profile. /// - /// - /// Specify the $expand query. Example: 'properties($select=identity)' - /// /// /// The cancellation token. /// - public static async Task GetAsync(this IUsersOperations operations, string resourceGroupName, string labName, string name, string expand = default(string), CancellationToken cancellationToken = default(CancellationToken)) + public static async Task GetAsync(this IUsersOperations operations, string resourceGroupName, string labName, string name, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, labName, name, expand, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, labName, name, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } @@ -218,7 +212,8 @@ public static void Delete(this IUsersOperations operations, string resourceGroup } /// - /// Modify properties of user profiles. + /// Allows modifying tags of user profiles. All other properties will be + /// ignored. /// /// /// The operations group for this extension method. @@ -233,7 +228,8 @@ public static void Delete(this IUsersOperations operations, string resourceGroup /// The name of the user profile. /// /// - /// Profile of a lab user. + /// Allows modifying tags of user profiles. All other properties will be + /// ignored. /// public static User Update(this IUsersOperations operations, string resourceGroupName, string labName, string name, UserFragment user) { @@ -241,7 +237,8 @@ public static User Update(this IUsersOperations operations, string resourceGroup } /// - /// Modify properties of user profiles. + /// Allows modifying tags of user profiles. All other properties will be + /// ignored. /// /// /// The operations group for this extension method. @@ -256,7 +253,8 @@ public static User Update(this IUsersOperations operations, string resourceGroup /// The name of the user profile. /// /// - /// Profile of a lab user. + /// Allows modifying tags of user profiles. All other properties will be + /// ignored. /// /// /// The cancellation token. diff --git a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/VirtualMachineSchedulesOperations.cs b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/VirtualMachineSchedulesOperations.cs index e368d86af620..151ea94aef96 100644 --- a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/VirtualMachineSchedulesOperations.cs +++ b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/VirtualMachineSchedulesOperations.cs @@ -283,9 +283,6 @@ internal VirtualMachineSchedulesOperations(DevTestLabsClient client) /// /// The name of the schedule. /// - /// - /// Specify the $expand query. Example: 'properties($select=status)' - /// /// /// Headers that will be added to request. /// @@ -307,7 +304,7 @@ internal VirtualMachineSchedulesOperations(DevTestLabsClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string labName, string virtualMachineName, string name, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string labName, string virtualMachineName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (Client.SubscriptionId == null) { @@ -344,7 +341,6 @@ internal VirtualMachineSchedulesOperations(DevTestLabsClient client) tracingParameters.Add("labName", labName); tracingParameters.Add("virtualMachineName", virtualMachineName); tracingParameters.Add("name", name); - tracingParameters.Add("expand", expand); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } @@ -357,10 +353,6 @@ internal VirtualMachineSchedulesOperations(DevTestLabsClient client) _url = _url.Replace("{virtualMachineName}", System.Uri.EscapeDataString(virtualMachineName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); List _queryParameters = new List(); - if (expand != null) - { - _queryParameters.Add(string.Format("$expand={0}", System.Uri.EscapeDataString(expand))); - } if (Client.ApiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); @@ -555,6 +547,10 @@ internal VirtualMachineSchedulesOperations(DevTestLabsClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "schedule"); } + if (schedule != null) + { + schedule.Validate(); + } if (Client.ApiVersion == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); @@ -930,7 +926,7 @@ internal VirtualMachineSchedulesOperations(DevTestLabsClient client) } /// - /// Modify properties of schedules. + /// Allows modifying tags of schedules. All other properties will be ignored. /// /// /// The name of the resource group. @@ -945,7 +941,7 @@ internal VirtualMachineSchedulesOperations(DevTestLabsClient client) /// The name of the schedule. /// /// - /// A schedule. + /// Allows modifying tags of schedules. All other properties will be ignored. /// /// /// Headers that will be added to request. diff --git a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/VirtualMachineSchedulesOperationsExtensions.cs b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/VirtualMachineSchedulesOperationsExtensions.cs index 75a38f17fbf6..332adcc60de2 100644 --- a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/VirtualMachineSchedulesOperationsExtensions.cs +++ b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/VirtualMachineSchedulesOperationsExtensions.cs @@ -92,12 +92,9 @@ public static partial class VirtualMachineSchedulesOperationsExtensions /// /// The name of the schedule. /// - /// - /// Specify the $expand query. Example: 'properties($select=status)' - /// - public static Schedule Get(this IVirtualMachineSchedulesOperations operations, string resourceGroupName, string labName, string virtualMachineName, string name, string expand = default(string)) + public static Schedule Get(this IVirtualMachineSchedulesOperations operations, string resourceGroupName, string labName, string virtualMachineName, string name) { - return operations.GetAsync(resourceGroupName, labName, virtualMachineName, name, expand).GetAwaiter().GetResult(); + return operations.GetAsync(resourceGroupName, labName, virtualMachineName, name).GetAwaiter().GetResult(); } /// @@ -118,15 +115,12 @@ public static partial class VirtualMachineSchedulesOperationsExtensions /// /// The name of the schedule. /// - /// - /// Specify the $expand query. Example: 'properties($select=status)' - /// /// /// The cancellation token. /// - public static async Task GetAsync(this IVirtualMachineSchedulesOperations operations, string resourceGroupName, string labName, string virtualMachineName, string name, string expand = default(string), CancellationToken cancellationToken = default(CancellationToken)) + public static async Task GetAsync(this IVirtualMachineSchedulesOperations operations, string resourceGroupName, string labName, string virtualMachineName, string name, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, labName, virtualMachineName, name, expand, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, labName, virtualMachineName, name, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } @@ -240,7 +234,7 @@ public static void Delete(this IVirtualMachineSchedulesOperations operations, st } /// - /// Modify properties of schedules. + /// Allows modifying tags of schedules. All other properties will be ignored. /// /// /// The operations group for this extension method. @@ -258,7 +252,7 @@ public static void Delete(this IVirtualMachineSchedulesOperations operations, st /// The name of the schedule. /// /// - /// A schedule. + /// Allows modifying tags of schedules. All other properties will be ignored. /// public static Schedule Update(this IVirtualMachineSchedulesOperations operations, string resourceGroupName, string labName, string virtualMachineName, string name, ScheduleFragment schedule) { @@ -266,7 +260,7 @@ public static Schedule Update(this IVirtualMachineSchedulesOperations operations } /// - /// Modify properties of schedules. + /// Allows modifying tags of schedules. All other properties will be ignored. /// /// /// The operations group for this extension method. @@ -284,7 +278,7 @@ public static Schedule Update(this IVirtualMachineSchedulesOperations operations /// The name of the schedule. /// /// - /// A schedule. + /// Allows modifying tags of schedules. All other properties will be ignored. /// /// /// The cancellation token. diff --git a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/VirtualMachinesOperations.cs b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/VirtualMachinesOperations.cs index 4b46d6ef003e..f839acdf4566 100644 --- a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/VirtualMachinesOperations.cs +++ b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/VirtualMachinesOperations.cs @@ -528,7 +528,8 @@ internal VirtualMachinesOperations(DevTestLabsClient client) } /// - /// Modify properties of virtual machines. + /// Allows modifying tags of virtual machines. All other properties will be + /// ignored. /// /// /// The name of the resource group. @@ -540,7 +541,8 @@ internal VirtualMachinesOperations(DevTestLabsClient client) /// The name of the virtual machine. /// /// - /// A virtual machine. + /// Allows modifying tags of virtual machines. All other properties will be + /// ignored. /// /// /// Headers that will be added to request. @@ -830,6 +832,190 @@ internal VirtualMachinesOperations(DevTestLabsClient client) return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } + /// + /// Clears the artifact results of the virtual machine. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the lab. + /// + /// + /// The name of the virtual machine. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task ClearArtifactResultsWithHttpMessagesAsync(string resourceGroupName, string labName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (labName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "labName"); + } + if (name == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "name"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("labName", labName); + tracingParameters.Add("name", name); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ClearArtifactResults", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/virtualmachines/{name}/clearArtifactResults").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{labName}", System.Uri.EscapeDataString(labName)); + _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + 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("POST"); + _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); + } + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + 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); + } + _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(); + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + /// /// Detach the specified disk from the virtual machine. This operation can take /// a while to complete. @@ -1509,6 +1695,10 @@ internal VirtualMachinesOperations(DevTestLabsClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "labVirtualMachine"); } + if (labVirtualMachine != null) + { + labVirtualMachine.Validate(); + } if (Client.ApiVersion == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); @@ -1603,7 +1793,7 @@ internal VirtualMachinesOperations(DevTestLabsClient client) System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 201) + if ((int)_statusCode != 200 && (int)_statusCode != 201 && (int)_statusCode != 202) { var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try diff --git a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/VirtualMachinesOperationsExtensions.cs b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/VirtualMachinesOperationsExtensions.cs index 11bf99f21bbe..d971ca439891 100644 --- a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/VirtualMachinesOperationsExtensions.cs +++ b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/VirtualMachinesOperationsExtensions.cs @@ -220,7 +220,8 @@ public static void Delete(this IVirtualMachinesOperations operations, string res } /// - /// Modify properties of virtual machines. + /// Allows modifying tags of virtual machines. All other properties will be + /// ignored. /// /// /// The operations group for this extension method. @@ -235,7 +236,8 @@ public static void Delete(this IVirtualMachinesOperations operations, string res /// The name of the virtual machine. /// /// - /// A virtual machine. + /// Allows modifying tags of virtual machines. All other properties will be + /// ignored. /// public static LabVirtualMachine Update(this IVirtualMachinesOperations operations, string resourceGroupName, string labName, string name, LabVirtualMachineFragment labVirtualMachine) { @@ -243,7 +245,8 @@ public static LabVirtualMachine Update(this IVirtualMachinesOperations operation } /// - /// Modify properties of virtual machines. + /// Allows modifying tags of virtual machines. All other properties will be + /// ignored. /// /// /// The operations group for this extension method. @@ -258,7 +261,8 @@ public static LabVirtualMachine Update(this IVirtualMachinesOperations operation /// The name of the virtual machine. /// /// - /// A virtual machine. + /// Allows modifying tags of virtual machines. All other properties will be + /// ignored. /// /// /// The cancellation token. @@ -418,6 +422,49 @@ public static void Claim(this IVirtualMachinesOperations operations, string reso (await operations.ClaimWithHttpMessagesAsync(resourceGroupName, labName, name, null, cancellationToken).ConfigureAwait(false)).Dispose(); } + /// + /// Clears the artifact results of the virtual machine. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the lab. + /// + /// + /// The name of the virtual machine. + /// + public static void ClearArtifactResults(this IVirtualMachinesOperations operations, string resourceGroupName, string labName, string name) + { + operations.ClearArtifactResultsAsync(resourceGroupName, labName, name).GetAwaiter().GetResult(); + } + + /// + /// Clears the artifact results of the virtual machine. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the lab. + /// + /// + /// The name of the virtual machine. + /// + /// + /// The cancellation token. + /// + public static async Task ClearArtifactResultsAsync(this IVirtualMachinesOperations operations, string resourceGroupName, string labName, string name, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.ClearArtifactResultsWithHttpMessagesAsync(resourceGroupName, labName, name, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// /// Detach the specified disk from the virtual machine. This operation can take /// a while to complete. diff --git a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/VirtualNetworksOperations.cs b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/VirtualNetworksOperations.cs index 01098e514910..e4274247ef2d 100644 --- a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/VirtualNetworksOperations.cs +++ b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/VirtualNetworksOperations.cs @@ -527,7 +527,8 @@ internal VirtualNetworksOperations(DevTestLabsClient client) } /// - /// Modify properties of virtual networks. + /// Allows modifying tags of virtual networks. All other properties will be + /// ignored. /// /// /// The name of the resource group. @@ -539,7 +540,8 @@ internal VirtualNetworksOperations(DevTestLabsClient client) /// The name of the virtual network. /// /// - /// A virtual network. + /// Allows modifying tags of virtual networks. All other properties will be + /// ignored. /// /// /// Headers that will be added to request. @@ -804,6 +806,10 @@ internal VirtualNetworksOperations(DevTestLabsClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "virtualNetwork"); } + if (virtualNetwork != null) + { + virtualNetwork.Validate(); + } if (Client.ApiVersion == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); @@ -898,7 +904,7 @@ internal VirtualNetworksOperations(DevTestLabsClient client) System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 201) + if ((int)_statusCode != 200 && (int)_statusCode != 201 && (int)_statusCode != 202) { var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try diff --git a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/VirtualNetworksOperationsExtensions.cs b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/VirtualNetworksOperationsExtensions.cs index cc8334a6dd40..e9cde200ccff 100644 --- a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/VirtualNetworksOperationsExtensions.cs +++ b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/VirtualNetworksOperationsExtensions.cs @@ -218,7 +218,8 @@ public static void Delete(this IVirtualNetworksOperations operations, string res } /// - /// Modify properties of virtual networks. + /// Allows modifying tags of virtual networks. All other properties will be + /// ignored. /// /// /// The operations group for this extension method. @@ -233,7 +234,8 @@ public static void Delete(this IVirtualNetworksOperations operations, string res /// The name of the virtual network. /// /// - /// A virtual network. + /// Allows modifying tags of virtual networks. All other properties will be + /// ignored. /// public static VirtualNetwork Update(this IVirtualNetworksOperations operations, string resourceGroupName, string labName, string name, VirtualNetworkFragment virtualNetwork) { @@ -241,7 +243,8 @@ public static VirtualNetwork Update(this IVirtualNetworksOperations operations, } /// - /// Modify properties of virtual networks. + /// Allows modifying tags of virtual networks. All other properties will be + /// ignored. /// /// /// The operations group for this extension method. @@ -256,7 +259,8 @@ public static VirtualNetwork Update(this IVirtualNetworksOperations operations, /// The name of the virtual network. /// /// - /// A virtual network. + /// Allows modifying tags of virtual networks. All other properties will be + /// ignored. /// /// /// The cancellation token.