diff --git a/src/SDKs/DevSpaces/AzSdk.RP.props b/src/SDKs/DevSpaces/AzSdk.RP.props index 94688a1867d84..5f41a3f9ca964 100644 --- a/src/SDKs/DevSpaces/AzSdk.RP.props +++ b/src/SDKs/DevSpaces/AzSdk.RP.props @@ -1,7 +1,7 @@ - DevSpaces_2019-01-01-preview; + DevSpaces_2019-04-01; $(PackageTags);$(CommonTags);$(AzureApiTag); \ No newline at end of file diff --git a/src/SDKs/DevSpaces/Management.DevSpaces/Generated/ContainerHostMappingsOperations.cs b/src/SDKs/DevSpaces/Management.DevSpaces/Generated/ContainerHostMappingsOperations.cs index 51f455da16eba..8aecea7221387 100644 --- a/src/SDKs/DevSpaces/Management.DevSpaces/Generated/ContainerHostMappingsOperations.cs +++ b/src/SDKs/DevSpaces/Management.DevSpaces/Generated/ContainerHostMappingsOperations.cs @@ -69,7 +69,7 @@ internal ContainerHostMappingsOperations(DevSpacesManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -84,7 +84,7 @@ internal ContainerHostMappingsOperations(DevSpacesManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetContainerHostMappingWithHttpMessagesAsync(string resourceGroupName, string location, string containerHostResourceId = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetContainerHostMappingWithHttpMessagesAsync(string resourceGroupName, string location, string containerHostResourceId = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (Client.ApiVersion == null) { @@ -206,16 +206,15 @@ internal ContainerHostMappingsOperations(DevSpacesManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 204) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -225,10 +224,6 @@ internal ContainerHostMappingsOperations(DevSpacesManagementClient client) } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); @@ -241,7 +236,7 @@ internal ContainerHostMappingsOperations(DevSpacesManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -254,7 +249,7 @@ internal ContainerHostMappingsOperations(DevSpacesManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { diff --git a/src/SDKs/DevSpaces/Management.DevSpaces/Generated/ContainerHostMappingsOperationsExtensions.cs b/src/SDKs/DevSpaces/Management.DevSpaces/Generated/ContainerHostMappingsOperationsExtensions.cs index 7b2b08c3f483a..8c32366ff6924 100644 --- a/src/SDKs/DevSpaces/Management.DevSpaces/Generated/ContainerHostMappingsOperationsExtensions.cs +++ b/src/SDKs/DevSpaces/Management.DevSpaces/Generated/ContainerHostMappingsOperationsExtensions.cs @@ -37,7 +37,7 @@ public static partial class ContainerHostMappingsOperationsExtensions /// /// ARM ID of the Container Host resource /// - public static object GetContainerHostMapping(this IContainerHostMappingsOperations operations, string resourceGroupName, string location, string containerHostResourceId = default(string)) + public static ContainerHostMapping GetContainerHostMapping(this IContainerHostMappingsOperations operations, string resourceGroupName, string location, string containerHostResourceId = default(string)) { return operations.GetContainerHostMappingAsync(resourceGroupName, location, containerHostResourceId).GetAwaiter().GetResult(); } @@ -61,7 +61,7 @@ public static partial class ContainerHostMappingsOperationsExtensions /// /// The cancellation token. /// - public static async Task GetContainerHostMappingAsync(this IContainerHostMappingsOperations operations, string resourceGroupName, string location, string containerHostResourceId = default(string), CancellationToken cancellationToken = default(CancellationToken)) + public static async Task GetContainerHostMappingAsync(this IContainerHostMappingsOperations operations, string resourceGroupName, string location, string containerHostResourceId = default(string), CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.GetContainerHostMappingWithHttpMessagesAsync(resourceGroupName, location, containerHostResourceId, null, cancellationToken).ConfigureAwait(false)) { diff --git a/src/SDKs/DevSpaces/Management.DevSpaces/Generated/ControllersOperations.cs b/src/SDKs/DevSpaces/Management.DevSpaces/Generated/ControllersOperations.cs index 2cb6893403bdd..200613697a12a 100644 --- a/src/SDKs/DevSpaces/Management.DevSpaces/Generated/ControllersOperations.cs +++ b/src/SDKs/DevSpaces/Management.DevSpaces/Generated/ControllersOperations.cs @@ -947,6 +947,10 @@ internal ControllersOperations(DevSpacesManagementClient client) /// /// Name of the resource. /// + /// + /// Resource ID of the target container host mapped to the Azure Dev Spaces + /// Controller. + /// /// /// Headers that will be added to request. /// @@ -968,7 +972,7 @@ internal ControllersOperations(DevSpacesManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> ListConnectionDetailsWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> ListConnectionDetailsWithHttpMessagesAsync(string resourceGroupName, string name, string targetContainerHostResourceId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (Client.ApiVersion == null) { @@ -1012,6 +1016,15 @@ internal ControllersOperations(DevSpacesManagementClient client) throw new ValidationException(ValidationRules.Pattern, "name", "^[a-zA-Z0-9](-?[a-zA-Z0-9])*$"); } } + if (targetContainerHostResourceId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "targetContainerHostResourceId"); + } + ListConnectionDetailsParameters listConnectionDetailsParameters = new ListConnectionDetailsParameters(); + if (targetContainerHostResourceId != null) + { + listConnectionDetailsParameters.TargetContainerHostResourceId = targetContainerHostResourceId; + } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1021,6 +1034,7 @@ internal ControllersOperations(DevSpacesManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); + tracingParameters.Add("listConnectionDetailsParameters", listConnectionDetailsParameters); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "ListConnectionDetails", tracingParameters); } @@ -1073,6 +1087,12 @@ internal ControllersOperations(DevSpacesManagementClient client) // Serialize Request string _requestContent = null; + if(listConnectionDetailsParameters != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(listConnectionDetailsParameters, 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) { diff --git a/src/SDKs/DevSpaces/Management.DevSpaces/Generated/ControllersOperationsExtensions.cs b/src/SDKs/DevSpaces/Management.DevSpaces/Generated/ControllersOperationsExtensions.cs index 46a172f1fa40a..c6ea419e26aeb 100644 --- a/src/SDKs/DevSpaces/Management.DevSpaces/Generated/ControllersOperationsExtensions.cs +++ b/src/SDKs/DevSpaces/Management.DevSpaces/Generated/ControllersOperationsExtensions.cs @@ -314,9 +314,13 @@ public static IPage List(this IControllersOperations operations) /// /// Name of the resource. /// - public static ControllerConnectionDetailsList ListConnectionDetails(this IControllersOperations operations, string resourceGroupName, string name) + /// + /// Resource ID of the target container host mapped to the Azure Dev Spaces + /// Controller. + /// + public static ControllerConnectionDetailsList ListConnectionDetails(this IControllersOperations operations, string resourceGroupName, string name, string targetContainerHostResourceId) { - return operations.ListConnectionDetailsAsync(resourceGroupName, name).GetAwaiter().GetResult(); + return operations.ListConnectionDetailsAsync(resourceGroupName, name, targetContainerHostResourceId).GetAwaiter().GetResult(); } /// @@ -335,12 +339,16 @@ public static ControllerConnectionDetailsList ListConnectionDetails(this IContro /// /// Name of the resource. /// + /// + /// Resource ID of the target container host mapped to the Azure Dev Spaces + /// Controller. + /// /// /// The cancellation token. /// - public static async Task ListConnectionDetailsAsync(this IControllersOperations operations, string resourceGroupName, string name, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task ListConnectionDetailsAsync(this IControllersOperations operations, string resourceGroupName, string name, string targetContainerHostResourceId, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.ListConnectionDetailsWithHttpMessagesAsync(resourceGroupName, name, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ListConnectionDetailsWithHttpMessagesAsync(resourceGroupName, name, targetContainerHostResourceId, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } diff --git a/src/SDKs/DevSpaces/Management.DevSpaces/Generated/DevSpacesManagementClient.cs b/src/SDKs/DevSpaces/Management.DevSpaces/Generated/DevSpacesManagementClient.cs index df7cc0be9d6ad..9643f85b2f802 100644 --- a/src/SDKs/DevSpaces/Management.DevSpaces/Generated/DevSpacesManagementClient.cs +++ b/src/SDKs/DevSpaces/Management.DevSpaces/Generated/DevSpacesManagementClient.cs @@ -334,7 +334,7 @@ private void Initialize() Operations = new Operations(this); Controllers = new ControllersOperations(this); BaseUri = new System.Uri("https://management.azure.com"); - ApiVersion = "2019-01-01-preview"; + ApiVersion = "2019-04-01"; AcceptLanguage = "en-US"; LongRunningOperationRetryTimeout = 30; GenerateClientRequestId = true; diff --git a/src/SDKs/DevSpaces/Management.DevSpaces/Generated/IContainerHostMappingsOperations.cs b/src/SDKs/DevSpaces/Management.DevSpaces/Generated/IContainerHostMappingsOperations.cs index 73425f96c6126..313ddaa785e1e 100644 --- a/src/SDKs/DevSpaces/Management.DevSpaces/Generated/IContainerHostMappingsOperations.cs +++ b/src/SDKs/DevSpaces/Management.DevSpaces/Generated/IContainerHostMappingsOperations.cs @@ -42,7 +42,7 @@ public partial interface IContainerHostMappingsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -51,6 +51,6 @@ public partial interface IContainerHostMappingsOperations /// /// Thrown when a required parameter is null /// - Task> GetContainerHostMappingWithHttpMessagesAsync(string resourceGroupName, string location, string containerHostResourceId = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> GetContainerHostMappingWithHttpMessagesAsync(string resourceGroupName, string location, string containerHostResourceId = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); } } diff --git a/src/SDKs/DevSpaces/Management.DevSpaces/Generated/IControllersOperations.cs b/src/SDKs/DevSpaces/Management.DevSpaces/Generated/IControllersOperations.cs index df3e60cc207d3..954d943e8e02d 100644 --- a/src/SDKs/DevSpaces/Management.DevSpaces/Generated/IControllersOperations.cs +++ b/src/SDKs/DevSpaces/Management.DevSpaces/Generated/IControllersOperations.cs @@ -202,6 +202,10 @@ public partial interface IControllersOperations /// /// Name of the resource. /// + /// + /// Resource ID of the target container host mapped to the Azure Dev + /// Spaces Controller. + /// /// /// The headers that will be added to request. /// @@ -217,7 +221,7 @@ public partial interface IControllersOperations /// /// Thrown when a required parameter is null /// - Task> ListConnectionDetailsWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> ListConnectionDetailsWithHttpMessagesAsync(string resourceGroupName, string name, string targetContainerHostResourceId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Creates an Azure Dev Spaces Controller. /// diff --git a/src/SDKs/DevSpaces/Management.DevSpaces/Generated/Models/ControllerConnectionDetails.cs b/src/SDKs/DevSpaces/Management.DevSpaces/Generated/Models/ControllerConnectionDetails.cs index a428986d9a424..6b674910204fd 100644 --- a/src/SDKs/DevSpaces/Management.DevSpaces/Generated/Models/ControllerConnectionDetails.cs +++ b/src/SDKs/DevSpaces/Management.DevSpaces/Generated/Models/ControllerConnectionDetails.cs @@ -28,11 +28,8 @@ public ControllerConnectionDetails() /// Initializes a new instance of the ControllerConnectionDetails /// class. /// - /// Authentication key for communicating with - /// services. - public ControllerConnectionDetails(string authKey = default(string), OrchestratorSpecificConnectionDetails orchestratorSpecificConnectionDetails = default(OrchestratorSpecificConnectionDetails)) + public ControllerConnectionDetails(OrchestratorSpecificConnectionDetails orchestratorSpecificConnectionDetails = default(OrchestratorSpecificConnectionDetails)) { - AuthKey = authKey; OrchestratorSpecificConnectionDetails = orchestratorSpecificConnectionDetails; CustomInit(); } @@ -42,12 +39,6 @@ public ControllerConnectionDetails() /// partial void CustomInit(); - /// - /// Gets authentication key for communicating with services. - /// - [JsonProperty(PropertyName = "authKey")] - public string AuthKey { get; private set; } - /// /// [JsonProperty(PropertyName = "orchestratorSpecificConnectionDetails")] diff --git a/src/SDKs/DevSpaces/Management.DevSpaces/Generated/Models/ListConnectionDetailsParameters.cs b/src/SDKs/DevSpaces/Management.DevSpaces/Generated/Models/ListConnectionDetailsParameters.cs new file mode 100644 index 0000000000000..c9dc145eea0d2 --- /dev/null +++ b/src/SDKs/DevSpaces/Management.DevSpaces/Generated/Models/ListConnectionDetailsParameters.cs @@ -0,0 +1,71 @@ +// +// 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.DevSpaces.Models +{ + using Microsoft.Rest; + using Newtonsoft.Json; + using System.Linq; + + /// + /// Parameters for listing connection details of an Azure Dev Spaces + /// Controller. + /// + public partial class ListConnectionDetailsParameters + { + /// + /// Initializes a new instance of the ListConnectionDetailsParameters + /// class. + /// + public ListConnectionDetailsParameters() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ListConnectionDetailsParameters + /// class. + /// + /// Resource ID of the + /// target container host mapped to the Azure Dev Spaces + /// Controller. + public ListConnectionDetailsParameters(string targetContainerHostResourceId) + { + TargetContainerHostResourceId = targetContainerHostResourceId; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets resource ID of the target container host mapped to the + /// Azure Dev Spaces Controller. + /// + [JsonProperty(PropertyName = "targetContainerHostResourceId")] + public string TargetContainerHostResourceId { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (TargetContainerHostResourceId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "TargetContainerHostResourceId"); + } + } + } +} diff --git a/src/SDKs/DevSpaces/Management.DevSpaces/Generated/SdkInfo_DevSpacesManagementClient.cs b/src/SDKs/DevSpaces/Management.DevSpaces/Generated/SdkInfo_DevSpacesManagementClient.cs index ebe2ba9bcea96..a3d4326d85cd6 100644 --- a/src/SDKs/DevSpaces/Management.DevSpaces/Generated/SdkInfo_DevSpacesManagementClient.cs +++ b/src/SDKs/DevSpaces/Management.DevSpaces/Generated/SdkInfo_DevSpacesManagementClient.cs @@ -19,22 +19,11 @@ public static IEnumerable> ApiInfo_DevSpacesManage { return new Tuple[] { - new Tuple("DevSpaces", "ContainerHostMappings", "2019-01-01-preview"), - new Tuple("DevSpaces", "Controllers", "2019-01-01-preview"), - new Tuple("DevSpaces", "Operations", "2019-01-01-preview"), + new Tuple("DevSpaces", "ContainerHostMappings", "2019-04-01"), + new Tuple("DevSpaces", "Controllers", "2019-04-01"), + new Tuple("DevSpaces", "Operations", "2019-04-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/devspaces/resource-manager/readme.md --csharp --version=latest --reflect-api-versions --csharp-sdks-folder=D:\\Dev\\sanar-microsoft\\azure-sdk-for-net\\src\\SDKs"; - public static readonly String GithubForkName = "Azure"; - public static readonly String GithubBranchName = "master"; - public static readonly String GithubCommidId = "aa18874b5c74b41c0e1d94c1422bd4e000a448ec"; - public static readonly String CodeGenerationErrors = ""; - public static readonly String GithubRepoName = "azure-rest-api-specs"; - // END: Code Generation Metadata Section } } -