From 4dc900be3ef469ef4f140f01080fa561151757a3 Mon Sep 17 00:00:00 2001 From: Yazan Al-Alul Date: Tue, 14 May 2019 19:26:57 -0700 Subject: [PATCH 01/14] Bare-bones --- src/SDKs/HealthcareApis/AzSdk.RP.props | 7 +++++ src/SDKs/HealthcareApis/HealthcareApis.sln | 31 +++++++++++++++++++ ...ure.Management.HealthcareApis.Tests.csproj | 15 +++++++++ ...oft.Azure.Management.HealthcareApis.csproj | 25 +++++++++++++++ .../Properties/AssemblyInfo.cs | 18 +++++++++++ .../Properties/launchSettings.json | 3 ++ .../Management.HealthcareApis/generate.ps1 | 2 ++ 7 files changed, 101 insertions(+) create mode 100644 src/SDKs/HealthcareApis/AzSdk.RP.props create mode 100644 src/SDKs/HealthcareApis/HealthcareApis.sln create mode 100644 src/SDKs/HealthcareApis/Management.HealthcareApis.Tests/Microsoft.Azure.Management.HealthcareApis.Tests.csproj create mode 100644 src/SDKs/HealthcareApis/Management.HealthcareApis/Microsoft.Azure.Management.HealthcareApis.csproj create mode 100644 src/SDKs/HealthcareApis/Management.HealthcareApis/Properties/AssemblyInfo.cs create mode 100644 src/SDKs/HealthcareApis/Management.HealthcareApis/Properties/launchSettings.json create mode 100644 src/SDKs/HealthcareApis/Management.HealthcareApis/generate.ps1 diff --git a/src/SDKs/HealthcareApis/AzSdk.RP.props b/src/SDKs/HealthcareApis/AzSdk.RP.props new file mode 100644 index 0000000000000..b1d9a41b2f4bb --- /dev/null +++ b/src/SDKs/HealthcareApis/AzSdk.RP.props @@ -0,0 +1,7 @@ + + + + HealthcareApis_2018-08-20-preview; + $(PackageTags);$(CommonTags);$(AzureApiTag); + + \ No newline at end of file diff --git a/src/SDKs/HealthcareApis/HealthcareApis.sln b/src/SDKs/HealthcareApis/HealthcareApis.sln new file mode 100644 index 0000000000000..53eaa8d8e7951 --- /dev/null +++ b/src/SDKs/HealthcareApis/HealthcareApis.sln @@ -0,0 +1,31 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 15 +VisualStudioVersion = 15.0.28307.438 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft.Azure.Management.HealthcareApis", "Management.HealthcareApis\Microsoft.Azure.Management.HealthcareApis.csproj", "{6F4E6681-FA47-4FFC-8E02-32212FDEDDC9}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft.Azure.Management.HealthcareApis.Tests", "Management.HealthcareApis.Tests\Microsoft.Azure.Management.HealthcareApis.Tests.csproj", "{D395417C-1205-48E3-B4DD-0A17D591F656}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {6F4E6681-FA47-4FFC-8E02-32212FDEDDC9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {6F4E6681-FA47-4FFC-8E02-32212FDEDDC9}.Debug|Any CPU.Build.0 = Debug|Any CPU + {6F4E6681-FA47-4FFC-8E02-32212FDEDDC9}.Release|Any CPU.ActiveCfg = Release|Any CPU + {6F4E6681-FA47-4FFC-8E02-32212FDEDDC9}.Release|Any CPU.Build.0 = Release|Any CPU + {D395417C-1205-48E3-B4DD-0A17D591F656}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {D395417C-1205-48E3-B4DD-0A17D591F656}.Debug|Any CPU.Build.0 = Debug|Any CPU + {D395417C-1205-48E3-B4DD-0A17D591F656}.Release|Any CPU.ActiveCfg = Release|Any CPU + {D395417C-1205-48E3-B4DD-0A17D591F656}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {1BFC1207-8DBF-48D2-834F-C7E26B272818} + EndGlobalSection +EndGlobal diff --git a/src/SDKs/HealthcareApis/Management.HealthcareApis.Tests/Microsoft.Azure.Management.HealthcareApis.Tests.csproj b/src/SDKs/HealthcareApis/Management.HealthcareApis.Tests/Microsoft.Azure.Management.HealthcareApis.Tests.csproj new file mode 100644 index 0000000000000..d38f8fc29f873 --- /dev/null +++ b/src/SDKs/HealthcareApis/Management.HealthcareApis.Tests/Microsoft.Azure.Management.HealthcareApis.Tests.csproj @@ -0,0 +1,15 @@ + + + + Microsoft.Azure.Management.HealthcareApis.Tests + HealthcareApis.Tests Class Library + Microsoft.Azure.Management.HealthcareApis.Tests + 1.0.0 + true + {D395417C-1205-48E3-B4DD-0A17D591F656} + + + + + + \ No newline at end of file diff --git a/src/SDKs/HealthcareApis/Management.HealthcareApis/Microsoft.Azure.Management.HealthcareApis.csproj b/src/SDKs/HealthcareApis/Management.HealthcareApis/Microsoft.Azure.Management.HealthcareApis.csproj new file mode 100644 index 0000000000000..2105a6b50434b --- /dev/null +++ b/src/SDKs/HealthcareApis/Management.HealthcareApis/Microsoft.Azure.Management.HealthcareApis.csproj @@ -0,0 +1,25 @@ + + + + + + + Microsoft.Azure.Management.HealthcareApis + Provides management capabilities for Microsoft Azure Healthcare Apis. + Microsoft Azure Healthcare Apis Management + Microsoft.Azure.Management.HealthcareApis + 1.0.4-preview + Microsoft.Azure.Management.HealthcareApis + Microsoft Azure Healthcare Apis;HealthcareApis management;HealthcareApis; + Management SDK for Healthcare APIs. + + + + $(SdkTargetFx) + false + + + + + + diff --git a/src/SDKs/HealthcareApis/Management.HealthcareApis/Properties/AssemblyInfo.cs b/src/SDKs/HealthcareApis/Management.HealthcareApis/Properties/AssemblyInfo.cs new file mode 100644 index 0000000000000..ce20d37ebc755 --- /dev/null +++ b/src/SDKs/HealthcareApis/Management.HealthcareApis/Properties/AssemblyInfo.cs @@ -0,0 +1,18 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. + +using System.Reflection; +using System.Resources; +using System.Runtime.InteropServices; + +[assembly: AssemblyTitle("Microsoft Azure Healthcare APIs Management Library")] +[assembly: AssemblyDescription("Provides management functionality for Microsoft Azure Healthcare APIs Resources.")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("Microsoft")] +[assembly: AssemblyProduct("Microsoft Azure .NET SDK")] +[assembly: AssemblyCopyright("Copyright (c) Microsoft Corporation")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] +[assembly: NeutralResourcesLanguage("en")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/src/SDKs/HealthcareApis/Management.HealthcareApis/Properties/launchSettings.json b/src/SDKs/HealthcareApis/Management.HealthcareApis/Properties/launchSettings.json new file mode 100644 index 0000000000000..43e0c99c7595f --- /dev/null +++ b/src/SDKs/HealthcareApis/Management.HealthcareApis/Properties/launchSettings.json @@ -0,0 +1,3 @@ +{ + "profiles": {} +} \ No newline at end of file diff --git a/src/SDKs/HealthcareApis/Management.HealthcareApis/generate.ps1 b/src/SDKs/HealthcareApis/Management.HealthcareApis/generate.ps1 new file mode 100644 index 0000000000000..433aecddf5d44 --- /dev/null +++ b/src/SDKs/HealthcareApis/Management.HealthcareApis/generate.ps1 @@ -0,0 +1,2 @@ +Start-AutoRestCodeGenerationWithLocalConfig -ResourceProvider "healthcareapis/resource-manager" -AutoRestVersion "latest" -LocalConfigFilePath "C:/dev/yazanmsft/azure-rest-api-specs/specification/healthcareapis/resource-manager/readme.md" -SdkDirectory "C:/dev/yazanmsft/azure-sdk-for-net/src/SDKs/HealthcareApis/Management.HealthcareApis/Generated" -Namespace Microsoft.Azure.Management.HealthcareApis +# Start-AutoRestCodeGeneration -ResourceProvider "healthcareapis/resource-manager" -AutoRestVersion "latest" From cc282131b008fd8d7b88e324bd1d1af401ca6f79 Mon Sep 17 00:00:00 2001 From: Yazan Al-Alul Date: Tue, 14 May 2019 19:27:03 -0700 Subject: [PATCH 02/14] With generated code --- src/SDKs/HealthcareApis/AzSdk.RP.props | 2 +- .../HealthcareApisManagementClient.cs | 372 +++ .../IHealthcareApisManagementClient.cs | 89 + .../IMoveResourcesStatusOperations.cs | 48 + .../Generated/IOperationResultsOperations.cs | 48 + .../Generated/IOperations.cs | 64 + .../Generated/IServicesOperations.cs | 358 +++ .../Models/CheckNameAvailabilityParameters.cs | 78 + .../Generated/Models/ErrorDetails.cs | 47 + .../Generated/Models/ErrorDetailsException.cs | 57 + .../Generated/Models/ErrorDetailsInternal.cs | 63 + .../Models/MoveResourcesParameters.cs | 101 + .../Generated/Models/Operation.cs | 66 + .../Generated/Models/OperationDisplay.cs | 73 + .../Generated/Models/OperationResultStatus.cs | 21 + .../Models/OperationResultsDescription.cs | 87 + .../Generated/Models/Page.cs | 49 + .../Generated/Models/ProvisioningState.cs | 25 + .../Generated/Models/Resource.cs | 126 + .../Models/ServiceAccessPolicyEntry.cs | 70 + .../ServiceAuthenticationConfigurationInfo.cs | 66 + .../Models/ServiceCorsConfigurationInfo.cs | 84 + .../ServiceCosmosDbConfigurationInfo.cs | 50 + .../Models/ServiceNameUnavailabilityReason.cs | 56 + .../Generated/Models/ServicesDescription.cs | 72 + .../Models/ServicesNameAvailabilityInfo.cs | 69 + .../Models/ServicesPatchDescription.cs | 49 + .../Generated/Models/ServicesProperties.cs | 117 + .../MoveResourcesStatusOperations.cs | 251 ++ ...MoveResourcesStatusOperationsExtensions.cs | 61 + .../Generated/OperationResultsOperations.cs | 251 ++ .../OperationResultsOperationsExtensions.cs | 61 + .../Generated/Operations.cs | 376 +++ .../Generated/OperationsExtensions.cs | 83 + .../SdkInfo_HealthcareApisManagementClient.cs | 31 + .../Generated/ServicesOperations.cs | 2065 +++++++++++++++++ .../Generated/ServicesOperationsExtensions.cs | 563 +++++ src/SDKs/_metadata/healthcareapis_.txt | 11 + 38 files changed, 6159 insertions(+), 1 deletion(-) create mode 100644 src/SDKs/HealthcareApis/Management.HealthcareApis/Generated/HealthcareApisManagementClient.cs create mode 100644 src/SDKs/HealthcareApis/Management.HealthcareApis/Generated/IHealthcareApisManagementClient.cs create mode 100644 src/SDKs/HealthcareApis/Management.HealthcareApis/Generated/IMoveResourcesStatusOperations.cs create mode 100644 src/SDKs/HealthcareApis/Management.HealthcareApis/Generated/IOperationResultsOperations.cs create mode 100644 src/SDKs/HealthcareApis/Management.HealthcareApis/Generated/IOperations.cs create mode 100644 src/SDKs/HealthcareApis/Management.HealthcareApis/Generated/IServicesOperations.cs create mode 100644 src/SDKs/HealthcareApis/Management.HealthcareApis/Generated/Models/CheckNameAvailabilityParameters.cs create mode 100644 src/SDKs/HealthcareApis/Management.HealthcareApis/Generated/Models/ErrorDetails.cs create mode 100644 src/SDKs/HealthcareApis/Management.HealthcareApis/Generated/Models/ErrorDetailsException.cs create mode 100644 src/SDKs/HealthcareApis/Management.HealthcareApis/Generated/Models/ErrorDetailsInternal.cs create mode 100644 src/SDKs/HealthcareApis/Management.HealthcareApis/Generated/Models/MoveResourcesParameters.cs create mode 100644 src/SDKs/HealthcareApis/Management.HealthcareApis/Generated/Models/Operation.cs create mode 100644 src/SDKs/HealthcareApis/Management.HealthcareApis/Generated/Models/OperationDisplay.cs create mode 100644 src/SDKs/HealthcareApis/Management.HealthcareApis/Generated/Models/OperationResultStatus.cs create mode 100644 src/SDKs/HealthcareApis/Management.HealthcareApis/Generated/Models/OperationResultsDescription.cs create mode 100644 src/SDKs/HealthcareApis/Management.HealthcareApis/Generated/Models/Page.cs create mode 100644 src/SDKs/HealthcareApis/Management.HealthcareApis/Generated/Models/ProvisioningState.cs create mode 100644 src/SDKs/HealthcareApis/Management.HealthcareApis/Generated/Models/Resource.cs create mode 100644 src/SDKs/HealthcareApis/Management.HealthcareApis/Generated/Models/ServiceAccessPolicyEntry.cs create mode 100644 src/SDKs/HealthcareApis/Management.HealthcareApis/Generated/Models/ServiceAuthenticationConfigurationInfo.cs create mode 100644 src/SDKs/HealthcareApis/Management.HealthcareApis/Generated/Models/ServiceCorsConfigurationInfo.cs create mode 100644 src/SDKs/HealthcareApis/Management.HealthcareApis/Generated/Models/ServiceCosmosDbConfigurationInfo.cs create mode 100644 src/SDKs/HealthcareApis/Management.HealthcareApis/Generated/Models/ServiceNameUnavailabilityReason.cs create mode 100644 src/SDKs/HealthcareApis/Management.HealthcareApis/Generated/Models/ServicesDescription.cs create mode 100644 src/SDKs/HealthcareApis/Management.HealthcareApis/Generated/Models/ServicesNameAvailabilityInfo.cs create mode 100644 src/SDKs/HealthcareApis/Management.HealthcareApis/Generated/Models/ServicesPatchDescription.cs create mode 100644 src/SDKs/HealthcareApis/Management.HealthcareApis/Generated/Models/ServicesProperties.cs create mode 100644 src/SDKs/HealthcareApis/Management.HealthcareApis/Generated/MoveResourcesStatusOperations.cs create mode 100644 src/SDKs/HealthcareApis/Management.HealthcareApis/Generated/MoveResourcesStatusOperationsExtensions.cs create mode 100644 src/SDKs/HealthcareApis/Management.HealthcareApis/Generated/OperationResultsOperations.cs create mode 100644 src/SDKs/HealthcareApis/Management.HealthcareApis/Generated/OperationResultsOperationsExtensions.cs create mode 100644 src/SDKs/HealthcareApis/Management.HealthcareApis/Generated/Operations.cs create mode 100644 src/SDKs/HealthcareApis/Management.HealthcareApis/Generated/OperationsExtensions.cs create mode 100644 src/SDKs/HealthcareApis/Management.HealthcareApis/Generated/SdkInfo_HealthcareApisManagementClient.cs create mode 100644 src/SDKs/HealthcareApis/Management.HealthcareApis/Generated/ServicesOperations.cs create mode 100644 src/SDKs/HealthcareApis/Management.HealthcareApis/Generated/ServicesOperationsExtensions.cs create mode 100644 src/SDKs/_metadata/healthcareapis_.txt diff --git a/src/SDKs/HealthcareApis/AzSdk.RP.props b/src/SDKs/HealthcareApis/AzSdk.RP.props index b1d9a41b2f4bb..7fc4102df5a39 100644 --- a/src/SDKs/HealthcareApis/AzSdk.RP.props +++ b/src/SDKs/HealthcareApis/AzSdk.RP.props @@ -1,7 +1,7 @@  - HealthcareApis_2018-08-20-preview; + HealthcareApis_2018-08-20-preview;HealthcareApisManagementClient_2018-08-20-preview; $(PackageTags);$(CommonTags);$(AzureApiTag); \ No newline at end of file diff --git a/src/SDKs/HealthcareApis/Management.HealthcareApis/Generated/HealthcareApisManagementClient.cs b/src/SDKs/HealthcareApis/Management.HealthcareApis/Generated/HealthcareApisManagementClient.cs new file mode 100644 index 0000000000000..e115c14aca093 --- /dev/null +++ b/src/SDKs/HealthcareApis/Management.HealthcareApis/Generated/HealthcareApisManagementClient.cs @@ -0,0 +1,372 @@ +// +// 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.HealthcareApis +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Microsoft.Rest.Serialization; + using Models; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + using System.Net; + using System.Net.Http; + + /// + /// Azure Healthcare APIs Client + /// + public partial class HealthcareApisManagementClient : ServiceClient, IHealthcareApisManagementClient, IAzureClient + { + /// + /// The base URI of the service. + /// + public System.Uri BaseUri { get; set; } + + /// + /// Gets or sets json serialization settings. + /// + public JsonSerializerSettings SerializationSettings { get; private set; } + + /// + /// Gets or sets json deserialization settings. + /// + public JsonSerializerSettings DeserializationSettings { get; private set; } + + /// + /// Credentials needed for the client to connect to Azure. + /// + public ServiceClientCredentials Credentials { get; private set; } + + /// + /// The subscription identifier. + /// + public System.Guid SubscriptionId { get; set; } + + /// + /// The version of the API. + /// + public string ApiVersion { get; private set; } + + /// + /// The preferred language for the response. + /// + public string AcceptLanguage { get; set; } + + /// + /// The retry timeout in seconds for Long Running Operations. Default value is + /// 30. + /// + public int? LongRunningOperationRetryTimeout { get; set; } + + /// + /// Whether a unique x-ms-client-request-id should be generated. When set to + /// true a unique x-ms-client-request-id value is generated and included in + /// each request. Default is true. + /// + public bool? GenerateClientRequestId { get; set; } + + /// + /// Gets the IServicesOperations. + /// + public virtual IServicesOperations Services { get; private set; } + + /// + /// Gets the IOperations. + /// + public virtual IOperations Operations { get; private set; } + + /// + /// Gets the IOperationResultsOperations. + /// + public virtual IOperationResultsOperations OperationResults { get; private set; } + + /// + /// Gets the IMoveResourcesStatusOperations. + /// + public virtual IMoveResourcesStatusOperations MoveResourcesStatus { get; private set; } + + /// + /// Initializes a new instance of the HealthcareApisManagementClient class. + /// + /// + /// HttpClient to be used + /// + /// + /// True: will dispose the provided httpClient on calling HealthcareApisManagementClient.Dispose(). False: will not dispose provided httpClient + protected HealthcareApisManagementClient(HttpClient httpClient, bool disposeHttpClient) : base(httpClient, disposeHttpClient) + { + Initialize(); + } + + /// + /// Initializes a new instance of the HealthcareApisManagementClient class. + /// + /// + /// Optional. The delegating handlers to add to the http client pipeline. + /// + protected HealthcareApisManagementClient(params DelegatingHandler[] handlers) : base(handlers) + { + Initialize(); + } + + /// + /// Initializes a new instance of the HealthcareApisManagementClient class. + /// + /// + /// Optional. The http client handler used to handle http transport. + /// + /// + /// Optional. The delegating handlers to add to the http client pipeline. + /// + protected HealthcareApisManagementClient(HttpClientHandler rootHandler, params DelegatingHandler[] handlers) : base(rootHandler, handlers) + { + Initialize(); + } + + /// + /// Initializes a new instance of the HealthcareApisManagementClient class. + /// + /// + /// Optional. The base URI of the service. + /// + /// + /// Optional. The delegating handlers to add to the http client pipeline. + /// + /// + /// Thrown when a required parameter is null + /// + protected HealthcareApisManagementClient(System.Uri baseUri, params DelegatingHandler[] handlers) : this(handlers) + { + if (baseUri == null) + { + throw new System.ArgumentNullException("baseUri"); + } + BaseUri = baseUri; + } + + /// + /// Initializes a new instance of the HealthcareApisManagementClient class. + /// + /// + /// Optional. The base URI of the service. + /// + /// + /// Optional. The http client handler used to handle http transport. + /// + /// + /// Optional. The delegating handlers to add to the http client pipeline. + /// + /// + /// Thrown when a required parameter is null + /// + protected HealthcareApisManagementClient(System.Uri baseUri, HttpClientHandler rootHandler, params DelegatingHandler[] handlers) : this(rootHandler, handlers) + { + if (baseUri == null) + { + throw new System.ArgumentNullException("baseUri"); + } + BaseUri = baseUri; + } + + /// + /// Initializes a new instance of the HealthcareApisManagementClient class. + /// + /// + /// Required. Credentials needed for the client to connect to Azure. + /// + /// + /// Optional. The delegating handlers to add to the http client pipeline. + /// + /// + /// Thrown when a required parameter is null + /// + public HealthcareApisManagementClient(ServiceClientCredentials credentials, params DelegatingHandler[] handlers) : this(handlers) + { + if (credentials == null) + { + throw new System.ArgumentNullException("credentials"); + } + Credentials = credentials; + if (Credentials != null) + { + Credentials.InitializeServiceClient(this); + } + } + + /// + /// Initializes a new instance of the HealthcareApisManagementClient class. + /// + /// + /// Required. Credentials needed for the client to connect to Azure. + /// + /// + /// HttpClient to be used + /// + /// + /// True: will dispose the provided httpClient on calling HealthcareApisManagementClient.Dispose(). False: will not dispose provided httpClient + /// + /// Thrown when a required parameter is null + /// + public HealthcareApisManagementClient(ServiceClientCredentials credentials, HttpClient httpClient, bool disposeHttpClient) : this(httpClient, disposeHttpClient) + { + if (credentials == null) + { + throw new System.ArgumentNullException("credentials"); + } + Credentials = credentials; + if (Credentials != null) + { + Credentials.InitializeServiceClient(this); + } + } + + /// + /// Initializes a new instance of the HealthcareApisManagementClient class. + /// + /// + /// Required. Credentials needed for the client to connect to Azure. + /// + /// + /// Optional. The http client handler used to handle http transport. + /// + /// + /// Optional. The delegating handlers to add to the http client pipeline. + /// + /// + /// Thrown when a required parameter is null + /// + public HealthcareApisManagementClient(ServiceClientCredentials credentials, HttpClientHandler rootHandler, params DelegatingHandler[] handlers) : this(rootHandler, handlers) + { + if (credentials == null) + { + throw new System.ArgumentNullException("credentials"); + } + Credentials = credentials; + if (Credentials != null) + { + Credentials.InitializeServiceClient(this); + } + } + + /// + /// Initializes a new instance of the HealthcareApisManagementClient class. + /// + /// + /// Optional. The base URI of the service. + /// + /// + /// Required. Credentials needed for the client to connect to Azure. + /// + /// + /// Optional. The delegating handlers to add to the http client pipeline. + /// + /// + /// Thrown when a required parameter is null + /// + public HealthcareApisManagementClient(System.Uri baseUri, ServiceClientCredentials credentials, params DelegatingHandler[] handlers) : this(handlers) + { + if (baseUri == null) + { + throw new System.ArgumentNullException("baseUri"); + } + if (credentials == null) + { + throw new System.ArgumentNullException("credentials"); + } + BaseUri = baseUri; + Credentials = credentials; + if (Credentials != null) + { + Credentials.InitializeServiceClient(this); + } + } + + /// + /// Initializes a new instance of the HealthcareApisManagementClient class. + /// + /// + /// Optional. The base URI of the service. + /// + /// + /// Required. Credentials needed for the client to connect to Azure. + /// + /// + /// Optional. The http client handler used to handle http transport. + /// + /// + /// Optional. The delegating handlers to add to the http client pipeline. + /// + /// + /// Thrown when a required parameter is null + /// + public HealthcareApisManagementClient(System.Uri baseUri, ServiceClientCredentials credentials, HttpClientHandler rootHandler, params DelegatingHandler[] handlers) : this(rootHandler, handlers) + { + if (baseUri == null) + { + throw new System.ArgumentNullException("baseUri"); + } + if (credentials == null) + { + throw new System.ArgumentNullException("credentials"); + } + BaseUri = baseUri; + Credentials = credentials; + if (Credentials != null) + { + Credentials.InitializeServiceClient(this); + } + } + + /// + /// An optional partial-method to perform custom initialization. + /// + partial void CustomInitialize(); + /// + /// Initializes client properties. + /// + private void Initialize() + { + Services = new ServicesOperations(this); + Operations = new Operations(this); + OperationResults = new OperationResultsOperations(this); + MoveResourcesStatus = new MoveResourcesStatusOperations(this); + BaseUri = new System.Uri("https://management.azure.com"); + ApiVersion = "2018-08-20-preview"; + AcceptLanguage = "en-US"; + LongRunningOperationRetryTimeout = 30; + GenerateClientRequestId = true; + SerializationSettings = new JsonSerializerSettings + { + Formatting = Newtonsoft.Json.Formatting.Indented, + DateFormatHandling = Newtonsoft.Json.DateFormatHandling.IsoDateFormat, + DateTimeZoneHandling = Newtonsoft.Json.DateTimeZoneHandling.Utc, + NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore, + ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Serialize, + ContractResolver = new ReadOnlyJsonContractResolver(), + Converters = new List + { + new Iso8601TimeSpanConverter() + } + }; + DeserializationSettings = new JsonSerializerSettings + { + DateFormatHandling = Newtonsoft.Json.DateFormatHandling.IsoDateFormat, + DateTimeZoneHandling = Newtonsoft.Json.DateTimeZoneHandling.Utc, + NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore, + ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Serialize, + ContractResolver = new ReadOnlyJsonContractResolver(), + Converters = new List + { + new Iso8601TimeSpanConverter() + } + }; + CustomInitialize(); + DeserializationSettings.Converters.Add(new CloudErrorJsonConverter()); + } + } +} diff --git a/src/SDKs/HealthcareApis/Management.HealthcareApis/Generated/IHealthcareApisManagementClient.cs b/src/SDKs/HealthcareApis/Management.HealthcareApis/Generated/IHealthcareApisManagementClient.cs new file mode 100644 index 0000000000000..1b1f1b7656499 --- /dev/null +++ b/src/SDKs/HealthcareApis/Management.HealthcareApis/Generated/IHealthcareApisManagementClient.cs @@ -0,0 +1,89 @@ +// +// 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.HealthcareApis +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using Newtonsoft.Json; + + /// + /// Azure Healthcare APIs Client + /// + public partial interface IHealthcareApisManagementClient : System.IDisposable + { + /// + /// The base URI of the service. + /// + System.Uri BaseUri { get; set; } + + /// + /// Gets or sets json serialization settings. + /// + JsonSerializerSettings SerializationSettings { get; } + + /// + /// Gets or sets json deserialization settings. + /// + JsonSerializerSettings DeserializationSettings { get; } + + /// + /// Credentials needed for the client to connect to Azure. + /// + ServiceClientCredentials Credentials { get; } + + /// + /// The subscription identifier. + /// + System.Guid SubscriptionId { get; set; } + + /// + /// The version of the API. + /// + string ApiVersion { get; } + + /// + /// The preferred language for the response. + /// + string AcceptLanguage { get; set; } + + /// + /// The retry timeout in seconds for Long Running Operations. Default + /// value is 30. + /// + int? LongRunningOperationRetryTimeout { get; set; } + + /// + /// Whether a unique x-ms-client-request-id should be generated. When + /// set to true a unique x-ms-client-request-id value is generated and + /// included in each request. Default is true. + /// + bool? GenerateClientRequestId { get; set; } + + + /// + /// Gets the IServicesOperations. + /// + IServicesOperations Services { get; } + + /// + /// Gets the IOperations. + /// + IOperations Operations { get; } + + /// + /// Gets the IOperationResultsOperations. + /// + IOperationResultsOperations OperationResults { get; } + + /// + /// Gets the IMoveResourcesStatusOperations. + /// + IMoveResourcesStatusOperations MoveResourcesStatus { get; } + + } +} diff --git a/src/SDKs/HealthcareApis/Management.HealthcareApis/Generated/IMoveResourcesStatusOperations.cs b/src/SDKs/HealthcareApis/Management.HealthcareApis/Generated/IMoveResourcesStatusOperations.cs new file mode 100644 index 0000000000000..51922ed73101e --- /dev/null +++ b/src/SDKs/HealthcareApis/Management.HealthcareApis/Generated/IMoveResourcesStatusOperations.cs @@ -0,0 +1,48 @@ +// +// 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.HealthcareApis +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// MoveResourcesStatusOperations operations. + /// + public partial interface IMoveResourcesStatusOperations + { + /// + /// Get the operation result for a long running move operation. + /// + /// + /// The location of the operation. + /// + /// + /// The ID of the operation result to get. + /// + /// + /// 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 locationName, string operationResultId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/src/SDKs/HealthcareApis/Management.HealthcareApis/Generated/IOperationResultsOperations.cs b/src/SDKs/HealthcareApis/Management.HealthcareApis/Generated/IOperationResultsOperations.cs new file mode 100644 index 0000000000000..5c4ece3789fc0 --- /dev/null +++ b/src/SDKs/HealthcareApis/Management.HealthcareApis/Generated/IOperationResultsOperations.cs @@ -0,0 +1,48 @@ +// +// 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.HealthcareApis +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// OperationResultsOperations operations. + /// + public partial interface IOperationResultsOperations + { + /// + /// Get the operation result for a long running operation. + /// + /// + /// The location of the operation. + /// + /// + /// The ID of the operation result to get. + /// + /// + /// 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 locationName, string operationResultId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/src/SDKs/HealthcareApis/Management.HealthcareApis/Generated/IOperations.cs b/src/SDKs/HealthcareApis/Management.HealthcareApis/Generated/IOperations.cs new file mode 100644 index 0000000000000..5d85ad3e8bcbb --- /dev/null +++ b/src/SDKs/HealthcareApis/Management.HealthcareApis/Generated/IOperations.cs @@ -0,0 +1,64 @@ +// +// 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.HealthcareApis +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Operations operations. + /// + public partial interface IOperations + { + /// + /// Lists all of the available Healthcare service REST API operations. + /// + /// + /// 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(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Lists all of the available Healthcare service REST API operations. + /// + /// + /// 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/src/SDKs/HealthcareApis/Management.HealthcareApis/Generated/IServicesOperations.cs b/src/SDKs/HealthcareApis/Management.HealthcareApis/Generated/IServicesOperations.cs new file mode 100644 index 0000000000000..3be537fba7f10 --- /dev/null +++ b/src/SDKs/HealthcareApis/Management.HealthcareApis/Generated/IServicesOperations.cs @@ -0,0 +1,358 @@ +// +// 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.HealthcareApis +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// ServicesOperations operations. + /// + public partial interface IServicesOperations + { + /// + /// Get the metadata of a service instance. + /// + /// + /// The name of the resource group that contains the service instance. + /// + /// + /// The name of the service instance. + /// + /// + /// 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 resourceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Create or update the metadata of a service instance. + /// + /// + /// The name of the resource group that contains the service instance. + /// + /// + /// The name of the service instance. + /// + /// + /// The service instance metadata. + /// + /// + /// 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 resourceName, ServicesDescription serviceDescription, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Update the metadata of a service instance. + /// + /// + /// The name of the resource group that contains the service instance. + /// + /// + /// The name of the service instance. + /// + /// + /// The service instance metadata and security metadata. + /// + /// + /// 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 resourceName, ServicesPatchDescription servicePatchDescription, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Delete a service instance. + /// + /// + /// The name of the resource group that contains the service instance. + /// + /// + /// The name of the service instance. + /// + /// + /// 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 resourceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Get all the service instances in a subscription. + /// + /// + /// 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(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Get all the service instances in a resource group. + /// + /// + /// The name of the resource group that contains the service instance. + /// + /// + /// 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>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Check if a service instance name is available. + /// + /// + /// Set the name parameter in the CheckNameAvailabilityParameters + /// structure to the name of the service instance to check. + /// + /// + /// 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> CheckNameAvailabilityWithHttpMessagesAsync(CheckNameAvailabilityParameters checkNameAvailabilityInputs, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Moves resources to another subscription and/or resource group. + /// + /// + /// The name of the resource group that contains the service instance. + /// + /// + /// Set the move resource structure to the name of the service instance + /// to check. + /// + /// + /// 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 MoveResourcesWithHttpMessagesAsync(string resourceGroupName, MoveResourcesParameters moveResourcesInputs, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Create or update the metadata of a service instance. + /// + /// + /// The name of the resource group that contains the service instance. + /// + /// + /// The name of the service instance. + /// + /// + /// The service instance metadata. + /// + /// + /// 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 resourceName, ServicesDescription serviceDescription, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Update the metadata of a service instance. + /// + /// + /// The name of the resource group that contains the service instance. + /// + /// + /// The name of the service instance. + /// + /// + /// The service instance metadata and security metadata. + /// + /// + /// 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> BeginUpdateWithHttpMessagesAsync(string resourceGroupName, string resourceName, ServicesPatchDescription servicePatchDescription, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Delete a service instance. + /// + /// + /// The name of the resource group that contains the service instance. + /// + /// + /// The name of the service instance. + /// + /// + /// 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 resourceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Moves resources to another subscription and/or resource group. + /// + /// + /// The name of the resource group that contains the service instance. + /// + /// + /// Set the move resource structure to the name of the service instance + /// to check. + /// + /// + /// 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 BeginMoveResourcesWithHttpMessagesAsync(string resourceGroupName, MoveResourcesParameters moveResourcesInputs, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Get all the service instances in a subscription. + /// + /// + /// 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)); + /// + /// Get all the service instances in a resource group. + /// + /// + /// 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>> ListByResourceGroupNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/src/SDKs/HealthcareApis/Management.HealthcareApis/Generated/Models/CheckNameAvailabilityParameters.cs b/src/SDKs/HealthcareApis/Management.HealthcareApis/Generated/Models/CheckNameAvailabilityParameters.cs new file mode 100644 index 0000000000000..d7b921929f729 --- /dev/null +++ b/src/SDKs/HealthcareApis/Management.HealthcareApis/Generated/Models/CheckNameAvailabilityParameters.cs @@ -0,0 +1,78 @@ +// +// 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.HealthcareApis.Models +{ + using Microsoft.Rest; + using Newtonsoft.Json; + using System.Linq; + + /// + /// Input values. + /// + public partial class CheckNameAvailabilityParameters + { + /// + /// Initializes a new instance of the CheckNameAvailabilityParameters + /// class. + /// + public CheckNameAvailabilityParameters() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the CheckNameAvailabilityParameters + /// class. + /// + /// The name of the service instance to + /// check. + /// The fully qualified resource type which includes + /// provider namespace. + public CheckNameAvailabilityParameters(string name, string type) + { + Name = name; + Type = type; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the name of the service instance to check. + /// + [JsonProperty(PropertyName = "name")] + public string Name { get; set; } + + /// + /// Gets or sets the fully qualified resource type which includes + /// provider namespace. + /// + [JsonProperty(PropertyName = "type")] + public string Type { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (Name == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Name"); + } + if (Type == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Type"); + } + } + } +} diff --git a/src/SDKs/HealthcareApis/Management.HealthcareApis/Generated/Models/ErrorDetails.cs b/src/SDKs/HealthcareApis/Management.HealthcareApis/Generated/Models/ErrorDetails.cs new file mode 100644 index 0000000000000..7efd99ca80069 --- /dev/null +++ b/src/SDKs/HealthcareApis/Management.HealthcareApis/Generated/Models/ErrorDetails.cs @@ -0,0 +1,47 @@ +// +// 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.HealthcareApis.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Error details. + /// + public partial class ErrorDetails + { + /// + /// Initializes a new instance of the ErrorDetails class. + /// + public ErrorDetails() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ErrorDetails class. + /// + /// Object containing error details. + public ErrorDetails(ErrorDetailsInternal error = default(ErrorDetailsInternal)) + { + Error = error; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets object containing error details. + /// + [JsonProperty(PropertyName = "error")] + public ErrorDetailsInternal Error { get; set; } + + } +} diff --git a/src/SDKs/HealthcareApis/Management.HealthcareApis/Generated/Models/ErrorDetailsException.cs b/src/SDKs/HealthcareApis/Management.HealthcareApis/Generated/Models/ErrorDetailsException.cs new file mode 100644 index 0000000000000..df005f0d4337d --- /dev/null +++ b/src/SDKs/HealthcareApis/Management.HealthcareApis/Generated/Models/ErrorDetailsException.cs @@ -0,0 +1,57 @@ +// +// 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.HealthcareApis.Models +{ + using Microsoft.Rest; + + /// + /// Exception thrown for an invalid response with ErrorDetails information. + /// + public partial class ErrorDetailsException : RestException + { + /// + /// Gets information about the associated HTTP request. + /// + public HttpRequestMessageWrapper Request { get; set; } + + /// + /// Gets information about the associated HTTP response. + /// + public HttpResponseMessageWrapper Response { get; set; } + + /// + /// Gets or sets the body object. + /// + public ErrorDetails Body { get; set; } + + /// + /// Initializes a new instance of the ErrorDetailsException class. + /// + public ErrorDetailsException() + { + } + + /// + /// Initializes a new instance of the ErrorDetailsException class. + /// + /// The exception message. + public ErrorDetailsException(string message) + : this(message, null) + { + } + + /// + /// Initializes a new instance of the ErrorDetailsException class. + /// + /// The exception message. + /// Inner exception. + public ErrorDetailsException(string message, System.Exception innerException) + : base(message, innerException) + { + } + } +} diff --git a/src/SDKs/HealthcareApis/Management.HealthcareApis/Generated/Models/ErrorDetailsInternal.cs b/src/SDKs/HealthcareApis/Management.HealthcareApis/Generated/Models/ErrorDetailsInternal.cs new file mode 100644 index 0000000000000..8e45af4cffdfc --- /dev/null +++ b/src/SDKs/HealthcareApis/Management.HealthcareApis/Generated/Models/ErrorDetailsInternal.cs @@ -0,0 +1,63 @@ +// +// 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.HealthcareApis.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Error details. + /// + public partial class ErrorDetailsInternal + { + /// + /// Initializes a new instance of the ErrorDetailsInternal class. + /// + public ErrorDetailsInternal() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ErrorDetailsInternal class. + /// + /// The error code. + /// The error message. + /// The target of the particular error. + public ErrorDetailsInternal(string code = default(string), string message = default(string), string target = default(string)) + { + Code = code; + Message = message; + Target = target; + 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 target of the particular error. + /// + [JsonProperty(PropertyName = "target")] + public string Target { get; private set; } + + } +} diff --git a/src/SDKs/HealthcareApis/Management.HealthcareApis/Generated/Models/MoveResourcesParameters.cs b/src/SDKs/HealthcareApis/Management.HealthcareApis/Generated/Models/MoveResourcesParameters.cs new file mode 100644 index 0000000000000..ba45d3bb6023a --- /dev/null +++ b/src/SDKs/HealthcareApis/Management.HealthcareApis/Generated/Models/MoveResourcesParameters.cs @@ -0,0 +1,101 @@ +// +// 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.HealthcareApis.Models +{ + using Microsoft.Rest; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Input values. + /// + public partial class MoveResourcesParameters + { + /// + /// Initializes a new instance of the MoveResourcesParameters class. + /// + public MoveResourcesParameters() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the MoveResourcesParameters class. + /// + /// The target subscription to move + /// resources to. + /// The target resource group to + /// move resources to. + /// The list of resources to + /// move. + public MoveResourcesParameters(string targetSubscriptionId, string targetResourceGroupName, IList resourceIdsToMove) + { + TargetSubscriptionId = targetSubscriptionId; + TargetResourceGroupName = targetResourceGroupName; + ResourceIdsToMove = resourceIdsToMove; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the target subscription to move resources to. + /// + [JsonProperty(PropertyName = "targetSubscriptionId")] + public string TargetSubscriptionId { get; set; } + + /// + /// Gets or sets the target resource group to move resources to. + /// + [JsonProperty(PropertyName = "targetResourceGroupName")] + public string TargetResourceGroupName { get; set; } + + /// + /// Gets or sets the list of resources to move. + /// + [JsonProperty(PropertyName = "resourceIdsToMove")] + public IList ResourceIdsToMove { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (TargetSubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "TargetSubscriptionId"); + } + if (TargetResourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "TargetResourceGroupName"); + } + if (ResourceIdsToMove == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "ResourceIdsToMove"); + } + if (ResourceIdsToMove != null) + { + if (ResourceIdsToMove.Count > 250) + { + throw new ValidationException(ValidationRules.MaxItems, "ResourceIdsToMove", 250); + } + if (ResourceIdsToMove.Count < 1) + { + throw new ValidationException(ValidationRules.MinItems, "ResourceIdsToMove", 1); + } + } + } + } +} diff --git a/src/SDKs/HealthcareApis/Management.HealthcareApis/Generated/Models/Operation.cs b/src/SDKs/HealthcareApis/Management.HealthcareApis/Generated/Models/Operation.cs new file mode 100644 index 0000000000000..bce4b4571756d --- /dev/null +++ b/src/SDKs/HealthcareApis/Management.HealthcareApis/Generated/Models/Operation.cs @@ -0,0 +1,66 @@ +// +// 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.HealthcareApis.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Service REST API operation. + /// + public partial class Operation + { + /// + /// Initializes a new instance of the Operation class. + /// + public Operation() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the Operation class. + /// + /// Operation name: {provider}/{resource}/{read | + /// write | action | delete} + /// Default value is 'user,system'. + /// The information displayed about the + /// operation. + public Operation(string name = default(string), string origin = default(string), OperationDisplay display = default(OperationDisplay)) + { + Name = name; + Origin = origin; + Display = display; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets operation name: {provider}/{resource}/{read | write | action | + /// delete} + /// + [JsonProperty(PropertyName = "name")] + public string Name { get; private set; } + + /// + /// Gets default value is 'user,system'. + /// + [JsonProperty(PropertyName = "origin")] + public string Origin { get; private set; } + + /// + /// Gets or sets the information displayed about the operation. + /// + [JsonProperty(PropertyName = "display")] + public OperationDisplay Display { get; set; } + + } +} diff --git a/src/SDKs/HealthcareApis/Management.HealthcareApis/Generated/Models/OperationDisplay.cs b/src/SDKs/HealthcareApis/Management.HealthcareApis/Generated/Models/OperationDisplay.cs new file mode 100644 index 0000000000000..7901e4c54a78f --- /dev/null +++ b/src/SDKs/HealthcareApis/Management.HealthcareApis/Generated/Models/OperationDisplay.cs @@ -0,0 +1,73 @@ +// +// 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.HealthcareApis.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// The object that represents the operation. + /// + public partial class OperationDisplay + { + /// + /// Initializes a new instance of the OperationDisplay class. + /// + public OperationDisplay() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the OperationDisplay class. + /// + /// Service provider: + /// Microsoft.HealthcareApis + /// Resource Type: Services + /// Name of the operation + /// Friendly description for the + /// operation, + 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 service provider: Microsoft.HealthcareApis + /// + [JsonProperty(PropertyName = "provider")] + public string Provider { get; private set; } + + /// + /// Gets resource Type: Services + /// + [JsonProperty(PropertyName = "resource")] + public string Resource { get; private set; } + + /// + /// Gets name of the operation + /// + [JsonProperty(PropertyName = "operation")] + public string Operation { get; private set; } + + /// + /// Gets friendly description for the operation, + /// + [JsonProperty(PropertyName = "description")] + public string Description { get; private set; } + + } +} diff --git a/src/SDKs/HealthcareApis/Management.HealthcareApis/Generated/Models/OperationResultStatus.cs b/src/SDKs/HealthcareApis/Management.HealthcareApis/Generated/Models/OperationResultStatus.cs new file mode 100644 index 0000000000000..0e20a2da54038 --- /dev/null +++ b/src/SDKs/HealthcareApis/Management.HealthcareApis/Generated/Models/OperationResultStatus.cs @@ -0,0 +1,21 @@ +// +// 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.HealthcareApis.Models +{ + + /// + /// Defines values for OperationResultStatus. + /// + public static class OperationResultStatus + { + public const string Canceled = "Canceled"; + public const string Succeeded = "Succeeded"; + public const string Failed = "Failed"; + public const string Requested = "Requested"; + public const string Running = "Running"; + } +} diff --git a/src/SDKs/HealthcareApis/Management.HealthcareApis/Generated/Models/OperationResultsDescription.cs b/src/SDKs/HealthcareApis/Management.HealthcareApis/Generated/Models/OperationResultsDescription.cs new file mode 100644 index 0000000000000..c35100b6a4fa0 --- /dev/null +++ b/src/SDKs/HealthcareApis/Management.HealthcareApis/Generated/Models/OperationResultsDescription.cs @@ -0,0 +1,87 @@ +// +// 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.HealthcareApis.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// The properties indicating the operation result of an operation on a + /// service. + /// + public partial class OperationResultsDescription + { + /// + /// Initializes a new instance of the OperationResultsDescription + /// class. + /// + public OperationResultsDescription() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the OperationResultsDescription + /// class. + /// + /// The ID of the operation returned. + /// The name of the operation result. + /// The status of the operation being performed. + /// Possible values include: 'Canceled', 'Succeeded', 'Failed', + /// 'Requested', 'Running' + /// The time that the operation was + /// started. + /// Additional properties of the operation + /// result. + public OperationResultsDescription(string id = default(string), string name = default(string), string status = default(string), string startTime = default(string), object properties = default(object)) + { + Id = id; + Name = name; + Status = status; + StartTime = startTime; + Properties = properties; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets the ID of the operation returned. + /// + [JsonProperty(PropertyName = "id")] + public string Id { get; private set; } + + /// + /// Gets the name of the operation result. + /// + [JsonProperty(PropertyName = "name")] + public string Name { get; private set; } + + /// + /// Gets the status of the operation being performed. Possible values + /// include: 'Canceled', 'Succeeded', 'Failed', 'Requested', 'Running' + /// + [JsonProperty(PropertyName = "status")] + public string Status { get; private set; } + + /// + /// Gets the time that the operation was started. + /// + [JsonProperty(PropertyName = "startTime")] + public string StartTime { get; private set; } + + /// + /// Gets or sets additional properties of the operation result. + /// + [JsonProperty(PropertyName = "properties")] + public object Properties { get; set; } + + } +} diff --git a/src/SDKs/HealthcareApis/Management.HealthcareApis/Generated/Models/Page.cs b/src/SDKs/HealthcareApis/Management.HealthcareApis/Generated/Models/Page.cs new file mode 100644 index 0000000000000..2fb3bee656df8 --- /dev/null +++ b/src/SDKs/HealthcareApis/Management.HealthcareApis/Generated/Models/Page.cs @@ -0,0 +1,49 @@ +// +// 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.HealthcareApis.Models +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + + /// + /// Defines a page in Azure responses. + /// + /// Type of the page content items + [JsonObject] + public class Page : IPage + { + /// + /// Gets the link to the next page. + /// + [JsonProperty("nextLink")] + public string NextPageLink { get; private set; } + + [JsonProperty("value")] + private IList Items{ get; set; } + + /// + /// Returns an enumerator that iterates through the collection. + /// + /// A an enumerator that can be used to iterate through the collection. + public IEnumerator GetEnumerator() + { + return Items == null ? System.Linq.Enumerable.Empty().GetEnumerator() : Items.GetEnumerator(); + } + + /// + /// Returns an enumerator that iterates through the collection. + /// + /// A an enumerator that can be used to iterate through the collection. + IEnumerator IEnumerable.GetEnumerator() + { + return GetEnumerator(); + } + } +} diff --git a/src/SDKs/HealthcareApis/Management.HealthcareApis/Generated/Models/ProvisioningState.cs b/src/SDKs/HealthcareApis/Management.HealthcareApis/Generated/Models/ProvisioningState.cs new file mode 100644 index 0000000000000..8b600cd153003 --- /dev/null +++ b/src/SDKs/HealthcareApis/Management.HealthcareApis/Generated/Models/ProvisioningState.cs @@ -0,0 +1,25 @@ +// +// 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.HealthcareApis.Models +{ + + /// + /// Defines values for ProvisioningState. + /// + public static class ProvisioningState + { + public const string Deleting = "Deleting"; + public const string Succeeded = "Succeeded"; + public const string Creating = "Creating"; + public const string Accepted = "Accepted"; + public const string Verifying = "Verifying"; + public const string Updating = "Updating"; + public const string Failed = "Failed"; + public const string Canceled = "Canceled"; + public const string Deprovisioned = "Deprovisioned"; + } +} diff --git a/src/SDKs/HealthcareApis/Management.HealthcareApis/Generated/Models/Resource.cs b/src/SDKs/HealthcareApis/Management.HealthcareApis/Generated/Models/Resource.cs new file mode 100644 index 0000000000000..275c4e153f006 --- /dev/null +++ b/src/SDKs/HealthcareApis/Management.HealthcareApis/Generated/Models/Resource.cs @@ -0,0 +1,126 @@ +// +// 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.HealthcareApis.Models +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// The common properties of a service. + /// + public partial class Resource : IResource + { + /// + /// Initializes a new instance of the Resource class. + /// + public Resource() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the Resource class. + /// + /// The resource location. + /// The resource identifier. + /// The resource name. + /// The resource type. + /// The resource tags. + /// An etag associated with the resource, used for + /// optimistic concurrency when editing it. + public Resource(string location, string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), string etag = default(string)) + { + Id = id; + Name = name; + Type = type; + Location = location; + Tags = tags; + Etag = etag; + CustomInit(); + } + /// + /// Static constructor for Resource class. + /// + static Resource() + { + Kind = "fhir"; + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets the resource identifier. + /// + [JsonProperty(PropertyName = "id")] + public string Id { get; private set; } + + /// + /// Gets the resource name. + /// + [JsonProperty(PropertyName = "name")] + public string Name { get; private set; } + + /// + /// Gets the resource type. + /// + [JsonProperty(PropertyName = "type")] + public string Type { get; private set; } + + /// + /// Gets or sets the resource location. + /// + [JsonProperty(PropertyName = "location")] + public string Location { get; set; } + + /// + /// Gets or sets the resource tags. + /// + [JsonProperty(PropertyName = "tags")] + public IDictionary Tags { get; set; } + + /// + /// Gets or sets an etag associated with the resource, used for + /// optimistic concurrency when editing it. + /// + [JsonProperty(PropertyName = "etag")] + public string Etag { get; set; } + + /// + /// The kind of the service. Valid values are: fhir. + /// + [JsonProperty(PropertyName = "kind")] + public static string Kind { get; private set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (Location == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Location"); + } + if (Name != null) + { + if (!System.Text.RegularExpressions.Regex.IsMatch(Name, "^[a-z0-9][a-z0-9-]{1,21}[a-z0-9]$")) + { + throw new ValidationException(ValidationRules.Pattern, "Name", "^[a-z0-9][a-z0-9-]{1,21}[a-z0-9]$"); + } + } + } + } +} diff --git a/src/SDKs/HealthcareApis/Management.HealthcareApis/Generated/Models/ServiceAccessPolicyEntry.cs b/src/SDKs/HealthcareApis/Management.HealthcareApis/Generated/Models/ServiceAccessPolicyEntry.cs new file mode 100644 index 0000000000000..0997692ab85dd --- /dev/null +++ b/src/SDKs/HealthcareApis/Management.HealthcareApis/Generated/Models/ServiceAccessPolicyEntry.cs @@ -0,0 +1,70 @@ +// +// 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.HealthcareApis.Models +{ + using Microsoft.Rest; + using Newtonsoft.Json; + using System.Linq; + + /// + /// An access policy entry. + /// + public partial class ServiceAccessPolicyEntry + { + /// + /// Initializes a new instance of the ServiceAccessPolicyEntry class. + /// + public ServiceAccessPolicyEntry() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ServiceAccessPolicyEntry class. + /// + /// An object ID that is allowed access to the + /// FHIR service. + public ServiceAccessPolicyEntry(string objectId) + { + ObjectId = objectId; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets an object ID that is allowed access to the FHIR + /// service. + /// + [JsonProperty(PropertyName = "objectId")] + public string ObjectId { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (ObjectId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "ObjectId"); + } + if (ObjectId != null) + { + if (!System.Text.RegularExpressions.Regex.IsMatch(ObjectId, "^(([0-9A-Fa-f]{8}[-]?(?:[0-9A-Fa-f]{4}[-]?){3}[0-9A-Fa-f]{12}){1})+$")) + { + throw new ValidationException(ValidationRules.Pattern, "ObjectId", "^(([0-9A-Fa-f]{8}[-]?(?:[0-9A-Fa-f]{4}[-]?){3}[0-9A-Fa-f]{12}){1})+$"); + } + } + } + } +} diff --git a/src/SDKs/HealthcareApis/Management.HealthcareApis/Generated/Models/ServiceAuthenticationConfigurationInfo.cs b/src/SDKs/HealthcareApis/Management.HealthcareApis/Generated/Models/ServiceAuthenticationConfigurationInfo.cs new file mode 100644 index 0000000000000..c1208c8761003 --- /dev/null +++ b/src/SDKs/HealthcareApis/Management.HealthcareApis/Generated/Models/ServiceAuthenticationConfigurationInfo.cs @@ -0,0 +1,66 @@ +// +// 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.HealthcareApis.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Authentication configuration information + /// + public partial class ServiceAuthenticationConfigurationInfo + { + /// + /// Initializes a new instance of the + /// ServiceAuthenticationConfigurationInfo class. + /// + public ServiceAuthenticationConfigurationInfo() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// ServiceAuthenticationConfigurationInfo class. + /// + /// The authority url for the service + /// The audience url for the service + /// If the SMART on FHIR proxy is + /// enabled + public ServiceAuthenticationConfigurationInfo(string authority = default(string), string audience = default(string), bool? smartProxyEnabled = default(bool?)) + { + Authority = authority; + Audience = audience; + SmartProxyEnabled = smartProxyEnabled; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the authority url for the service + /// + [JsonProperty(PropertyName = "authority")] + public string Authority { get; set; } + + /// + /// Gets or sets the audience url for the service + /// + [JsonProperty(PropertyName = "audience")] + public string Audience { get; set; } + + /// + /// Gets or sets if the SMART on FHIR proxy is enabled + /// + [JsonProperty(PropertyName = "smartProxyEnabled")] + public bool? SmartProxyEnabled { get; set; } + + } +} diff --git a/src/SDKs/HealthcareApis/Management.HealthcareApis/Generated/Models/ServiceCorsConfigurationInfo.cs b/src/SDKs/HealthcareApis/Management.HealthcareApis/Generated/Models/ServiceCorsConfigurationInfo.cs new file mode 100644 index 0000000000000..0bfaf07d6e20e --- /dev/null +++ b/src/SDKs/HealthcareApis/Management.HealthcareApis/Generated/Models/ServiceCorsConfigurationInfo.cs @@ -0,0 +1,84 @@ +// +// 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.HealthcareApis.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// The settings for the CORS configuration of the service instance. + /// + public partial class ServiceCorsConfigurationInfo + { + /// + /// Initializes a new instance of the ServiceCorsConfigurationInfo + /// class. + /// + public ServiceCorsConfigurationInfo() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ServiceCorsConfigurationInfo + /// class. + /// + /// The origins to be allowed via CORS. + /// The headers to be allowed via CORS. + /// The methods to be allowed via CORS. + /// The max age to be allowed via CORS. + /// If credentials are allowed via + /// CORS. + public ServiceCorsConfigurationInfo(IList origins = default(IList), IList headers = default(IList), IList methods = default(IList), int? maxAge = default(int?), bool? allowCredentials = default(bool?)) + { + Origins = origins; + Headers = headers; + Methods = methods; + MaxAge = maxAge; + AllowCredentials = allowCredentials; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the origins to be allowed via CORS. + /// + [JsonProperty(PropertyName = "origins")] + public IList Origins { get; set; } + + /// + /// Gets or sets the headers to be allowed via CORS. + /// + [JsonProperty(PropertyName = "headers")] + public IList Headers { get; set; } + + /// + /// Gets or sets the methods to be allowed via CORS. + /// + [JsonProperty(PropertyName = "methods")] + public IList Methods { get; set; } + + /// + /// Gets or sets the max age to be allowed via CORS. + /// + [JsonProperty(PropertyName = "maxAge")] + public int? MaxAge { get; set; } + + /// + /// Gets or sets if credentials are allowed via CORS. + /// + [JsonProperty(PropertyName = "allowCredentials")] + public bool? AllowCredentials { get; set; } + + } +} diff --git a/src/SDKs/HealthcareApis/Management.HealthcareApis/Generated/Models/ServiceCosmosDbConfigurationInfo.cs b/src/SDKs/HealthcareApis/Management.HealthcareApis/Generated/Models/ServiceCosmosDbConfigurationInfo.cs new file mode 100644 index 0000000000000..c9bf01bb80808 --- /dev/null +++ b/src/SDKs/HealthcareApis/Management.HealthcareApis/Generated/Models/ServiceCosmosDbConfigurationInfo.cs @@ -0,0 +1,50 @@ +// +// 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.HealthcareApis.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// The settings for the Cosmos DB database backing the service. + /// + public partial class ServiceCosmosDbConfigurationInfo + { + /// + /// Initializes a new instance of the ServiceCosmosDbConfigurationInfo + /// class. + /// + public ServiceCosmosDbConfigurationInfo() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ServiceCosmosDbConfigurationInfo + /// class. + /// + /// The provisioned throughput for the + /// backing database. + public ServiceCosmosDbConfigurationInfo(int? offerThroughput = default(int?)) + { + OfferThroughput = offerThroughput; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the provisioned throughput for the backing database. + /// + [JsonProperty(PropertyName = "offerThroughput")] + public int? OfferThroughput { get; set; } + + } +} diff --git a/src/SDKs/HealthcareApis/Management.HealthcareApis/Generated/Models/ServiceNameUnavailabilityReason.cs b/src/SDKs/HealthcareApis/Management.HealthcareApis/Generated/Models/ServiceNameUnavailabilityReason.cs new file mode 100644 index 0000000000000..9b172105c171d --- /dev/null +++ b/src/SDKs/HealthcareApis/Management.HealthcareApis/Generated/Models/ServiceNameUnavailabilityReason.cs @@ -0,0 +1,56 @@ +// +// 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.HealthcareApis.Models +{ + using Newtonsoft.Json; + using Newtonsoft.Json.Converters; + using System.Runtime; + using System.Runtime.Serialization; + + /// + /// Defines values for ServiceNameUnavailabilityReason. + /// + [JsonConverter(typeof(StringEnumConverter))] + public enum ServiceNameUnavailabilityReason + { + [EnumMember(Value = "Invalid")] + Invalid, + [EnumMember(Value = "AlreadyExists")] + AlreadyExists + } + internal static class ServiceNameUnavailabilityReasonEnumExtension + { + internal static string ToSerializedValue(this ServiceNameUnavailabilityReason? value) + { + return value == null ? null : ((ServiceNameUnavailabilityReason)value).ToSerializedValue(); + } + + internal static string ToSerializedValue(this ServiceNameUnavailabilityReason value) + { + switch( value ) + { + case ServiceNameUnavailabilityReason.Invalid: + return "Invalid"; + case ServiceNameUnavailabilityReason.AlreadyExists: + return "AlreadyExists"; + } + return null; + } + + internal static ServiceNameUnavailabilityReason? ParseServiceNameUnavailabilityReason(this string value) + { + switch( value ) + { + case "Invalid": + return ServiceNameUnavailabilityReason.Invalid; + case "AlreadyExists": + return ServiceNameUnavailabilityReason.AlreadyExists; + } + return null; + } + } +} diff --git a/src/SDKs/HealthcareApis/Management.HealthcareApis/Generated/Models/ServicesDescription.cs b/src/SDKs/HealthcareApis/Management.HealthcareApis/Generated/Models/ServicesDescription.cs new file mode 100644 index 0000000000000..b914e0eaf07da --- /dev/null +++ b/src/SDKs/HealthcareApis/Management.HealthcareApis/Generated/Models/ServicesDescription.cs @@ -0,0 +1,72 @@ +// +// 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.HealthcareApis.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// The description of the service. + /// + public partial class ServicesDescription : Resource + { + /// + /// Initializes a new instance of the ServicesDescription class. + /// + public ServicesDescription() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ServicesDescription class. + /// + /// The resource location. + /// The resource identifier. + /// The resource name. + /// The resource type. + /// The resource tags. + /// An etag associated with the resource, used for + /// optimistic concurrency when editing it. + /// The common properties of a + /// service. + public ServicesDescription(string location, string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), string etag = default(string), ServicesProperties properties = default(ServicesProperties)) + : base(location, id, name, type, tags, etag) + { + Properties = properties; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the common properties of a service. + /// + [JsonProperty(PropertyName = "properties")] + public ServicesProperties Properties { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public override void Validate() + { + base.Validate(); + if (Properties != null) + { + Properties.Validate(); + } + } + } +} diff --git a/src/SDKs/HealthcareApis/Management.HealthcareApis/Generated/Models/ServicesNameAvailabilityInfo.cs b/src/SDKs/HealthcareApis/Management.HealthcareApis/Generated/Models/ServicesNameAvailabilityInfo.cs new file mode 100644 index 0000000000000..08c5cb50f5ce4 --- /dev/null +++ b/src/SDKs/HealthcareApis/Management.HealthcareApis/Generated/Models/ServicesNameAvailabilityInfo.cs @@ -0,0 +1,69 @@ +// +// 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.HealthcareApis.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// The properties indicating whether a given service name is available. + /// + public partial class ServicesNameAvailabilityInfo + { + /// + /// Initializes a new instance of the ServicesNameAvailabilityInfo + /// class. + /// + public ServicesNameAvailabilityInfo() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ServicesNameAvailabilityInfo + /// class. + /// + /// The value which indicates whether the + /// provided name is available. + /// The reason for unavailability. Possible values + /// include: 'Invalid', 'AlreadyExists' + /// The detailed reason message. + public ServicesNameAvailabilityInfo(bool? nameAvailable = default(bool?), ServiceNameUnavailabilityReason? reason = default(ServiceNameUnavailabilityReason?), 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 the value which indicates whether the provided name is + /// available. + /// + [JsonProperty(PropertyName = "nameAvailable")] + public bool? NameAvailable { get; private set; } + + /// + /// Gets the reason for unavailability. Possible values include: + /// 'Invalid', 'AlreadyExists' + /// + [JsonProperty(PropertyName = "reason")] + public ServiceNameUnavailabilityReason? Reason { get; private set; } + + /// + /// Gets or sets the detailed reason message. + /// + [JsonProperty(PropertyName = "message")] + public string Message { get; set; } + + } +} diff --git a/src/SDKs/HealthcareApis/Management.HealthcareApis/Generated/Models/ServicesPatchDescription.cs b/src/SDKs/HealthcareApis/Management.HealthcareApis/Generated/Models/ServicesPatchDescription.cs new file mode 100644 index 0000000000000..4f506d6a3e059 --- /dev/null +++ b/src/SDKs/HealthcareApis/Management.HealthcareApis/Generated/Models/ServicesPatchDescription.cs @@ -0,0 +1,49 @@ +// +// 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.HealthcareApis.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// The description of the service. + /// + public partial class ServicesPatchDescription + { + /// + /// Initializes a new instance of the ServicesPatchDescription class. + /// + public ServicesPatchDescription() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ServicesPatchDescription class. + /// + /// Instance tags + public ServicesPatchDescription(IDictionary tags = default(IDictionary)) + { + Tags = tags; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets instance tags + /// + [JsonProperty(PropertyName = "tags")] + public IDictionary Tags { get; set; } + + } +} diff --git a/src/SDKs/HealthcareApis/Management.HealthcareApis/Generated/Models/ServicesProperties.cs b/src/SDKs/HealthcareApis/Management.HealthcareApis/Generated/Models/ServicesProperties.cs new file mode 100644 index 0000000000000..e489b976ab90b --- /dev/null +++ b/src/SDKs/HealthcareApis/Management.HealthcareApis/Generated/Models/ServicesProperties.cs @@ -0,0 +1,117 @@ +// +// 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.HealthcareApis.Models +{ + using Microsoft.Rest; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// The properties of a service instance. + /// + public partial class ServicesProperties + { + /// + /// Initializes a new instance of the ServicesProperties class. + /// + public ServicesProperties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ServicesProperties class. + /// + /// The access policies of the service + /// instance. + /// The provisioning state. Possible + /// values include: 'Deleting', 'Succeeded', 'Creating', 'Accepted', + /// 'Verifying', 'Updating', 'Failed', 'Canceled', + /// 'Deprovisioned' + /// The settings for the Cosmos DB + /// database backing the service. + /// The authentication + /// configuration for the service instance. + /// The settings for the CORS + /// configuration of the service instance. + public ServicesProperties(IList accessPolicies, string provisioningState = default(string), ServiceCosmosDbConfigurationInfo cosmosDbConfiguration = default(ServiceCosmosDbConfigurationInfo), ServiceAuthenticationConfigurationInfo authenticationConfiguration = default(ServiceAuthenticationConfigurationInfo), ServiceCorsConfigurationInfo corsConfiguration = default(ServiceCorsConfigurationInfo)) + { + ProvisioningState = provisioningState; + AccessPolicies = accessPolicies; + CosmosDbConfiguration = cosmosDbConfiguration; + AuthenticationConfiguration = authenticationConfiguration; + CorsConfiguration = corsConfiguration; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets the provisioning state. Possible values include: 'Deleting', + /// 'Succeeded', 'Creating', 'Accepted', 'Verifying', 'Updating', + /// 'Failed', 'Canceled', 'Deprovisioned' + /// + [JsonProperty(PropertyName = "provisioningState")] + public string ProvisioningState { get; private set; } + + /// + /// Gets or sets the access policies of the service instance. + /// + [JsonProperty(PropertyName = "accessPolicies")] + public IList AccessPolicies { get; set; } + + /// + /// Gets or sets the settings for the Cosmos DB database backing the + /// service. + /// + [JsonProperty(PropertyName = "cosmosDbConfiguration")] + public ServiceCosmosDbConfigurationInfo CosmosDbConfiguration { get; set; } + + /// + /// Gets or sets the authentication configuration for the service + /// instance. + /// + [JsonProperty(PropertyName = "authenticationConfiguration")] + public ServiceAuthenticationConfigurationInfo AuthenticationConfiguration { get; set; } + + /// + /// Gets or sets the settings for the CORS configuration of the service + /// instance. + /// + [JsonProperty(PropertyName = "corsConfiguration")] + public ServiceCorsConfigurationInfo CorsConfiguration { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (AccessPolicies == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "AccessPolicies"); + } + if (AccessPolicies != null) + { + foreach (var element in AccessPolicies) + { + if (element != null) + { + element.Validate(); + } + } + } + } + } +} diff --git a/src/SDKs/HealthcareApis/Management.HealthcareApis/Generated/MoveResourcesStatusOperations.cs b/src/SDKs/HealthcareApis/Management.HealthcareApis/Generated/MoveResourcesStatusOperations.cs new file mode 100644 index 0000000000000..30c1c30623bf7 --- /dev/null +++ b/src/SDKs/HealthcareApis/Management.HealthcareApis/Generated/MoveResourcesStatusOperations.cs @@ -0,0 +1,251 @@ +// +// 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.HealthcareApis +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + 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; + + /// + /// MoveResourcesStatusOperations operations. + /// + internal partial class MoveResourcesStatusOperations : IServiceOperations, IMoveResourcesStatusOperations + { + /// + /// Initializes a new instance of the MoveResourcesStatusOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal MoveResourcesStatusOperations(HealthcareApisManagementClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the HealthcareApisManagementClient + /// + public HealthcareApisManagementClient Client { get; private set; } + + /// + /// Get the operation result for a long running move operation. + /// + /// + /// The location of the operation. + /// + /// + /// The ID of the operation result to get. + /// + /// + /// 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 locationName, string operationResultId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (locationName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "locationName"); + } + if (operationResultId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "operationResultId"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("locationName", locationName); + tracingParameters.Add("operationResultId", operationResultId); + 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}/providers/Microsoft.HealthcareApis/locations/{locationName}/moveResourcesStatus/{operationResultId}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(Client.SubscriptionId, Client.SerializationSettings).Trim('"'))); + _url = _url.Replace("{locationName}", System.Uri.EscapeDataString(locationName)); + _url = _url.Replace("{operationResultId}", System.Uri.EscapeDataString(operationResultId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 404) + { + var ex = new ErrorDetailsException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorDetails _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + // Deserialize Response + if ((int)_statusCode == 404) + { + _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/src/SDKs/HealthcareApis/Management.HealthcareApis/Generated/MoveResourcesStatusOperationsExtensions.cs b/src/SDKs/HealthcareApis/Management.HealthcareApis/Generated/MoveResourcesStatusOperationsExtensions.cs new file mode 100644 index 0000000000000..65e0edcd24985 --- /dev/null +++ b/src/SDKs/HealthcareApis/Management.HealthcareApis/Generated/MoveResourcesStatusOperationsExtensions.cs @@ -0,0 +1,61 @@ +// +// 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.HealthcareApis +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for MoveResourcesStatusOperations. + /// + public static partial class MoveResourcesStatusOperationsExtensions + { + /// + /// Get the operation result for a long running move operation. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The location of the operation. + /// + /// + /// The ID of the operation result to get. + /// + public static object Get(this IMoveResourcesStatusOperations operations, string locationName, string operationResultId) + { + return operations.GetAsync(locationName, operationResultId).GetAwaiter().GetResult(); + } + + /// + /// Get the operation result for a long running move operation. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The location of the operation. + /// + /// + /// The ID of the operation result to get. + /// + /// + /// The cancellation token. + /// + public static async Task GetAsync(this IMoveResourcesStatusOperations operations, string locationName, string operationResultId, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(locationName, operationResultId, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +} diff --git a/src/SDKs/HealthcareApis/Management.HealthcareApis/Generated/OperationResultsOperations.cs b/src/SDKs/HealthcareApis/Management.HealthcareApis/Generated/OperationResultsOperations.cs new file mode 100644 index 0000000000000..bb4ed03c5bc91 --- /dev/null +++ b/src/SDKs/HealthcareApis/Management.HealthcareApis/Generated/OperationResultsOperations.cs @@ -0,0 +1,251 @@ +// +// 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.HealthcareApis +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + 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; + + /// + /// OperationResultsOperations operations. + /// + internal partial class OperationResultsOperations : IServiceOperations, IOperationResultsOperations + { + /// + /// Initializes a new instance of the OperationResultsOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal OperationResultsOperations(HealthcareApisManagementClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the HealthcareApisManagementClient + /// + public HealthcareApisManagementClient Client { get; private set; } + + /// + /// Get the operation result for a long running operation. + /// + /// + /// The location of the operation. + /// + /// + /// The ID of the operation result to get. + /// + /// + /// 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 locationName, string operationResultId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (locationName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "locationName"); + } + if (operationResultId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "operationResultId"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("locationName", locationName); + tracingParameters.Add("operationResultId", operationResultId); + 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}/providers/Microsoft.HealthcareApis/locations/{locationName}/operationresults/{operationResultId}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(Client.SubscriptionId, Client.SerializationSettings).Trim('"'))); + _url = _url.Replace("{locationName}", System.Uri.EscapeDataString(locationName)); + _url = _url.Replace("{operationResultId}", System.Uri.EscapeDataString(operationResultId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 404) + { + var ex = new ErrorDetailsException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorDetails _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + // Deserialize Response + if ((int)_statusCode == 404) + { + _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/src/SDKs/HealthcareApis/Management.HealthcareApis/Generated/OperationResultsOperationsExtensions.cs b/src/SDKs/HealthcareApis/Management.HealthcareApis/Generated/OperationResultsOperationsExtensions.cs new file mode 100644 index 0000000000000..8747f2272d60a --- /dev/null +++ b/src/SDKs/HealthcareApis/Management.HealthcareApis/Generated/OperationResultsOperationsExtensions.cs @@ -0,0 +1,61 @@ +// +// 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.HealthcareApis +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for OperationResultsOperations. + /// + public static partial class OperationResultsOperationsExtensions + { + /// + /// Get the operation result for a long running operation. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The location of the operation. + /// + /// + /// The ID of the operation result to get. + /// + public static object Get(this IOperationResultsOperations operations, string locationName, string operationResultId) + { + return operations.GetAsync(locationName, operationResultId).GetAwaiter().GetResult(); + } + + /// + /// Get the operation result for a long running operation. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The location of the operation. + /// + /// + /// The ID of the operation result to get. + /// + /// + /// The cancellation token. + /// + public static async Task GetAsync(this IOperationResultsOperations operations, string locationName, string operationResultId, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(locationName, operationResultId, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +} diff --git a/src/SDKs/HealthcareApis/Management.HealthcareApis/Generated/Operations.cs b/src/SDKs/HealthcareApis/Management.HealthcareApis/Generated/Operations.cs new file mode 100644 index 0000000000000..7b35b15c4ca37 --- /dev/null +++ b/src/SDKs/HealthcareApis/Management.HealthcareApis/Generated/Operations.cs @@ -0,0 +1,376 @@ +// +// 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.HealthcareApis +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + 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; + + /// + /// Operations operations. + /// + internal partial class Operations : IServiceOperations, IOperations + { + /// + /// Initializes a new instance of the Operations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal Operations(HealthcareApisManagementClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the HealthcareApisManagementClient + /// + public HealthcareApisManagementClient Client { get; private set; } + + /// + /// Lists all of the available Healthcare service REST API operations. + /// + /// + /// 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 + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task>> ListWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + 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("/") ? "" : "/")), "providers/Microsoft.HealthcareApis/operations").ToString(); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new ErrorDetailsException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorDetails _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Lists all of the available Healthcare service REST API operations. + /// + /// + /// 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); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new ErrorDetailsException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorDetails _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + } +} diff --git a/src/SDKs/HealthcareApis/Management.HealthcareApis/Generated/OperationsExtensions.cs b/src/SDKs/HealthcareApis/Management.HealthcareApis/Generated/OperationsExtensions.cs new file mode 100644 index 0000000000000..b3b2648ba42d0 --- /dev/null +++ b/src/SDKs/HealthcareApis/Management.HealthcareApis/Generated/OperationsExtensions.cs @@ -0,0 +1,83 @@ +// +// 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.HealthcareApis +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for Operations. + /// + public static partial class OperationsExtensions + { + /// + /// Lists all of the available Healthcare service REST API operations. + /// + /// + /// The operations group for this extension method. + /// + public static IPage List(this IOperations operations) + { + return operations.ListAsync().GetAwaiter().GetResult(); + } + + /// + /// Lists all of the available Healthcare service REST API operations. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The cancellation token. + /// + public static async Task> ListAsync(this IOperations operations, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Lists all of the available Healthcare service REST API operations. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage ListNext(this IOperations operations, string nextPageLink) + { + return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Lists all of the available Healthcare service REST API operations. + /// + /// + /// 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 IOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +} diff --git a/src/SDKs/HealthcareApis/Management.HealthcareApis/Generated/SdkInfo_HealthcareApisManagementClient.cs b/src/SDKs/HealthcareApis/Management.HealthcareApis/Generated/SdkInfo_HealthcareApisManagementClient.cs new file mode 100644 index 0000000000000..2af032008c0e9 --- /dev/null +++ b/src/SDKs/HealthcareApis/Management.HealthcareApis/Generated/SdkInfo_HealthcareApisManagementClient.cs @@ -0,0 +1,31 @@ + +// +// 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.HealthcareApis +{ + using System; + using System.Collections.Generic; + using System.Linq; + + internal static partial class SdkInfo + { + public static IEnumerable> ApiInfo_HealthcareApisManagementClient + { + get + { + return new Tuple[] + { + new Tuple("HealthcareApis", "MoveResourcesStatus", "2018-08-20-preview"), + new Tuple("HealthcareApis", "OperationResults", "2018-08-20-preview"), + new Tuple("HealthcareApis", "Operations", "2018-08-20-preview"), + new Tuple("HealthcareApis", "Services", "2018-08-20-preview"), + new Tuple("HealthcareApisManagementClient", "Services", "2018-08-20-preview"), + }.AsEnumerable(); + } + } + } +} diff --git a/src/SDKs/HealthcareApis/Management.HealthcareApis/Generated/ServicesOperations.cs b/src/SDKs/HealthcareApis/Management.HealthcareApis/Generated/ServicesOperations.cs new file mode 100644 index 0000000000000..ff462819b9150 --- /dev/null +++ b/src/SDKs/HealthcareApis/Management.HealthcareApis/Generated/ServicesOperations.cs @@ -0,0 +1,2065 @@ +// +// 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.HealthcareApis +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + 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; + + /// + /// ServicesOperations operations. + /// + internal partial class ServicesOperations : IServiceOperations, IServicesOperations + { + /// + /// Initializes a new instance of the ServicesOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal ServicesOperations(HealthcareApisManagementClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the HealthcareApisManagementClient + /// + public HealthcareApisManagementClient Client { get; private set; } + + /// + /// Get the metadata of a service instance. + /// + /// + /// The name of the resource group that contains the service instance. + /// + /// + /// The name of the service instance. + /// + /// + /// 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 resourceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); + } + } + if (resourceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceName"); + } + if (resourceName != null) + { + if (resourceName.Length > 24) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceName", 24); + } + if (resourceName.Length < 3) + { + throw new ValidationException(ValidationRules.MinLength, "resourceName", 3); + } + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("resourceName", resourceName); + 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.HealthcareApis/services/{resourceName}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(Client.SubscriptionId, Client.SerializationSettings).Trim('"'))); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{resourceName}", System.Uri.EscapeDataString(resourceName)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new ErrorDetailsException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorDetails _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Create or update the metadata of a service instance. + /// + /// + /// The name of the resource group that contains the service instance. + /// + /// + /// The name of the service instance. + /// + /// + /// The service instance metadata. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string resourceName, ServicesDescription serviceDescription, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send Request + AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, resourceName, serviceDescription, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Update the metadata of a service instance. + /// + /// + /// The name of the resource group that contains the service instance. + /// + /// + /// The name of the service instance. + /// + /// + /// The service instance metadata and security metadata. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string resourceName, ServicesPatchDescription servicePatchDescription, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send Request + AzureOperationResponse _response = await BeginUpdateWithHttpMessagesAsync(resourceGroupName, resourceName, servicePatchDescription, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Delete a service instance. + /// + /// + /// The name of the resource group that contains the service instance. + /// + /// + /// The name of the service instance. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string resourceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, resourceName, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get all the service instances in a subscription. + /// + /// + /// 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 + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task>> ListWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + 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}/providers/Microsoft.HealthcareApis/services").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(Client.SubscriptionId, Client.SerializationSettings).Trim('"'))); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new ErrorDetailsException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorDetails _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Get all the service instances in a resource group. + /// + /// + /// The name of the resource group that contains the service instance. + /// + /// + /// 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>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); + } + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListByResourceGroup", 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.HealthcareApis/services").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(Client.SubscriptionId, Client.SerializationSettings).Trim('"'))); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new ErrorDetailsException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorDetails _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Check if a service instance name is available. + /// + /// + /// Set the name parameter in the CheckNameAvailabilityParameters structure to + /// the name of the service instance to check. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> CheckNameAvailabilityWithHttpMessagesAsync(CheckNameAvailabilityParameters checkNameAvailabilityInputs, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (checkNameAvailabilityInputs == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "checkNameAvailabilityInputs"); + } + if (checkNameAvailabilityInputs != null) + { + checkNameAvailabilityInputs.Validate(); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("checkNameAvailabilityInputs", checkNameAvailabilityInputs); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "CheckNameAvailability", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.HealthcareApis/checkNameAvailability").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(Client.SubscriptionId, Client.SerializationSettings).Trim('"'))); + 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; + if(checkNameAvailabilityInputs != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(checkNameAvailabilityInputs, 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); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new ErrorDetailsException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorDetails _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Moves resources to another subscription and/or resource group. + /// + /// + /// The name of the resource group that contains the service instance. + /// + /// + /// Set the move resource structure to the name of the service instance to + /// check. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task MoveResourcesWithHttpMessagesAsync(string resourceGroupName, MoveResourcesParameters moveResourcesInputs, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse _response = await BeginMoveResourcesWithHttpMessagesAsync(resourceGroupName, moveResourcesInputs, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Create or update the metadata of a service instance. + /// + /// + /// The name of the resource group that contains the service instance. + /// + /// + /// The name of the service instance. + /// + /// + /// The service instance metadata. + /// + /// + /// 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 resourceName, ServicesDescription serviceDescription, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); + } + } + if (resourceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceName"); + } + if (resourceName != null) + { + if (resourceName.Length > 24) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceName", 24); + } + if (resourceName.Length < 3) + { + throw new ValidationException(ValidationRules.MinLength, "resourceName", 3); + } + } + if (serviceDescription == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "serviceDescription"); + } + if (serviceDescription != null) + { + serviceDescription.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("resourceName", resourceName); + tracingParameters.Add("serviceDescription", serviceDescription); + 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.HealthcareApis/services/{resourceName}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(Client.SubscriptionId, Client.SerializationSettings).Trim('"'))); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{resourceName}", System.Uri.EscapeDataString(resourceName)); + 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(serviceDescription != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(serviceDescription, 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); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 201) + { + var ex = new ErrorDetailsException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorDetails _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + // 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; + } + + /// + /// Update the metadata of a service instance. + /// + /// + /// The name of the resource group that contains the service instance. + /// + /// + /// The name of the service instance. + /// + /// + /// The service instance metadata and security metadata. + /// + /// + /// 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> BeginUpdateWithHttpMessagesAsync(string resourceGroupName, string resourceName, ServicesPatchDescription servicePatchDescription, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); + } + } + if (resourceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceName"); + } + if (resourceName != null) + { + if (resourceName.Length > 24) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceName", 24); + } + if (resourceName.Length < 3) + { + throw new ValidationException(ValidationRules.MinLength, "resourceName", 3); + } + } + if (servicePatchDescription == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "servicePatchDescription"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("resourceName", resourceName); + tracingParameters.Add("servicePatchDescription", servicePatchDescription); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "BeginUpdate", 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.HealthcareApis/services/{resourceName}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(Client.SubscriptionId, Client.SerializationSettings).Trim('"'))); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{resourceName}", System.Uri.EscapeDataString(resourceName)); + 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(servicePatchDescription != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(servicePatchDescription, 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); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new ErrorDetailsException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorDetails _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Delete a service instance. + /// + /// + /// The name of the resource group that contains the service instance. + /// + /// + /// The name of the service instance. + /// + /// + /// 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 resourceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); + } + } + if (resourceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceName"); + } + if (resourceName != null) + { + if (resourceName.Length > 24) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceName", 24); + } + if (resourceName.Length < 3) + { + throw new ValidationException(ValidationRules.MinLength, "resourceName", 3); + } + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("resourceName", resourceName); + 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.HealthcareApis/services/{resourceName}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(Client.SubscriptionId, Client.SerializationSettings).Trim('"'))); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{resourceName}", System.Uri.EscapeDataString(resourceName)); + 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); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 202 && (int)_statusCode != 204) + { + var ex = new ErrorDetailsException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorDetails _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Moves resources to another subscription and/or resource group. + /// + /// + /// The name of the resource group that contains the service instance. + /// + /// + /// Set the move resource structure to the name of the service instance to + /// check. + /// + /// + /// 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 BeginMoveResourcesWithHttpMessagesAsync(string resourceGroupName, MoveResourcesParameters moveResourcesInputs, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); + } + } + if (moveResourcesInputs == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "moveResourcesInputs"); + } + if (moveResourcesInputs != null) + { + moveResourcesInputs.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("moveResourcesInputs", moveResourcesInputs); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "BeginMoveResources", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/moveResources").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(Client.SubscriptionId, Client.SerializationSettings).Trim('"'))); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + 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; + if(moveResourcesInputs != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(moveResourcesInputs, 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); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 202) + { + var ex = new ErrorDetailsException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorDetails _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Get all the service instances in a subscription. + /// + /// + /// 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); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new ErrorDetailsException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorDetails _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Get all the service instances in a resource group. + /// + /// + /// 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>> ListByResourceGroupNextWithHttpMessagesAsync(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, "ListByResourceGroupNext", tracingParameters); + } + // Construct URL + string _url = "{nextLink}"; + _url = _url.Replace("{nextLink}", nextPageLink); + List _queryParameters = new List(); + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new ErrorDetailsException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorDetails _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + } +} diff --git a/src/SDKs/HealthcareApis/Management.HealthcareApis/Generated/ServicesOperationsExtensions.cs b/src/SDKs/HealthcareApis/Management.HealthcareApis/Generated/ServicesOperationsExtensions.cs new file mode 100644 index 0000000000000..c50c40aaefc63 --- /dev/null +++ b/src/SDKs/HealthcareApis/Management.HealthcareApis/Generated/ServicesOperationsExtensions.cs @@ -0,0 +1,563 @@ +// +// 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.HealthcareApis +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for ServicesOperations. + /// + public static partial class ServicesOperationsExtensions + { + /// + /// Get the metadata of a service instance. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group that contains the service instance. + /// + /// + /// The name of the service instance. + /// + public static ServicesDescription Get(this IServicesOperations operations, string resourceGroupName, string resourceName) + { + return operations.GetAsync(resourceGroupName, resourceName).GetAwaiter().GetResult(); + } + + /// + /// Get the metadata of a service instance. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group that contains the service instance. + /// + /// + /// The name of the service instance. + /// + /// + /// The cancellation token. + /// + public static async Task GetAsync(this IServicesOperations operations, string resourceGroupName, string resourceName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, resourceName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Create or update the metadata of a service instance. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group that contains the service instance. + /// + /// + /// The name of the service instance. + /// + /// + /// The service instance metadata. + /// + public static ServicesDescription CreateOrUpdate(this IServicesOperations operations, string resourceGroupName, string resourceName, ServicesDescription serviceDescription) + { + return operations.CreateOrUpdateAsync(resourceGroupName, resourceName, serviceDescription).GetAwaiter().GetResult(); + } + + /// + /// Create or update the metadata of a service instance. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group that contains the service instance. + /// + /// + /// The name of the service instance. + /// + /// + /// The service instance metadata. + /// + /// + /// The cancellation token. + /// + public static async Task CreateOrUpdateAsync(this IServicesOperations operations, string resourceGroupName, string resourceName, ServicesDescription serviceDescription, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, resourceName, serviceDescription, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Update the metadata of a service instance. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group that contains the service instance. + /// + /// + /// The name of the service instance. + /// + /// + /// The service instance metadata and security metadata. + /// + public static ServicesDescription Update(this IServicesOperations operations, string resourceGroupName, string resourceName, ServicesPatchDescription servicePatchDescription) + { + return operations.UpdateAsync(resourceGroupName, resourceName, servicePatchDescription).GetAwaiter().GetResult(); + } + + /// + /// Update the metadata of a service instance. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group that contains the service instance. + /// + /// + /// The name of the service instance. + /// + /// + /// The service instance metadata and security metadata. + /// + /// + /// The cancellation token. + /// + public static async Task UpdateAsync(this IServicesOperations operations, string resourceGroupName, string resourceName, ServicesPatchDescription servicePatchDescription, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.UpdateWithHttpMessagesAsync(resourceGroupName, resourceName, servicePatchDescription, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Delete a service instance. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group that contains the service instance. + /// + /// + /// The name of the service instance. + /// + public static void Delete(this IServicesOperations operations, string resourceGroupName, string resourceName) + { + operations.DeleteAsync(resourceGroupName, resourceName).GetAwaiter().GetResult(); + } + + /// + /// Delete a service instance. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group that contains the service instance. + /// + /// + /// The name of the service instance. + /// + /// + /// The cancellation token. + /// + public static async Task DeleteAsync(this IServicesOperations operations, string resourceGroupName, string resourceName, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, resourceName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// Get all the service instances in a subscription. + /// + /// + /// The operations group for this extension method. + /// + public static IPage List(this IServicesOperations operations) + { + return operations.ListAsync().GetAwaiter().GetResult(); + } + + /// + /// Get all the service instances in a subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The cancellation token. + /// + public static async Task> ListAsync(this IServicesOperations operations, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Get all the service instances in a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group that contains the service instance. + /// + public static IPage ListByResourceGroup(this IServicesOperations operations, string resourceGroupName) + { + return operations.ListByResourceGroupAsync(resourceGroupName).GetAwaiter().GetResult(); + } + + /// + /// Get all the service instances in a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group that contains the service instance. + /// + /// + /// The cancellation token. + /// + public static async Task> ListByResourceGroupAsync(this IServicesOperations operations, string resourceGroupName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListByResourceGroupWithHttpMessagesAsync(resourceGroupName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Check if a service instance name is available. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Set the name parameter in the CheckNameAvailabilityParameters structure to + /// the name of the service instance to check. + /// + public static ServicesNameAvailabilityInfo CheckNameAvailability(this IServicesOperations operations, CheckNameAvailabilityParameters checkNameAvailabilityInputs) + { + return operations.CheckNameAvailabilityAsync(checkNameAvailabilityInputs).GetAwaiter().GetResult(); + } + + /// + /// Check if a service instance name is available. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Set the name parameter in the CheckNameAvailabilityParameters structure to + /// the name of the service instance to check. + /// + /// + /// The cancellation token. + /// + public static async Task CheckNameAvailabilityAsync(this IServicesOperations operations, CheckNameAvailabilityParameters checkNameAvailabilityInputs, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.CheckNameAvailabilityWithHttpMessagesAsync(checkNameAvailabilityInputs, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Moves resources to another subscription and/or resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group that contains the service instance. + /// + /// + /// Set the move resource structure to the name of the service instance to + /// check. + /// + public static void MoveResources(this IServicesOperations operations, string resourceGroupName, MoveResourcesParameters moveResourcesInputs) + { + operations.MoveResourcesAsync(resourceGroupName, moveResourcesInputs).GetAwaiter().GetResult(); + } + + /// + /// Moves resources to another subscription and/or resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group that contains the service instance. + /// + /// + /// Set the move resource structure to the name of the service instance to + /// check. + /// + /// + /// The cancellation token. + /// + public static async Task MoveResourcesAsync(this IServicesOperations operations, string resourceGroupName, MoveResourcesParameters moveResourcesInputs, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.MoveResourcesWithHttpMessagesAsync(resourceGroupName, moveResourcesInputs, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// Create or update the metadata of a service instance. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group that contains the service instance. + /// + /// + /// The name of the service instance. + /// + /// + /// The service instance metadata. + /// + public static ServicesDescription BeginCreateOrUpdate(this IServicesOperations operations, string resourceGroupName, string resourceName, ServicesDescription serviceDescription) + { + return operations.BeginCreateOrUpdateAsync(resourceGroupName, resourceName, serviceDescription).GetAwaiter().GetResult(); + } + + /// + /// Create or update the metadata of a service instance. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group that contains the service instance. + /// + /// + /// The name of the service instance. + /// + /// + /// The service instance metadata. + /// + /// + /// The cancellation token. + /// + public static async Task BeginCreateOrUpdateAsync(this IServicesOperations operations, string resourceGroupName, string resourceName, ServicesDescription serviceDescription, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, resourceName, serviceDescription, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Update the metadata of a service instance. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group that contains the service instance. + /// + /// + /// The name of the service instance. + /// + /// + /// The service instance metadata and security metadata. + /// + public static ServicesDescription BeginUpdate(this IServicesOperations operations, string resourceGroupName, string resourceName, ServicesPatchDescription servicePatchDescription) + { + return operations.BeginUpdateAsync(resourceGroupName, resourceName, servicePatchDescription).GetAwaiter().GetResult(); + } + + /// + /// Update the metadata of a service instance. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group that contains the service instance. + /// + /// + /// The name of the service instance. + /// + /// + /// The service instance metadata and security metadata. + /// + /// + /// The cancellation token. + /// + public static async Task BeginUpdateAsync(this IServicesOperations operations, string resourceGroupName, string resourceName, ServicesPatchDescription servicePatchDescription, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.BeginUpdateWithHttpMessagesAsync(resourceGroupName, resourceName, servicePatchDescription, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Delete a service instance. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group that contains the service instance. + /// + /// + /// The name of the service instance. + /// + public static void BeginDelete(this IServicesOperations operations, string resourceGroupName, string resourceName) + { + operations.BeginDeleteAsync(resourceGroupName, resourceName).GetAwaiter().GetResult(); + } + + /// + /// Delete a service instance. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group that contains the service instance. + /// + /// + /// The name of the service instance. + /// + /// + /// The cancellation token. + /// + public static async Task BeginDeleteAsync(this IServicesOperations operations, string resourceGroupName, string resourceName, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, resourceName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// Moves resources to another subscription and/or resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group that contains the service instance. + /// + /// + /// Set the move resource structure to the name of the service instance to + /// check. + /// + public static void BeginMoveResources(this IServicesOperations operations, string resourceGroupName, MoveResourcesParameters moveResourcesInputs) + { + operations.BeginMoveResourcesAsync(resourceGroupName, moveResourcesInputs).GetAwaiter().GetResult(); + } + + /// + /// Moves resources to another subscription and/or resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group that contains the service instance. + /// + /// + /// Set the move resource structure to the name of the service instance to + /// check. + /// + /// + /// The cancellation token. + /// + public static async Task BeginMoveResourcesAsync(this IServicesOperations operations, string resourceGroupName, MoveResourcesParameters moveResourcesInputs, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.BeginMoveResourcesWithHttpMessagesAsync(resourceGroupName, moveResourcesInputs, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// Get all the service instances in a subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage ListNext(this IServicesOperations operations, string nextPageLink) + { + return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Get all the service instances in a subscription. + /// + /// + /// 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 IServicesOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Get all the service instances in a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage ListByResourceGroupNext(this IServicesOperations operations, string nextPageLink) + { + return operations.ListByResourceGroupNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Get all the service instances in a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async Task> ListByResourceGroupNextAsync(this IServicesOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListByResourceGroupNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +} diff --git a/src/SDKs/_metadata/healthcareapis_.txt b/src/SDKs/_metadata/healthcareapis_.txt new file mode 100644 index 0000000000000..e776541d5e458 --- /dev/null +++ b/src/SDKs/_metadata/healthcareapis_.txt @@ -0,0 +1,11 @@ +2019-05-15 01:03:18 UTC + +1) azure-rest-api-specs repository information +GitHub user: Azure +Branch: master +Commit: 267046e28e213c89f0f070fa7e6fc15e425f5d4d + +2) AutoRest information +Requested version: latest +Bootstrapper version: C:\Users\yazanal\AppData\Roaming\npm `-- autorest@2.0.4283 +Latest installed version: From 766a18e55b5c4d1c043b03b46070296b4df4c9b9 Mon Sep 17 00:00:00 2001 From: Yazan Al-Alul Date: Tue, 4 Jun 2019 10:04:14 -0700 Subject: [PATCH 03/14] Regenerate without MoveResource --- src/SDKs/HealthcareApis/AzSdk.RP.props | 2 +- .../Generated/IServicesOperations.cs | 46 ---- .../SdkInfo_HealthcareApisManagementClient.cs | 1 - .../Generated/ServicesOperations.cs | 210 ------------------ .../Generated/ServicesOperationsExtensions.cs | 78 ------- 5 files changed, 1 insertion(+), 336 deletions(-) diff --git a/src/SDKs/HealthcareApis/AzSdk.RP.props b/src/SDKs/HealthcareApis/AzSdk.RP.props index 7fc4102df5a39..b1d9a41b2f4bb 100644 --- a/src/SDKs/HealthcareApis/AzSdk.RP.props +++ b/src/SDKs/HealthcareApis/AzSdk.RP.props @@ -1,7 +1,7 @@  - HealthcareApis_2018-08-20-preview;HealthcareApisManagementClient_2018-08-20-preview; + HealthcareApis_2018-08-20-preview; $(PackageTags);$(CommonTags);$(AzureApiTag); \ No newline at end of file diff --git a/src/SDKs/HealthcareApis/Management.HealthcareApis/Generated/IServicesOperations.cs b/src/SDKs/HealthcareApis/Management.HealthcareApis/Generated/IServicesOperations.cs index 3be537fba7f10..4a37a14cc641e 100644 --- a/src/SDKs/HealthcareApis/Management.HealthcareApis/Generated/IServicesOperations.cs +++ b/src/SDKs/HealthcareApis/Management.HealthcareApis/Generated/IServicesOperations.cs @@ -187,29 +187,6 @@ public partial interface IServicesOperations /// Task> CheckNameAvailabilityWithHttpMessagesAsync(CheckNameAvailabilityParameters checkNameAvailabilityInputs, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Moves resources to another subscription and/or resource group. - /// - /// - /// The name of the resource group that contains the service instance. - /// - /// - /// Set the move resource structure to the name of the service instance - /// to check. - /// - /// - /// 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 MoveResourcesWithHttpMessagesAsync(string resourceGroupName, MoveResourcesParameters moveResourcesInputs, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// /// Create or update the metadata of a service instance. /// /// @@ -288,29 +265,6 @@ public partial interface IServicesOperations /// Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string resourceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Moves resources to another subscription and/or resource group. - /// - /// - /// The name of the resource group that contains the service instance. - /// - /// - /// Set the move resource structure to the name of the service instance - /// to check. - /// - /// - /// 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 BeginMoveResourcesWithHttpMessagesAsync(string resourceGroupName, MoveResourcesParameters moveResourcesInputs, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// /// Get all the service instances in a subscription. /// /// diff --git a/src/SDKs/HealthcareApis/Management.HealthcareApis/Generated/SdkInfo_HealthcareApisManagementClient.cs b/src/SDKs/HealthcareApis/Management.HealthcareApis/Generated/SdkInfo_HealthcareApisManagementClient.cs index 2af032008c0e9..6b62f2f7b5b58 100644 --- a/src/SDKs/HealthcareApis/Management.HealthcareApis/Generated/SdkInfo_HealthcareApisManagementClient.cs +++ b/src/SDKs/HealthcareApis/Management.HealthcareApis/Generated/SdkInfo_HealthcareApisManagementClient.cs @@ -23,7 +23,6 @@ public static IEnumerable> ApiInfo_HealthcareApisM new Tuple("HealthcareApis", "OperationResults", "2018-08-20-preview"), new Tuple("HealthcareApis", "Operations", "2018-08-20-preview"), new Tuple("HealthcareApis", "Services", "2018-08-20-preview"), - new Tuple("HealthcareApisManagementClient", "Services", "2018-08-20-preview"), }.AsEnumerable(); } } diff --git a/src/SDKs/HealthcareApis/Management.HealthcareApis/Generated/ServicesOperations.cs b/src/SDKs/HealthcareApis/Management.HealthcareApis/Generated/ServicesOperations.cs index ff462819b9150..a8e8e9764b9f2 100644 --- a/src/SDKs/HealthcareApis/Management.HealthcareApis/Generated/ServicesOperations.cs +++ b/src/SDKs/HealthcareApis/Management.HealthcareApis/Generated/ServicesOperations.cs @@ -859,29 +859,6 @@ internal ServicesOperations(HealthcareApisManagementClient client) return _result; } - /// - /// Moves resources to another subscription and/or resource group. - /// - /// - /// The name of the resource group that contains the service instance. - /// - /// - /// Set the move resource structure to the name of the service instance to - /// check. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async Task MoveResourcesWithHttpMessagesAsync(string resourceGroupName, MoveResourcesParameters moveResourcesInputs, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - // Send request - AzureOperationResponse _response = await BeginMoveResourcesWithHttpMessagesAsync(resourceGroupName, moveResourcesInputs, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - /// /// Create or update the metadata of a service instance. /// @@ -1538,193 +1515,6 @@ internal ServicesOperations(HealthcareApisManagementClient client) return _result; } - /// - /// Moves resources to another subscription and/or resource group. - /// - /// - /// The name of the resource group that contains the service instance. - /// - /// - /// Set the move resource structure to the name of the service instance to - /// check. - /// - /// - /// 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 BeginMoveResourcesWithHttpMessagesAsync(string resourceGroupName, MoveResourcesParameters moveResourcesInputs, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - if (resourceGroupName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); - } - if (resourceGroupName != null) - { - if (resourceGroupName.Length > 90) - { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); - } - if (resourceGroupName.Length < 1) - { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); - } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } - } - if (moveResourcesInputs == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "moveResourcesInputs"); - } - if (moveResourcesInputs != null) - { - moveResourcesInputs.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("moveResourcesInputs", moveResourcesInputs); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginMoveResources", tracingParameters); - } - // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/moveResources").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(Client.SubscriptionId, Client.SerializationSettings).Trim('"'))); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - 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; - if(moveResourcesInputs != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(moveResourcesInputs, 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); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 202) - { - var ex = new ErrorDetailsException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ErrorDetails _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - if (_errorBody != null) - { - ex.Body = _errorBody; - } - } - catch (JsonException) - { - // Ignore the exception - } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_shouldTrace) - { - ServiceClientTracing.Error(_invocationId, ex); - } - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw ex; - } - // Create Result - var _result = new AzureOperationResponse(); - _result.Request = _httpRequest; - _result.Response = _httpResponse; - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - /// /// Get all the service instances in a subscription. /// diff --git a/src/SDKs/HealthcareApis/Management.HealthcareApis/Generated/ServicesOperationsExtensions.cs b/src/SDKs/HealthcareApis/Management.HealthcareApis/Generated/ServicesOperationsExtensions.cs index c50c40aaefc63..1124beee24edb 100644 --- a/src/SDKs/HealthcareApis/Management.HealthcareApis/Generated/ServicesOperationsExtensions.cs +++ b/src/SDKs/HealthcareApis/Management.HealthcareApis/Generated/ServicesOperationsExtensions.cs @@ -284,45 +284,6 @@ public static ServicesNameAvailabilityInfo CheckNameAvailability(this IServicesO } } - /// - /// Moves resources to another subscription and/or resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group that contains the service instance. - /// - /// - /// Set the move resource structure to the name of the service instance to - /// check. - /// - public static void MoveResources(this IServicesOperations operations, string resourceGroupName, MoveResourcesParameters moveResourcesInputs) - { - operations.MoveResourcesAsync(resourceGroupName, moveResourcesInputs).GetAwaiter().GetResult(); - } - - /// - /// Moves resources to another subscription and/or resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group that contains the service instance. - /// - /// - /// Set the move resource structure to the name of the service instance to - /// check. - /// - /// - /// The cancellation token. - /// - public static async Task MoveResourcesAsync(this IServicesOperations operations, string resourceGroupName, MoveResourcesParameters moveResourcesInputs, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.MoveResourcesWithHttpMessagesAsync(resourceGroupName, moveResourcesInputs, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - /// /// Create or update the metadata of a service instance. /// @@ -452,45 +413,6 @@ public static void BeginDelete(this IServicesOperations operations, string resou (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, resourceName, null, cancellationToken).ConfigureAwait(false)).Dispose(); } - /// - /// Moves resources to another subscription and/or resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group that contains the service instance. - /// - /// - /// Set the move resource structure to the name of the service instance to - /// check. - /// - public static void BeginMoveResources(this IServicesOperations operations, string resourceGroupName, MoveResourcesParameters moveResourcesInputs) - { - operations.BeginMoveResourcesAsync(resourceGroupName, moveResourcesInputs).GetAwaiter().GetResult(); - } - - /// - /// Moves resources to another subscription and/or resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group that contains the service instance. - /// - /// - /// Set the move resource structure to the name of the service instance to - /// check. - /// - /// - /// The cancellation token. - /// - public static async Task BeginMoveResourcesAsync(this IServicesOperations operations, string resourceGroupName, MoveResourcesParameters moveResourcesInputs, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.BeginMoveResourcesWithHttpMessagesAsync(resourceGroupName, moveResourcesInputs, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - /// /// Get all the service instances in a subscription. /// From eca6bdbc3b183ed5bb35b44a6208d9b551b5ae05 Mon Sep 17 00:00:00 2001 From: Yazan Al-Alul Date: Tue, 4 Jun 2019 10:44:58 -0700 Subject: [PATCH 04/14] Updates --- .../Generated/HealthcareApisManagementClient.cs | 6 ------ .../Generated/IHealthcareApisManagementClient.cs | 5 ----- .../SdkInfo_HealthcareApisManagementClient.cs | 12 +++++++++++- .../Microsoft.Azure.Management.HealthcareApis.csproj | 2 +- .../Management.HealthcareApis/generate.ps1 | 2 +- 5 files changed, 13 insertions(+), 14 deletions(-) diff --git a/src/SDKs/HealthcareApis/Management.HealthcareApis/Generated/HealthcareApisManagementClient.cs b/src/SDKs/HealthcareApis/Management.HealthcareApis/Generated/HealthcareApisManagementClient.cs index e115c14aca093..4c77b6d36362c 100644 --- a/src/SDKs/HealthcareApis/Management.HealthcareApis/Generated/HealthcareApisManagementClient.cs +++ b/src/SDKs/HealthcareApis/Management.HealthcareApis/Generated/HealthcareApisManagementClient.cs @@ -85,11 +85,6 @@ public partial class HealthcareApisManagementClient : ServiceClient public virtual IOperationResultsOperations OperationResults { get; private set; } - /// - /// Gets the IMoveResourcesStatusOperations. - /// - public virtual IMoveResourcesStatusOperations MoveResourcesStatus { get; private set; } - /// /// Initializes a new instance of the HealthcareApisManagementClient class. /// @@ -334,7 +329,6 @@ private void Initialize() Services = new ServicesOperations(this); Operations = new Operations(this); OperationResults = new OperationResultsOperations(this); - MoveResourcesStatus = new MoveResourcesStatusOperations(this); BaseUri = new System.Uri("https://management.azure.com"); ApiVersion = "2018-08-20-preview"; AcceptLanguage = "en-US"; diff --git a/src/SDKs/HealthcareApis/Management.HealthcareApis/Generated/IHealthcareApisManagementClient.cs b/src/SDKs/HealthcareApis/Management.HealthcareApis/Generated/IHealthcareApisManagementClient.cs index 1b1f1b7656499..fef00e4777543 100644 --- a/src/SDKs/HealthcareApis/Management.HealthcareApis/Generated/IHealthcareApisManagementClient.cs +++ b/src/SDKs/HealthcareApis/Management.HealthcareApis/Generated/IHealthcareApisManagementClient.cs @@ -80,10 +80,5 @@ public partial interface IHealthcareApisManagementClient : System.IDisposable /// IOperationResultsOperations OperationResults { get; } - /// - /// Gets the IMoveResourcesStatusOperations. - /// - IMoveResourcesStatusOperations MoveResourcesStatus { get; } - } } diff --git a/src/SDKs/HealthcareApis/Management.HealthcareApis/Generated/SdkInfo_HealthcareApisManagementClient.cs b/src/SDKs/HealthcareApis/Management.HealthcareApis/Generated/SdkInfo_HealthcareApisManagementClient.cs index 6b62f2f7b5b58..5151f4da3096d 100644 --- a/src/SDKs/HealthcareApis/Management.HealthcareApis/Generated/SdkInfo_HealthcareApisManagementClient.cs +++ b/src/SDKs/HealthcareApis/Management.HealthcareApis/Generated/SdkInfo_HealthcareApisManagementClient.cs @@ -19,12 +19,22 @@ public static IEnumerable> ApiInfo_HealthcareApisM { return new Tuple[] { - new Tuple("HealthcareApis", "MoveResourcesStatus", "2018-08-20-preview"), new Tuple("HealthcareApis", "OperationResults", "2018-08-20-preview"), new Tuple("HealthcareApis", "Operations", "2018-08-20-preview"), new Tuple("HealthcareApis", "Services", "2018-08-20-preview"), }.AsEnumerable(); } } + // BEGIN: Code Generation Metadata Section + public static readonly String AutoRestVersion = "2.0.4283"; + public static readonly String AutoRestBootStrapperVersion = "autorest@2.0.4283"; + public static readonly String AutoRestCmdExecuted = "cmd.exe /c autorest.cmd C:/dev/yazanmsft/azure-rest-api-specs/specification/healthcareapis/resource-manager/readme.md --csharp --version=2.0.4283 --reflect-api-versions --csharp.namespace=Microsoft.Azure.Management.HealthcareApis --csharp.output-folder=C:/dev/yazanmsft/azure-sdk-for-net/src/SDKs/HealthcareApis/Management.HealthcareApis/Generated"; + public static readonly String GithubForkName = "Azure"; + public static readonly String GithubBranchName = "master"; + public static readonly String GithubCommidId = "a2e744bb0f7a32513b14ce9fa776e6cd9f906fc7"; + public static readonly String CodeGenerationErrors = ""; + public static readonly String GithubRepoName = "azure-rest-api-specs"; + // END: Code Generation Metadata Section } } + diff --git a/src/SDKs/HealthcareApis/Management.HealthcareApis/Microsoft.Azure.Management.HealthcareApis.csproj b/src/SDKs/HealthcareApis/Management.HealthcareApis/Microsoft.Azure.Management.HealthcareApis.csproj index 2105a6b50434b..cf6626a3721ad 100644 --- a/src/SDKs/HealthcareApis/Management.HealthcareApis/Microsoft.Azure.Management.HealthcareApis.csproj +++ b/src/SDKs/HealthcareApis/Management.HealthcareApis/Microsoft.Azure.Management.HealthcareApis.csproj @@ -8,7 +8,7 @@ Provides management capabilities for Microsoft Azure Healthcare Apis. Microsoft Azure Healthcare Apis Management Microsoft.Azure.Management.HealthcareApis - 1.0.4-preview + 1.0.5-preview Microsoft.Azure.Management.HealthcareApis Microsoft Azure Healthcare Apis;HealthcareApis management;HealthcareApis; Management SDK for Healthcare APIs. diff --git a/src/SDKs/HealthcareApis/Management.HealthcareApis/generate.ps1 b/src/SDKs/HealthcareApis/Management.HealthcareApis/generate.ps1 index 433aecddf5d44..d6c9d9096ecf8 100644 --- a/src/SDKs/HealthcareApis/Management.HealthcareApis/generate.ps1 +++ b/src/SDKs/HealthcareApis/Management.HealthcareApis/generate.ps1 @@ -1,2 +1,2 @@ -Start-AutoRestCodeGenerationWithLocalConfig -ResourceProvider "healthcareapis/resource-manager" -AutoRestVersion "latest" -LocalConfigFilePath "C:/dev/yazanmsft/azure-rest-api-specs/specification/healthcareapis/resource-manager/readme.md" -SdkDirectory "C:/dev/yazanmsft/azure-sdk-for-net/src/SDKs/HealthcareApis/Management.HealthcareApis/Generated" -Namespace Microsoft.Azure.Management.HealthcareApis +Start-AutoRestCodeGenerationWithLocalConfig -ResourceProvider "healthcareapis/resource-manager" -AutoRestVersion "2.0.4283" -LocalConfigFilePath "C:/dev/yazanmsft/azure-rest-api-specs/specification/healthcareapis/resource-manager/readme.md" -SdkDirectory "C:/dev/yazanmsft/azure-sdk-for-net/src/SDKs/HealthcareApis/Management.HealthcareApis/Generated" -Namespace Microsoft.Azure.Management.HealthcareApis # Start-AutoRestCodeGeneration -ResourceProvider "healthcareapis/resource-manager" -AutoRestVersion "latest" From 86814941e8f896bb850dfb8c63f340a768b97999 Mon Sep 17 00:00:00 2001 From: Pooja Adhikari Date: Sun, 23 Jun 2019 22:19:52 -0700 Subject: [PATCH 05/14] Inital Comit --- .../HealthcareApis.Tests.csproj | 153 +++++++++ .../HealthcareApisManagementTestUtilities.cs | 183 +++++++++++ .../Helpers/RecordedDelegatingHandler.cs | 88 +++++ .../Properties/AssemblyInfo.cs | 36 ++ ...thcareApisAccountUpdateWithCreateTest.json | 307 ++++++++++++++++++ ...althcareApisCheckNameAvailabilityTest.json | 80 +++++ .../HealthcareApisCreateAccountErrorTest.json | 155 +++++++++ .../HealthcareApisCreateTest.json | 155 +++++++++ ...ealthcareApisCreateWithParametersTest.json | 155 +++++++++ .../HealthcareApisDeleteAccountErrorTest.json | 139 ++++++++ .../HealthcareApisDeleteTest.json | 277 ++++++++++++++++ .../HealthcareApisGetAccountTest.json | 228 +++++++++++++ .../HealthcareApisListAccountsTest.json | 82 +++++ .../Tests/HealthcareApisTests.cs | 244 ++++++++++++++ .../HealthcareApis.Tests/app.config | 11 + .../HealthcareApis.Tests/packages.config | 21 ++ src/SDKs/HealthcareApis/HealthcareApis.sln | 12 +- ...ure.Management.HealthcareApis.Tests.csproj | 15 - .../HealthcareApisManagementClient.cs | 2 +- .../IHealthcareApisManagementClient.cs | 2 +- ...oft.Azure.Management.HealthcareApis.csproj | 10 +- .../Properties/AssemblyInfo.cs | 18 - 22 files changed, 2331 insertions(+), 42 deletions(-) create mode 100644 src/SDKs/HealthcareApis/HealthcareApis.Tests/HealthcareApis.Tests.csproj create mode 100644 src/SDKs/HealthcareApis/HealthcareApis.Tests/Helpers/HealthcareApisManagementTestUtilities.cs create mode 100644 src/SDKs/HealthcareApis/HealthcareApis.Tests/Helpers/RecordedDelegatingHandler.cs create mode 100644 src/SDKs/HealthcareApis/HealthcareApis.Tests/Properties/AssemblyInfo.cs create mode 100644 src/SDKs/HealthcareApis/HealthcareApis.Tests/SessionRecords/HealthcareApisTests/HealthcareApisAccountUpdateWithCreateTest.json create mode 100644 src/SDKs/HealthcareApis/HealthcareApis.Tests/SessionRecords/HealthcareApisTests/HealthcareApisCheckNameAvailabilityTest.json create mode 100644 src/SDKs/HealthcareApis/HealthcareApis.Tests/SessionRecords/HealthcareApisTests/HealthcareApisCreateAccountErrorTest.json create mode 100644 src/SDKs/HealthcareApis/HealthcareApis.Tests/SessionRecords/HealthcareApisTests/HealthcareApisCreateTest.json create mode 100644 src/SDKs/HealthcareApis/HealthcareApis.Tests/SessionRecords/HealthcareApisTests/HealthcareApisCreateWithParametersTest.json create mode 100644 src/SDKs/HealthcareApis/HealthcareApis.Tests/SessionRecords/HealthcareApisTests/HealthcareApisDeleteAccountErrorTest.json create mode 100644 src/SDKs/HealthcareApis/HealthcareApis.Tests/SessionRecords/HealthcareApisTests/HealthcareApisDeleteTest.json create mode 100644 src/SDKs/HealthcareApis/HealthcareApis.Tests/SessionRecords/HealthcareApisTests/HealthcareApisGetAccountTest.json create mode 100644 src/SDKs/HealthcareApis/HealthcareApis.Tests/SessionRecords/HealthcareApisTests/HealthcareApisListAccountsTest.json create mode 100644 src/SDKs/HealthcareApis/HealthcareApis.Tests/Tests/HealthcareApisTests.cs create mode 100644 src/SDKs/HealthcareApis/HealthcareApis.Tests/app.config create mode 100644 src/SDKs/HealthcareApis/HealthcareApis.Tests/packages.config delete mode 100644 src/SDKs/HealthcareApis/Management.HealthcareApis.Tests/Microsoft.Azure.Management.HealthcareApis.Tests.csproj delete mode 100644 src/SDKs/HealthcareApis/Management.HealthcareApis/Properties/AssemblyInfo.cs diff --git a/src/SDKs/HealthcareApis/HealthcareApis.Tests/HealthcareApis.Tests.csproj b/src/SDKs/HealthcareApis/HealthcareApis.Tests/HealthcareApis.Tests.csproj new file mode 100644 index 0000000000000..d242189170567 --- /dev/null +++ b/src/SDKs/HealthcareApis/HealthcareApis.Tests/HealthcareApis.Tests.csproj @@ -0,0 +1,153 @@ + + + + + + Debug + AnyCPU + {060A808A-4DE1-4072-9DEF-9DC75A353C51} + Library + Properties + HealthcareApis.Tests + HealthcareApis.Tests + v4.6.1 + 512 + true + + + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + ..\packages\Microsoft.Azure.Management.ResourceManager.2.1.0-preview\lib\net461\Microsoft.Azure.Management.ResourceManager.dll + + + ..\packages\Microsoft.Azure.Management.ResourceManager.Fluent.1.22.2\lib\net461\Microsoft.Azure.Management.ResourceManager.Fluent.dll + + + ..\packages\Microsoft.Azure.Test.HttpRecorder.1.13.2\lib\net461\Microsoft.Azure.Test.HttpRecorder.dll + + + ..\packages\Microsoft.IdentityModel.Clients.ActiveDirectory.3.14.0\lib\net45\Microsoft.IdentityModel.Clients.ActiveDirectory.dll + + + ..\packages\Microsoft.IdentityModel.Clients.ActiveDirectory.3.14.0\lib\net45\Microsoft.IdentityModel.Clients.ActiveDirectory.Platform.dll + + + ..\packages\Microsoft.IdentityModel.Logging.1.1.2\lib\net451\Microsoft.IdentityModel.Logging.dll + + + ..\packages\Microsoft.IdentityModel.Tokens.5.1.2\lib\net451\Microsoft.IdentityModel.Tokens.dll + + + ..\packages\Microsoft.Rest.ClientRuntime.2.3.19\lib\net461\Microsoft.Rest.ClientRuntime.dll + + + ..\packages\Microsoft.Rest.ClientRuntime.Azure.3.3.19\lib\net461\Microsoft.Rest.ClientRuntime.Azure.dll + + + ..\packages\Microsoft.Rest.ClientRuntime.Azure.Authentication.2.3.7\lib\net461\Microsoft.Rest.ClientRuntime.Azure.Authentication.dll + + + ..\packages\Microsoft.Rest.ClientRuntime.Azure.TestFramework.1.7.6\lib\net461\Microsoft.Rest.ClientRuntime.Azure.TestFramework.dll + + + ..\packages\Newtonsoft.Json.10.0.3\lib\net45\Newtonsoft.Json.dll + + + + + + + + + + + + + + + ..\packages\xunit.abstractions.2.0.3\lib\net35\xunit.abstractions.dll + + + ..\packages\xunit.assert.2.4.1\lib\netstandard1.1\xunit.assert.dll + + + ..\packages\xunit.extensibility.core.2.4.1\lib\net452\xunit.core.dll + + + ..\packages\xunit.extensibility.execution.2.4.1\lib\net452\xunit.execution.desktop.dll + + + + + + + + + + + + + + + + Always + + + Always + + + Always + + + Always + + + Always + + + Always + + + Always + + + Always + + + Always + + + + + {6f4e6681-fa47-4ffc-8e02-32212fdeddc9} + Microsoft.Azure.Management.HealthcareApis + + + + + + This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. + + + + + + \ No newline at end of file diff --git a/src/SDKs/HealthcareApis/HealthcareApis.Tests/Helpers/HealthcareApisManagementTestUtilities.cs b/src/SDKs/HealthcareApis/HealthcareApis.Tests/Helpers/HealthcareApisManagementTestUtilities.cs new file mode 100644 index 0000000000000..900ddf6b59d95 --- /dev/null +++ b/src/SDKs/HealthcareApis/HealthcareApis.Tests/Helpers/HealthcareApisManagementTestUtilities.cs @@ -0,0 +1,183 @@ +using Microsoft.Azure.Management.HealthcareApis; +using Microsoft.Azure.Management.HealthcareApis.Models; +using Microsoft.Azure.Management.ResourceManager; +using Microsoft.Azure.Management.ResourceManager.Models; +using Microsoft.Rest; +using Microsoft.Rest.ClientRuntime.Azure.TestFramework; +using System; +using System.Collections.Generic; +using System.Net.Http; +using Xunit; + +namespace HealthcareApis.Tests.Helpers +{ + public static class HealthcareApisManagementTestUtilities + { + public static bool IsTestTenant = false; + private static HttpClientHandler Handler = null; + + private static System.Guid testSubscription = System.Guid.Empty; + private static Uri testUri = null; + + // These are used to create default accounts + public static string DefaultLocation = IsTestTenant ? null : "westus"; + public const string DefaultKind = "Fhir"; + public static Dictionary DefaultTags = new Dictionary + { + {"key1","value1"}, + {"key2","value2"} + }; + + public static Dictionary UpdateTags = new Dictionary + { + {"key3","value3"}, + {"key4","value4"}, + {"key5", "value5"} + }; + + public static string objectId = "7df19f2f-6169-40f0-ac1e-9a9b4e65a898"; + public static string authority = "https://login.microsoftonline.com/common"; + public static string audience = "https://azurehealthcareapis.com"; + public static bool smartOnFhirEnabled = false; + public static int offerThroughput = 400; + + private static HttpClientHandler GetHandler() + { + return Handler; + } + + public static HealthcareApisManagementClient GetHealthcareApisManagementClient(MockContext context, RecordedDelegatingHandler handler) + { + HealthcareApisManagementClient healthcareApisManagementClient; + if (IsTestTenant) + { + healthcareApisManagementClient = new HealthcareApisManagementClient(new TokenCredentials("xyz"), GetHandler()); + healthcareApisManagementClient.SubscriptionId = "testSubscription"; + healthcareApisManagementClient.BaseUri = testUri; + } + else + { + handler.IsPassThrough = true; + healthcareApisManagementClient = context.GetServiceClient(handlers: handler); + } + return healthcareApisManagementClient; + } + + public static ServicesDescription GetServiceDescription() + { + var serviceDescription = new ServicesDescription(DefaultLocation); + return serviceDescription; + + } + + public static ServicesPatchDescription GetServicePatchDescription() + { + var servicePatchDescription = new ServicesPatchDescription(UpdateTags); + return servicePatchDescription; + + } + + public static ServicesDescription GetServiceDescriptionWithProperties() + { + var serviceProperties = GetServiceProperties(); + var serviceDescription = new ServicesDescription(DefaultLocation, default(string), default(string), default(string), DefaultTags, default(string), serviceProperties); + return serviceDescription; + } + + public static ServicesProperties GetServiceProperties() + { + + IList accessPolicies = new List(); + accessPolicies.Add(new ServiceAccessPolicyEntry(objectId)); + + string provisioningState = "Succeeded"; + + ServiceCosmosDbConfigurationInfo cosmosDbConfigurationInfo = new ServiceCosmosDbConfigurationInfo(offerThroughput); + ServiceAuthenticationConfigurationInfo authenticationConfigurationInfo = new ServiceAuthenticationConfigurationInfo(authority, audience, smartOnFhirEnabled); + + var serviceProperties = new ServicesProperties(accessPolicies, provisioningState, cosmosDbConfigurationInfo, authenticationConfigurationInfo); + + return serviceProperties; + } + + public static string GetLocationFromProvider(this ResourceManagementClient resourceManagementClient) + { + return "westus2"; + } + + public static void VerifyAccountProperties(ServicesDescription account, bool useDefaults, string location = "westus") + { + // verifies that the account is actually created + Assert.NotNull(account); + Assert.NotNull(account.Id); + Assert.NotNull(account.Location); + Assert.NotNull(account.Name); + Assert.NotNull(account.Etag); + Assert.NotNull(account.Properties); + Assert.Equal(ProvisioningState.Succeeded, account.Properties.ProvisioningState); + + if (!useDefaults) + { + Assert.NotNull(account.Properties.AuthenticationConfiguration); + Assert.NotNull(account.Properties.CosmosDbConfiguration); + Assert.NotNull(account.Properties.AccessPolicies); + Assert.Equal("https://login.microsoftonline.com/common", account.Properties.AuthenticationConfiguration.Authority); + Assert.Equal("https://azurehealthcareapis.com", account.Properties.AuthenticationConfiguration.Audience); + Assert.False(account.Properties.AuthenticationConfiguration.SmartProxyEnabled); + Assert.Equal(400, account.Properties.CosmosDbConfiguration.OfferThroughput); + Assert.Equal(1, account.Properties.AccessPolicies.Count); + Assert.Equal(ProvisioningState.Succeeded, account.Properties.ProvisioningState); + } + } + + public static void ValidateExpectedException(Action action, string expectedErrorCode) + { + try + { + action(); + Assert.True(false, "Expected an Exception"); + } + catch (ErrorDetailsException e) + { + Assert.Equal(expectedErrorCode, e.Response.StatusCode.ToString()); + } + } + + public static ResourceManagementClient GetResourceManagementClient(MockContext context, RecordedDelegatingHandler handler) + { + if (IsTestTenant) + { + return null; + } + else + { + handler.IsPassThrough = true; + ResourceManagementClient resourcesClient = context.GetServiceClient(handlers: handler); + return resourcesClient; + } + } + + public static string CreateHealthcareApisServicesAccount(HealthcareApisManagementClient healthcareApisManagementClient, string rgname, string kind = null) + { + string accountName = TestUtilities.GenerateName("csa"); + return accountName; + } + + public static string CreateResourceGroup(ResourceManagementClient resourcesClient) + { + var rgname = "res7089"; + + if (!IsTestTenant) + { + var resourceGroup = resourcesClient.ResourceGroups.CreateOrUpdateAsync( + rgname, + new ResourceGroup + { + Location = DefaultLocation + }); + } + + return rgname; + } + } +} diff --git a/src/SDKs/HealthcareApis/HealthcareApis.Tests/Helpers/RecordedDelegatingHandler.cs b/src/SDKs/HealthcareApis/HealthcareApis.Tests/Helpers/RecordedDelegatingHandler.cs new file mode 100644 index 0000000000000..e46ccf157e147 --- /dev/null +++ b/src/SDKs/HealthcareApis/HealthcareApis.Tests/Helpers/RecordedDelegatingHandler.cs @@ -0,0 +1,88 @@ +using System; +using System.Net; +using System.Net.Http; +using System.Net.Http.Headers; +using System.Threading.Tasks; + +namespace HealthcareApis.Tests.Helpers +{ + public class RecordedDelegatingHandler : DelegatingHandler + { + + private HttpResponseMessage _response; + + public RecordedDelegatingHandler() + { + StatusCodeToReturn = HttpStatusCode.Created; + SubsequentStatusCodeToReturn = StatusCodeToReturn; + } + + public RecordedDelegatingHandler(HttpResponseMessage response) + { + StatusCodeToReturn = HttpStatusCode.Created; + SubsequentStatusCodeToReturn = StatusCodeToReturn; + _response = response; + } + + public HttpStatusCode StatusCodeToReturn { get; set; } + + public HttpStatusCode SubsequentStatusCodeToReturn { get; set; } + + public string Request { get; private set; } + + public HttpRequestHeaders RequestHeaders { get; private set; } + + public HttpContentHeaders ContentHeaders { get; private set; } + + public HttpMethod Method { get; private set; } + + public Uri Uri { get; private set; } + + public bool IsPassThrough { get; set; } + + private int counter; + + protected override async Task SendAsync(HttpRequestMessage request, System.Threading.CancellationToken cancellationToken) + { + counter++; + // Save request + if (request.Content == null) + { + Request = string.Empty; + } + else + { + Request = await request.Content.ReadAsStringAsync(); + } + RequestHeaders = request.Headers; + if (request.Content != null) + { + ContentHeaders = request.Content.Headers; + } + Method = request.Method; + Uri = request.RequestUri; + + // Prepare response + if (IsPassThrough) + { + return await base.SendAsync(request, cancellationToken); + } + else + { + if (_response != null && counter == 1) + { + return _response; + } + else + { + var statusCode = StatusCodeToReturn; + if (counter > 1) + statusCode = SubsequentStatusCodeToReturn; + HttpResponseMessage response = new HttpResponseMessage(statusCode); + response.Content = new StringContent(""); + return response; + } + } + } + } +} diff --git a/src/SDKs/HealthcareApis/HealthcareApis.Tests/Properties/AssemblyInfo.cs b/src/SDKs/HealthcareApis/HealthcareApis.Tests/Properties/AssemblyInfo.cs new file mode 100644 index 0000000000000..9bbfe4bf0acab --- /dev/null +++ b/src/SDKs/HealthcareApis/HealthcareApis.Tests/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("HealthcareApis.Tests")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("HP Inc.")] +[assembly: AssemblyProduct("HealthcareApis.Tests")] +[assembly: AssemblyCopyright("Copyright © HP Inc. 2019")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("060a808a-4de1-4072-9def-9dc75a353c51")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/src/SDKs/HealthcareApis/HealthcareApis.Tests/SessionRecords/HealthcareApisTests/HealthcareApisAccountUpdateWithCreateTest.json b/src/SDKs/HealthcareApis/HealthcareApis.Tests/SessionRecords/HealthcareApisTests/HealthcareApisAccountUpdateWithCreateTest.json new file mode 100644 index 0000000000000..6ba1ea406c995 --- /dev/null +++ b/src/SDKs/HealthcareApis/HealthcareApis.Tests/SessionRecords/HealthcareApisTests/HealthcareApisAccountUpdateWithCreateTest.json @@ -0,0 +1,307 @@ +{ + "Entries": [ + { + "RequestUri": "/subscriptions/cc148bf2-42fb-4913-a3fb-2f284a69eb89/resourcegroups/res7089?api-version=2017-05-10", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvYzI0Mzc0NWQtNTBiYi00OGQxLTllNjItM2Y3MmVmYjMxNjZjL3Jlc291cmNlZ3JvdXBzL3JlczcwODk/YXBpLXZlcnNpb249MjAxNy0wNS0xMA==", + "RequestMethod": "PUT", + "RequestBody": "{\r\n \"location\": \"westus\"\r\n}", + "RequestHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Content-Length": [ + "28" + ], + "x-ms-client-request-id": [ + "89e61421-87a0-4d25-b6a1-946a8f9df00b" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.25211.01", + "Microsoft.Azure.Management.ResourceManager.ResourceManagementClient/1.6.0.0" + ] + }, + "ResponseBody": "{\r\n \"id\": \"/subscriptions/cc148bf2-42fb-4913-a3fb-2f284a69eb89/resourceGroups/res7089\",\r\n \"name\": \"hca1234\",\r\n \"location\": \"westus\",\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\"\r\n }\r\n}", + "ResponseHeaders": { + "Content-Length": [ + "167" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Fri, 09 Mar 2018 08:09:16 GMT" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-ratelimit-remaining-subscription-writes": [ + "1181" + ], + "x-ms-request-id": [ + "d55f54ca-0ad2-4798-9741-a96462bd1cb8" + ], + "x-ms-correlation-request-id": [ + "9e622289-028e-44a3-bbcd-904ae16adbd3" + ], + "x-ms-routing-request-id": [ + "WESTUS:20190618T153235Z:d55f54ca-0ad2-4798-9741-a96462bd1cb8" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ] + }, + "StatusCode": 201 + }, + { + "RequestUri": "/subscriptions/cc148bf2-42fb-4913-a3fb-2f284a69eb89/resourceGroups/res7089/providers/Microsoft.HealthcareApis/services/hca1234?api-version=2018-08-20-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvY2MxNDhiZjItNDJmYi00OTEzLWEzZmItMmYyODRhNjllYjg5L3Jlc291cmNlR3JvdXBzL3JlczcwODkvcHJvdmlkZXJzL01pY3Jvc29mdC5IZWFsdGhjYXJlQXBpcy9zZXJ2aWNlcy9oY2ExMjM0P2FwaS12ZXJzaW9uPTIwMTgtMDgtMjAtcHJldmlldw==", + "RequestMethod": "PUT", + "RequestBody": "{\r\n \"sku\": {\r\n \"name\": \"S1\"\r\n },\r\n \"location\": \"westus\",\r\n \"properties\": {}\r\n}", + "RequestHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Content-Length": [ + "113" + ], + "x-ms-client-request-id": [ + "39bce3ac-f86e-490f-92d3-260643c3a770" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.25211.01", + "Microsoft.Azure.Management.HealthcareApis.HealthcareApisManagementClient/1.0.0.0" + ] + }, + "ResponseBody": "{\r\n \"id\": \"/subscriptions/cc148bf2-42fb-4913-a3fb-2f284a69eb89/resourceGroups/res7089/providers/Microsoft.HealthcareApis/accounts/hca1234\",\r\n \"name\": \"hca1234\",\r\n \"type\": \"Microsoft.HealthcareApis/accounts\",\r\n \"etag\": \"\\\"0a002ee3-0000-0000-0000-5aa238d80000\\\"\",\r\n \"location\": \"westus\",\r\n \"sku\": {\r\n \"name\": \"S1\"\r\n },\r\n \"kind\": \"Fhir\",\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\"\r\n }\r\n}", + "ResponseHeaders": { + "Content-Length": [ + "570" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Fri, 09 Mar 2018 07:33:44 GMT" + ], + "Pragma": [ + "no-cache" + ], + "ETag": [ + "\"0a002ee3-0000-0000-0000-5aa238d80000\"" + ], + "Server": [ + "Microsoft-IIS/10.0" + ], + "x-ms-request-id": [ + "2263b931-e233-4217-bfba-448ee3ac8346" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-AspNet-Version": [ + "4.0.30319" + ], + "X-Powered-By": [ + "ASP.NET" + ], + "x-ms-ratelimit-remaining-subscription-writes": [ + "1196" + ], + "x-ms-correlation-request-id": [ + "977d2f5c-4af0-4c2e-8068-6de427d796c0" + ], + "x-ms-routing-request-id": [ + "WESTUS:20180309T073344Z:977d2f5c-4af0-4c2e-8068-6de427d796c0" + ], + "X-Content-Type-Options": [ + "nosniff" + ] + }, + "StatusCode": 201 + }, + { + "RequestUri": "/subscriptions/cc148bf2-42fb-4913-a3fb-2f284a69eb89/resourceGroups/res7089/providers/Microsoft.HealthcareApis/services/hca1234?api-version=2018-08-20-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvY2MxNDhiZjItNDJmYi00OTEzLWEzZmItMmYyODRhNjllYjg5L3Jlc291cmNlR3JvdXBzL3JlczcwODkvcHJvdmlkZXJzL01pY3Jvc29mdC5IZWFsdGhjYXJlQXBpcy9zZXJ2aWNlcy9oY2ExMjM0P2FwaS12ZXJzaW9uPTIwMTgtMDgtMjAtcHJldmlldw==", + "RequestMethod": "PATCH", + "RequestBody": "{\r\n \"tags\": {\r\n \"key3\": \"value3\",\r\n \"key4\": \"value4\",\r\n \"key5\": \"value5\"\r\n }\r\n}", + "RequestHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Content-Length": [ + "90" + ], + "x-ms-client-request-id": [ + "89a2cb9c-7fe3-46ea-9379-4c74c189c3a2" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.25211.01", + "Microsoft.Azure.Management.HealthcareApis.HealthcareApisManagementClient/1.0.0.0\"" + ] + }, + "ResponseBody": "{\r\n \"id\": \"/subscriptions/cc148bf2-42fb-4913-a3fb-2f284a69eb89/resourceGroups/res7089/providers/Microsoft.HealthcareApis/services/account1234\",\r\n \"name\": \"account1234\",\r\n \"type\": \"Microsoft.HealthcareApis/accounts\",\r\n \"location\": \"westus\",\r\n \"sku\": {\r\n \"name\": \"S1\"\r\n },\r\n \"kind\": \"Fhir\",\r\n \"tags\": {\r\n \"key3\": \"value3\",\r\n \"key4\": \"value4\",\r\n \"key5\": \"value5\"\r\n },\"properties\": {\"provisioningState\": \"Succeeded\"}}", + "ResponseHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Fri, 09 Mar 2018 07:49:32 GMT" + ], + "Pragma": [ + "no-cache" + ], + "Transfer-Encoding": [ + "chunked" + ], + "ETag": [ + "\"0a00d3f7-0000-0000-0000-5aa23c8c0000\"" + ], + "Server": [ + "Microsoft-IIS/10.0" + ], + "Vary": [ + "Accept-Encoding" + ], + "x-ms-request-id": [ + "7fd27fd6-93bf-44e3-8cd1-bcda43236a37" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-AspNet-Version": [ + "4.0.30319" + ], + "X-Powered-By": [ + "ASP.NET" + ], + "x-ms-ratelimit-remaining-subscription-writes": [ + "1187" + ], + "x-ms-correlation-request-id": [ + "3c0db97e-ee18-4c7d-a994-0ca1195cec0c" + ], + "x-ms-routing-request-id": [ + "JAPANWEST:20180309T074933Z:3c0db97e-ee18-4c7d-a994-0ca1195cec0c" + ], + "X-Content-Type-Options": [ + "nosniff" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/cc148bf2-42fb-4913-a3fb-2f284a69eb89/resourceGroups/res7089/providers/Microsoft.HealthcareApis/services/hca1234?api-version=2018-08-20-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvY2MxNDhiZjItNDJmYi00OTEzLWEzZmItMmYyODRhNjllYjg5L3Jlc291cmNlR3JvdXBzL3JlczcwODkvcHJvdmlkZXJzL01pY3Jvc29mdC5IZWFsdGhjYXJlQXBpcy9zZXJ2aWNlcy9oY2ExMjM0P2FwaS12ZXJzaW9uPTIwMTgtMDgtMjAtcHJldmlldw==", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "65c39c9c-dcfd-47d3-a5ea-a98bfd4989bb" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.25211.01", + "Microsoft.Azure.Management.HealthcareApis.HealthcareApisManagementClient/3.0.0.0" + ] + }, + "ResponseBody": "{\r\n \"id\": \"/subscriptions/cc148bf2-42fb-4913-a3fb-2f284a69eb89/resourceGroups/res7089/providers/Microsoft.HealthcareApis/services/hca1234\",\r\n \"name\": \"hca1234\",\r\n \"type\": \"Microsoft.HealthcareApis/accounts\",\r\n \"location\": \"westus\",\r\n \"sku\": {\r\n \"name\": \"S1\"\r\n },\r\n \"kind\": \"Fhir\",\r\n \"tags\": {\r\n \"key3\": \"value3\",\r\n \"key4\": \"value4\",\r\n \"key5\": \"value5\"\r\n },\"properties\": {\"provisioningState\": \"Succeeded\"}}", + "ResponseHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Fri, 09 Mar 2018 07:49:29 GMT" + ], + "Pragma": [ + "no-cache" + ], + "Transfer-Encoding": [ + "chunked" + ], + "ETag": [ + "\"0a00bcf7-0000-0000-0000-5aa23c880000\"" + ], + "Server": [ + "Microsoft-IIS/10.0" + ], + "Vary": [ + "Accept-Encoding" + ], + "x-ms-request-id": [ + "4697a59a-84eb-4e5c-967e-085b2a555af8" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-AspNet-Version": [ + "4.0.30319" + ], + "X-Powered-By": [ + "ASP.NET" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14953" + ], + "x-ms-correlation-request-id": [ + "122819a6-98f9-4c61-b68c-c06a134c084f" + ], + "x-ms-routing-request-id": [ + "JAPANWEST:20180309T074930Z:122819a6-98f9-4c61-b68c-c06a134c084f" + ], + "X-Content-Type-Options": [ + "nosniff" + ] + }, + "StatusCode": 200 + } + ], + "Names": { + "CreateResourceGroup": [ + "res7089" + ], + "HealthcareApisAccountUpdateWithCreateTest": [ + "hca1234" + ] + }, + "Variables": { + "SubscriptionId": "cc148bf2-42fb-4913-a3fb-2f284a69eb89" + } +} diff --git a/src/SDKs/HealthcareApis/HealthcareApis.Tests/SessionRecords/HealthcareApisTests/HealthcareApisCheckNameAvailabilityTest.json b/src/SDKs/HealthcareApis/HealthcareApis.Tests/SessionRecords/HealthcareApisTests/HealthcareApisCheckNameAvailabilityTest.json new file mode 100644 index 0000000000000..8a24d600e2837 --- /dev/null +++ b/src/SDKs/HealthcareApis/HealthcareApis.Tests/SessionRecords/HealthcareApisTests/HealthcareApisCheckNameAvailabilityTest.json @@ -0,0 +1,80 @@ +{ + "Entries": [ + { + "RequestUri": "/subscriptions/cc148bf2-42fb-4913-a3fb-2f284a69eb89/providers/Microsoft.HealthcareApis/checkNameAvailability?api-version=2018-08-20-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvY2MxNDhiZjItNDJmYi00OTEzLWEzZmItMmYyODRhNjllYjg5L3Byb3ZpZGVycy9NaWNyb3NvZnQuSGVhbHRoY2FyZUFwaXMvY2hlY2tOYW1lQXZhaWxhYmlsaXR5P2FwaS12ZXJzaW9uPTIwMTgtMDgtMjAtcHJldmlldw==", + "RequestMethod": "POST", + "RequestBody": "{\"name\":\"account1234\",\"type\":\"Microsoft.HealthcareApis/services\"}", + "RequestHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Content-Length": [ + "57" + ], + "x-ms-client-request-id": [ + "ac7f273b-1df8-4c11-ab39-56f409c338c4" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.25211.01" + ] + }, + "ResponseBody": "{\"nameAvailable\": true,\"reason\": null,\"message\": null}", + "ResponseHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Tue, 16 May 2017 07:09:31 GMT" + ], + "Pragma": [ + "no-cache" + ], + "Transfer-Encoding": [ + "chunked" + ], + "Server": [ + "Microsoft-IIS/8.5" + ], + "Vary": [ + "Accept-Encoding" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-AspNet-Version": [ + "4.0.30319" + ], + "X-Powered-By": [ + "ASP.NET" + ], + "x-ms-ratelimit-remaining-subscription-writes": [ + "1190" + ], + "x-ms-request-id": [ + "f2b7789d-64df-415a-b750-21f95c2e9a43" + ], + "x-ms-correlation-request-id": [ + "f2b7789d-64df-415a-b750-21f95c2e9a43" + ], + "x-ms-routing-request-id": [ + "JAPANEAST:20170516T070931Z:f2b7789d-64df-415a-b750-21f95c2e9a43" + ] + }, + "StatusCode": 200 + } + ], + "Names": {}, + "Variables": { + "SubscriptionId": "cc148bf2-42fb-4913-a3fb-2f284a69eb89" + } +} \ No newline at end of file diff --git a/src/SDKs/HealthcareApis/HealthcareApis.Tests/SessionRecords/HealthcareApisTests/HealthcareApisCreateAccountErrorTest.json b/src/SDKs/HealthcareApis/HealthcareApis.Tests/SessionRecords/HealthcareApisTests/HealthcareApisCreateAccountErrorTest.json new file mode 100644 index 0000000000000..098fdbb466179 --- /dev/null +++ b/src/SDKs/HealthcareApis/HealthcareApis.Tests/SessionRecords/HealthcareApisTests/HealthcareApisCreateAccountErrorTest.json @@ -0,0 +1,155 @@ +{ + "Entries": [ + { + "RequestUri": "/subscriptions/cc148bf2-42fb-4913-a3fb-2f284a69eb89/resourcegroups/res7089?api-version=2017-05-10", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvYzI0Mzc0NWQtNTBiYi00OGQxLTllNjItM2Y3MmVmYjMxNjZjL3Jlc291cmNlZ3JvdXBzL3JlczcwODk/YXBpLXZlcnNpb249MjAxNy0wNS0xMA==", + "RequestMethod": "PUT", + "RequestBody": "{\r\n \"location\": \"westus\"\r\n}", + "RequestHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Content-Length": [ + "28" + ], + "x-ms-client-request-id": [ + "89e61421-87a0-4d25-b6a1-946a8f9df00b" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.25211.01", + "Microsoft.Azure.Management.ResourceManager.ResourceManagementClient/1.6.0.0" + ] + }, + "ResponseBody": "{\r\n \"id\": \"/subscriptions/cc148bf2-42fb-4913-a3fb-2f284a69eb89/resourceGroups/res7089\",\r\n \"name\": \"hca1234\",\r\n \"location\": \"westus\",\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\"\r\n }\r\n}", + "ResponseHeaders": { + "Content-Length": [ + "167" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Fri, 09 Mar 2018 08:09:16 GMT" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-ratelimit-remaining-subscription-writes": [ + "1181" + ], + "x-ms-request-id": [ + "d55f54ca-0ad2-4798-9741-a96462bd1cb8" + ], + "x-ms-correlation-request-id": [ + "9e622289-028e-44a3-bbcd-904ae16adbd3" + ], + "x-ms-routing-request-id": [ + "WESTUS:20190618T153235Z:d55f54ca-0ad2-4798-9741-a96462bd1cb8" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ] + }, + "StatusCode": 201 + }, + { + "RequestUri": "/subscriptions/cc148bf2-42fb-4913-a3fb-2f284a69eb89/resourceGroups/NotExistedRG/providers/Microsoft.HealthcareApis/services/hca1234?api-version=2018-08-20-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvY2MxNDhiZjItNDJmYi00OTEzLWEzZmItMmYyODRhNjllYjg5L3Jlc291cmNlR3JvdXBzL05vdEV4aXN0ZWRSRy9wcm92aWRlcnMvTWljcm9zb2Z0LkhlYWx0aGNhcmVBcGlzL3NlcnZpY2VzL2hjYTEyMzQ/YXBpLXZlcnNpb249MjAxOC0wOC0yMC1wcmV2aWV3", + "RequestMethod": "PUT", + "RequestBody": "{\r\n \"sku\": {\r\n \"name\": \"S1\"\r\n },\r\n \"location\": \"westus\",\r\n \"properties\": {}\r\n}", + "RequestHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Content-Length": [ + "113" + ], + "x-ms-client-request-id": [ + "39bce3ac-f86e-490f-92d3-260643c3a770" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.25211.01", + "Microsoft.Azure.Management.HealthcareApis.HealthcareApisManagementClient/1.0.0.0" + ] + }, + "ResponseBody": "{\r\n \"error\": {\r\n \"code\": \"ResourceGroupNotFound\",\r\n \"message\": \"Resource group 'NotExistedRG' could not be found.\"\r\n }\r\n}", + "ResponseHeaders": { + "Content-Length": [ + "104" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Fri, 09 Mar 2018 07:33:44 GMT" + ], + "Pragma": [ + "no-cache" + ], + "ETag": [ + "\"0a002ee3-0000-0000-0000-5aa238d80000\"" + ], + "Server": [ + "Microsoft-IIS/10.0" + ], + "x-ms-request-id": [ + "2263b931-e233-4217-bfba-448ee3ac8346" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-AspNet-Version": [ + "4.0.30319" + ], + "X-Powered-By": [ + "ASP.NET" + ], + "x-ms-ratelimit-remaining-subscription-writes": [ + "1196" + ], + "x-ms-correlation-request-id": [ + "977d2f5c-4af0-4c2e-8068-6de427d796c0" + ], + "x-ms-routing-request-id": [ + "WESTUS:20180309T073344Z:977d2f5c-4af0-4c2e-8068-6de427d796c0" + ], + "X-Content-Type-Options": [ + "nosniff" + ] + }, + "StatusCode": 404 + } + ], + "Names": { + "CreateResourceGroup": [ + "res7089" + ], + "HealthcareApisCreateAccountErrorTest": [ + "hca1234" + ] + }, + "Variables": { + "SubscriptionId": "cc148bf2-42fb-4913-a3fb-2f284a69eb89" + } +} diff --git a/src/SDKs/HealthcareApis/HealthcareApis.Tests/SessionRecords/HealthcareApisTests/HealthcareApisCreateTest.json b/src/SDKs/HealthcareApis/HealthcareApis.Tests/SessionRecords/HealthcareApisTests/HealthcareApisCreateTest.json new file mode 100644 index 0000000000000..24cad4e610769 --- /dev/null +++ b/src/SDKs/HealthcareApis/HealthcareApis.Tests/SessionRecords/HealthcareApisTests/HealthcareApisCreateTest.json @@ -0,0 +1,155 @@ +{ + "Entries": [ + { + "RequestUri": "/subscriptions/cc148bf2-42fb-4913-a3fb-2f284a69eb89/resourcegroups/res7089?api-version=2017-05-10", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvYzI0Mzc0NWQtNTBiYi00OGQxLTllNjItM2Y3MmVmYjMxNjZjL3Jlc291cmNlZ3JvdXBzL3JlczcwODk/YXBpLXZlcnNpb249MjAxNy0wNS0xMA==", + "RequestMethod": "PUT", + "RequestBody": "{\r\n \"location\": \"westus\"\r\n}", + "RequestHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Content-Length": [ + "28" + ], + "x-ms-client-request-id": [ + "89e61421-87a0-4d25-b6a1-946a8f9df00b" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.25211.01", + "Microsoft.Azure.Management.ResourceManager.ResourceManagementClient/1.6.0.0" + ] + }, + "ResponseBody": "{\r\n \"id\": \"/subscriptions/cc148bf2-42fb-4913-a3fb-2f284a69eb89/resourceGroups/res7089\",\r\n \"name\": \"account1234\",\r\n \"location\": \"westus\",\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\"\r\n }\r\n}", + "ResponseHeaders": { + "Content-Length": [ + "167" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Fri, 09 Mar 2018 08:09:16 GMT" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-ratelimit-remaining-subscription-writes": [ + "1181" + ], + "x-ms-request-id": [ + "d55f54ca-0ad2-4798-9741-a96462bd1cb8" + ], + "x-ms-correlation-request-id": [ + "9e622289-028e-44a3-bbcd-904ae16adbd3" + ], + "x-ms-routing-request-id": [ + "WESTUS:20190618T153235Z:d55f54ca-0ad2-4798-9741-a96462bd1cb8" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ] + }, + "StatusCode": 201 + }, + { + "RequestUri": "/subscriptions/cc148bf2-42fb-4913-a3fb-2f284a69eb89/resourceGroups/res7089/providers/Microsoft.HealthcareApis/services/hca1234?api-version=2018-08-20-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvY2MxNDhiZjItNDJmYi00OTEzLWEzZmItMmYyODRhNjllYjg5L3Jlc291cmNlR3JvdXBzL3JlczcwODkvcHJvdmlkZXJzL01pY3Jvc29mdC5IZWFsdGhjYXJlQXBpcy9zZXJ2aWNlcy9oY2ExMjM0P2FwaS12ZXJzaW9uPTIwMTgtMDgtMjAtcHJldmlldw==", + "RequestMethod": "PUT", + "RequestBody": "{\r\n \"sku\": {\r\n \"name\": \"S1\"\r\n },\r\n \"location\": \"westus\",\r\n \"properties\": {}\r\n}", + "RequestHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Content-Length": [ + "113" + ], + "x-ms-client-request-id": [ + "39bce3ac-f86e-490f-92d3-260643c3a770" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.25211.01", + "Microsoft.Azure.Management.HealthcareApis.HealthcareApisManagementClient/1.0.0.0" + ] + }, + "ResponseBody": "{\r\n \"id\": \"/subscriptions/cc148bf2-42fb-4913-a3fb-2f284a69eb89/resourceGroups/res7089/providers/Microsoft.HealthcareApis/accounts/hca1234\",\r\n \"name\": \"hca1234\",\r\n \"type\": \"Microsoft.HealthcareApis/accounts\",\r\n \"etag\": \"\\\"0a002ee3-0000-0000-0000-5aa238d80000\\\"\",\r\n \"location\": \"westus\",\r\n \"sku\": {\r\n \"name\": \"S1\"\r\n },\r\n \"kind\": \"Fhir\",\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\"\r\n }\r\n}", + "ResponseHeaders": { + "Content-Length": [ + "570" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Fri, 09 Mar 2018 07:33:44 GMT" + ], + "Pragma": [ + "no-cache" + ], + "ETag": [ + "\"0a002ee3-0000-0000-0000-5aa238d80000\"" + ], + "Server": [ + "Microsoft-IIS/10.0" + ], + "x-ms-request-id": [ + "2263b931-e233-4217-bfba-448ee3ac8346" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-AspNet-Version": [ + "4.0.30319" + ], + "X-Powered-By": [ + "ASP.NET" + ], + "x-ms-ratelimit-remaining-subscription-writes": [ + "1196" + ], + "x-ms-correlation-request-id": [ + "977d2f5c-4af0-4c2e-8068-6de427d796c0" + ], + "x-ms-routing-request-id": [ + "WESTUS:20180309T073344Z:977d2f5c-4af0-4c2e-8068-6de427d796c0" + ], + "X-Content-Type-Options": [ + "nosniff" + ] + }, + "StatusCode": 201 + } + ], + "Names": { + "CreateResourceGroup": [ + "res7089" + ], + "HealthcareApisCreateTest": [ + "hca1234" + ] + }, + "Variables": { + "SubscriptionId": "cc148bf2-42fb-4913-a3fb-2f284a69eb89" + } +} diff --git a/src/SDKs/HealthcareApis/HealthcareApis.Tests/SessionRecords/HealthcareApisTests/HealthcareApisCreateWithParametersTest.json b/src/SDKs/HealthcareApis/HealthcareApis.Tests/SessionRecords/HealthcareApisTests/HealthcareApisCreateWithParametersTest.json new file mode 100644 index 0000000000000..e3e43d3672c2d --- /dev/null +++ b/src/SDKs/HealthcareApis/HealthcareApis.Tests/SessionRecords/HealthcareApisTests/HealthcareApisCreateWithParametersTest.json @@ -0,0 +1,155 @@ +{ + "Entries": [ + { + "RequestUri": "/subscriptions/cc148bf2-42fb-4913-a3fb-2f284a69eb89/resourcegroups/res7089?api-version=2017-05-10", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvYzI0Mzc0NWQtNTBiYi00OGQxLTllNjItM2Y3MmVmYjMxNjZjL3Jlc291cmNlZ3JvdXBzL3JlczcwODk/YXBpLXZlcnNpb249MjAxNy0wNS0xMA==", + "RequestMethod": "PUT", + "RequestBody": "{\r\n \"location\": \"westus\"\r\n}", + "RequestHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Content-Length": [ + "28" + ], + "x-ms-client-request-id": [ + "89e61421-87a0-4d25-b6a1-946a8f9df00b" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.25211.01", + "Microsoft.Azure.Management.ResourceManager.ResourceManagementClient/1.6.0.0" + ] + }, + "ResponseBody": "{\r\n \"id\": \"/subscriptions/cc148bf2-42fb-4913-a3fb-2f284a69eb89/resourceGroups/res7089\",\r\n \"name\": \"hca1234\",\r\n \"location\": \"westus\",\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\"\r\n }\r\n}", + "ResponseHeaders": { + "Content-Length": [ + "167" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Fri, 09 Mar 2018 08:09:16 GMT" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-ratelimit-remaining-subscription-writes": [ + "1181" + ], + "x-ms-request-id": [ + "d55f54ca-0ad2-4798-9741-a96462bd1cb8" + ], + "x-ms-correlation-request-id": [ + "9e622289-028e-44a3-bbcd-904ae16adbd3" + ], + "x-ms-routing-request-id": [ + "WESTUS:20190618T153235Z:d55f54ca-0ad2-4798-9741-a96462bd1cb8" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ] + }, + "StatusCode": 201 + }, + { + "RequestUri": "/subscriptions/cc148bf2-42fb-4913-a3fb-2f284a69eb89/resourceGroups/res7089/providers/Microsoft.HealthcareApis/services/hca1234?api-version=2018-08-20-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvY2MxNDhiZjItNDJmYi00OTEzLWEzZmItMmYyODRhNjllYjg5L3Jlc291cmNlR3JvdXBzL3JlczcwODkvcHJvdmlkZXJzL01pY3Jvc29mdC5IZWFsdGhjYXJlQXBpcy9zZXJ2aWNlcy9oY2ExMjM0P2FwaS12ZXJzaW9uPTIwMTgtMDgtMjAtcHJldmlldw==", + "RequestMethod": "PUT", + "RequestBody": "{ \"sku\":{ \"name\": \"S1\" },\"location\":\"westus\", \"properties\": { \"authenticationConfiguration\": { \"authority\": \"https://login.microsoftonline.com/common\",\"audience\": \"https://azurehealthcareapis.com\",\"smartProxyEnabled\": \"false\" },\"cosmosDbConfiguration\": {\"offerThroughput\": \"400\"},\"accessPolicies\": [ {\"objectId\": \"7df19f2f-6169-40f0-ac1e-9a9b4e65a898\"}]}}", + "RequestHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Content-Length": [ + "113" + ], + "x-ms-client-request-id": [ + "39bce3ac-f86e-490f-92d3-260643c3a770" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.25211.01", + "Microsoft.Azure.Management.HealthcareApis.HealthcareApisManagementClient/1.0.0.0" + ] + }, + "ResponseBody": "{\r\n \"id\": \"/subscriptions/cc148bf2-42fb-4913-a3fb-2f284a69eb89/resourceGroups/res7089/providers/Microsoft.HealthcareApis/accounts/hca1234\",\r\n \"name\": \"hca1234\",\r\n \"type\": \"Microsoft.HealthcareApis/accounts\",\r\n \"etag\": \"\\\"0a002ee3-0000-0000-0000-5aa238d80000\\\"\",\r\n \"location\": \"westus\",\r\n \"sku\": {\r\n \"name\": \"S1\"\r\n },\r\n \"kind\": \"Fhir\",\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\"\r\n , \"authenticationConfiguration\": { \"authority\": \"https://login.microsoftonline.com/common\",\"audience\": \"https://azurehealthcareapis.com\",\"smartProxyEnabled\": \"false\" },\"cosmosDbConfiguration\": {\"offerThroughput\": \"400\"},\"accessPolicies\": [ {\"objectId\": \"7df19f2f-6169-40f0-ac1e-9a9b4e65a898\"}]}}\r\n", + "ResponseHeaders": { + "Content-Length": [ + "570" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Fri, 09 Mar 2018 07:33:44 GMT" + ], + "Pragma": [ + "no-cache" + ], + "ETag": [ + "\"0a002ee3-0000-0000-0000-5aa238d80000\"" + ], + "Server": [ + "Microsoft-IIS/10.0" + ], + "x-ms-request-id": [ + "2263b931-e233-4217-bfba-448ee3ac8346" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-AspNet-Version": [ + "4.0.30319" + ], + "X-Powered-By": [ + "ASP.NET" + ], + "x-ms-ratelimit-remaining-subscription-writes": [ + "1196" + ], + "x-ms-correlation-request-id": [ + "977d2f5c-4af0-4c2e-8068-6de427d796c0" + ], + "x-ms-routing-request-id": [ + "WESTUS:20180309T073344Z:977d2f5c-4af0-4c2e-8068-6de427d796c0" + ], + "X-Content-Type-Options": [ + "nosniff" + ] + }, + "StatusCode": 201 + } + ], + "Names": { + "CreateResourceGroup": [ + "res7089" + ], + "HealthcareApisCreateWithParametersTest": [ + "hca1234" + ] + }, + "Variables": { + "SubscriptionId": "cc148bf2-42fb-4913-a3fb-2f284a69eb89" + } +} diff --git a/src/SDKs/HealthcareApis/HealthcareApis.Tests/SessionRecords/HealthcareApisTests/HealthcareApisDeleteAccountErrorTest.json b/src/SDKs/HealthcareApis/HealthcareApis.Tests/SessionRecords/HealthcareApisTests/HealthcareApisDeleteAccountErrorTest.json new file mode 100644 index 0000000000000..0a3ba6b454dff --- /dev/null +++ b/src/SDKs/HealthcareApis/HealthcareApis.Tests/SessionRecords/HealthcareApisTests/HealthcareApisDeleteAccountErrorTest.json @@ -0,0 +1,139 @@ +{ + "Entries": [ + { + "RequestUri": "/subscriptions/cc148bf2-42fb-4913-a3fb-2f284a69eb89/resourcegroups/res7089?api-version=2017-05-10", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvYzI0Mzc0NWQtNTBiYi00OGQxLTllNjItM2Y3MmVmYjMxNjZjL3Jlc291cmNlZ3JvdXBzL3JlczcwODk/YXBpLXZlcnNpb249MjAxNy0wNS0xMA==", + "RequestMethod": "PUT", + "RequestBody": "{\r\n \"location\": \"westus\"\r\n}", + "RequestHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Content-Length": [ + "28" + ], + "x-ms-client-request-id": [ + "89e61421-87a0-4d25-b6a1-946a8f9df00b" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.25211.01", + "Microsoft.Azure.Management.ResourceManager.ResourceManagementClient/1.6.0.0" + ] + }, + "ResponseBody": "{\r\n \"id\": \"/subscriptions/cc148bf2-42fb-4913-a3fb-2f284a69eb89/resourceGroups/res7089\",\r\n \"name\": \"hca1234\",\r\n \"location\": \"westus\",\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\"\r\n }\r\n}", + "ResponseHeaders": { + "Content-Length": [ + "167" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Fri, 09 Mar 2018 08:09:16 GMT" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-ratelimit-remaining-subscription-writes": [ + "1181" + ], + "x-ms-request-id": [ + "d55f54ca-0ad2-4798-9741-a96462bd1cb8" + ], + "x-ms-correlation-request-id": [ + "9e622289-028e-44a3-bbcd-904ae16adbd3" + ], + "x-ms-routing-request-id": [ + "WESTUS:20190618T153235Z:d55f54ca-0ad2-4798-9741-a96462bd1cb8" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ] + }, + "StatusCode": 201 + }, + { + "RequestUri": "/subscriptions/cc148bf2-42fb-4913-a3fb-2f284a69eb89/resourceGroups/NotExistedRG/providers/Microsoft.HealthcareApis/services/nonExistedAccountName?api-version=2018-08-20-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvY2MxNDhiZjItNDJmYi00OTEzLWEzZmItMmYyODRhNjllYjg5L3Jlc291cmNlR3JvdXBzL05vdEV4aXN0ZWRSRy9wcm92aWRlcnMvTWljcm9zb2Z0LkhlYWx0aGNhcmVBcGlzL3NlcnZpY2VzL25vbkV4aXN0ZWRBY2NvdW50TmFtZT9hcGktdmVyc2lvbj0yMDE4LTA4LTIwLXByZXZpZXc=", + "RequestMethod": "DELETE", + "RequestBody": "", + "RequestHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Content-Length": [ + "28" + ], + "x-ms-client-request-id": [ + "ccfc3a51-0fa5-4fbf-be57-638efc84c3e2" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.25211.01", + "Microsoft.Azure.Management.HealthcareApis.HealthcareApisManagementClient/1.0.0.0" + ] + }, + "ResponseBody": "{\r\n \"error\": {\r\n \"code\": \"ResourceGroupNotFound\",\r\n \"message\": \"Resource group 'NotExistedRG' could not be found.\"\r\n }\r\n}", + "ResponseHeaders": { + "Content-Length": [ + "104" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Fri, 26 May 2017 11:20:00 GMT" + ], + "Pragma": [ + "no-cache" + ], + "Server": [ + "Microsoft-IIS/8.5" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-AspNet-Version": [ + "4.0.30319" + ], + "X-Powered-By": [ + "ASP.NET" + ], + "x-ms-ratelimit-remaining-subscription-writes": [ + "1194" + ], + "x-ms-request-id": [ + "7824fc5b-dcea-46b4-91b8-2992ec8a8bf6" + ], + "x-ms-correlation-request-id": [ + "7824fc5b-dcea-46b4-91b8-2992ec8a8bf6" + ], + "x-ms-routing-request-id": [ + "WESTUS:20170526T112000Z:7824fc5b-dcea-46b4-91b8-2992ec8a8bf6" + ] + }, + "StatusCode": 404 + } + ], + "Names": {}, + "Variables": { + "SubscriptionId": "cc148bf2-42fb-4913-a3fb-2f284a69eb89" + } +} diff --git a/src/SDKs/HealthcareApis/HealthcareApis.Tests/SessionRecords/HealthcareApisTests/HealthcareApisDeleteTest.json b/src/SDKs/HealthcareApis/HealthcareApis.Tests/SessionRecords/HealthcareApisTests/HealthcareApisDeleteTest.json new file mode 100644 index 0000000000000..6f8d9b5b5c30a --- /dev/null +++ b/src/SDKs/HealthcareApis/HealthcareApis.Tests/SessionRecords/HealthcareApisTests/HealthcareApisDeleteTest.json @@ -0,0 +1,277 @@ +{ + "Entries": [ + { + "RequestUri": "/subscriptions/cc148bf2-42fb-4913-a3fb-2f284a69eb89/resourcegroups/res7089?api-version=2017-05-10", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvYzI0Mzc0NWQtNTBiYi00OGQxLTllNjItM2Y3MmVmYjMxNjZjL3Jlc291cmNlZ3JvdXBzL3JlczcwODk/YXBpLXZlcnNpb249MjAxNy0wNS0xMA==", + "RequestMethod": "PUT", + "RequestBody": "{\r\n \"location\": \"westus\"\r\n}", + "RequestHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Content-Length": [ + "28" + ], + "x-ms-client-request-id": [ + "89e61421-87a0-4d25-b6a1-946a8f9df00b" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.25211.01", + "Microsoft.Azure.Management.ResourceManager.ResourceManagementClient/1.6.0.0" + ] + }, + "ResponseBody": "{\r\n \"id\": \"/subscriptions/cc148bf2-42fb-4913-a3fb-2f284a69eb89/resourceGroups/res7089\",\r\n \"name\": \"account1235\",\r\n \"location\": \"westus\",\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\"\r\n }\r\n}", + "ResponseHeaders": { + "Content-Length": [ + "167" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Fri, 09 Mar 2018 08:09:16 GMT" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-ratelimit-remaining-subscription-writes": [ + "1181" + ], + "x-ms-request-id": [ + "d55f54ca-0ad2-4798-9741-a96462bd1cb8" + ], + "x-ms-correlation-request-id": [ + "9e622289-028e-44a3-bbcd-904ae16adbd3" + ], + "x-ms-routing-request-id": [ + "WESTUS:20190618T153235Z:d55f54ca-0ad2-4798-9741-a96462bd1cb8" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ] + }, + "StatusCode": 201 + }, + { + "RequestUri": "/subscriptions/cc148bf2-42fb-4913-a3fb-2f284a69eb89/resourceGroups/res7089/providers/Microsoft.HealthcareApis/services/hca1234?api-version=2018-08-20-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvY2MxNDhiZjItNDJmYi00OTEzLWEzZmItMmYyODRhNjllYjg5L3Jlc291cmNlR3JvdXBzL3JlczcwODkvcHJvdmlkZXJzL01pY3Jvc29mdC5IZWFsdGhjYXJlQXBpcy9zZXJ2aWNlcy9oY2ExMjM0P2FwaS12ZXJzaW9uPTIwMTgtMDgtMjAtcHJldmlldw==", + "RequestMethod": "PUT", + "RequestBody": "{\r\n \"sku\": {\r\n \"name\": \"S1\"\r\n },\r\n \"location\": \"westus\",\r\n \"properties\": {}\r\n}", + "RequestHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Content-Length": [ + "113" + ], + "x-ms-client-request-id": [ + "39bce3ac-f86e-490f-92d3-260643c3a770" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.25211.01", + "Microsoft.Azure.Management.HealthcareApis.HealthcareApisManagementClient/1.0.0.0" + ] + }, + "ResponseBody": "{\r\n \"id\": \"/subscriptions/cc148bf2-42fb-4913-a3fb-2f284a69eb89/resourceGroups/res7089/providers/Microsoft.HealthcareApis/accounts/hca1234\",\r\n \"name\": \"hca1234\",\r\n \"type\": \"Microsoft.HealthcareApis/accounts\",\r\n \"etag\": \"\\\"0a002ee3-0000-0000-0000-5aa238d80000\\\"\",\r\n \"location\": \"westus\",\r\n \"sku\": {\r\n \"name\": \"S1\"\r\n },\r\n \"kind\": \"Fhir\",\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\"\r\n }\r\n}", + "ResponseHeaders": { + "Content-Length": [ + "570" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Fri, 09 Mar 2018 07:33:44 GMT" + ], + "Pragma": [ + "no-cache" + ], + "ETag": [ + "\"0a002ee3-0000-0000-0000-5aa238d80000\"" + ], + "Server": [ + "Microsoft-IIS/10.0" + ], + "x-ms-request-id": [ + "2263b931-e233-4217-bfba-448ee3ac8346" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-AspNet-Version": [ + "4.0.30319" + ], + "X-Powered-By": [ + "ASP.NET" + ], + "x-ms-ratelimit-remaining-subscription-writes": [ + "1196" + ], + "x-ms-correlation-request-id": [ + "977d2f5c-4af0-4c2e-8068-6de427d796c0" + ], + "x-ms-routing-request-id": [ + "WESTUS:20180309T073344Z:977d2f5c-4af0-4c2e-8068-6de427d796c0" + ], + "X-Content-Type-Options": [ + "nosniff" + ] + }, + "StatusCode": 201 + }, + { + "RequestUri": "/subscriptions/cc148bf2-42fb-4913-a3fb-2f284a69eb89/resourceGroups/res7089/providers/Microsoft.HealthcareApis/services/hca1234?api-version=2018-08-20-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvY2MxNDhiZjItNDJmYi00OTEzLWEzZmItMmYyODRhNjllYjg5L3Jlc291cmNlR3JvdXBzL3JlczcwODkvcHJvdmlkZXJzL01pY3Jvc29mdC5IZWFsdGhjYXJlQXBpcy9zZXJ2aWNlcy9oY2ExMjM0P2FwaS12ZXJzaW9uPTIwMTgtMDgtMjAtcHJldmlldw==", + "RequestMethod": "DELETE", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "ccfc3a51-0fa5-4fbf-be57-638efc84c3e2" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.25211.01", + "Microsoft.Azure.Management.HealthcareApis.HealthcareApisManagementClient/1.0.0.0" + ] + }, + "ResponseBody": "", + "ResponseHeaders": { + "Content-Length": [ + "0" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Fri, 26 May 2017 11:20:00 GMT" + ], + "Pragma": [ + "no-cache" + ], + "Server": [ + "Microsoft-IIS/8.5" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-AspNet-Version": [ + "4.0.30319" + ], + "X-Powered-By": [ + "ASP.NET" + ], + "x-ms-ratelimit-remaining-subscription-writes": [ + "1194" + ], + "x-ms-request-id": [ + "7824fc5b-dcea-46b4-91b8-2992ec8a8bf6" + ], + "x-ms-correlation-request-id": [ + "7824fc5b-dcea-46b4-91b8-2992ec8a8bf6" + ], + "x-ms-routing-request-id": [ + "WESTUS:20170526T112000Z:7824fc5b-dcea-46b4-91b8-2992ec8a8bf6" + ] + }, + "StatusCode": 204 + }, + { + "RequestUri": "/subscriptions/cc148bf2-42fb-4913-a3fb-2f284a69eb89/resourceGroups/res7089/providers/Microsoft.HealthcareApis/services/missingaccount?api-version=2018-08-20-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvY2MxNDhiZjItNDJmYi00OTEzLWEzZmItMmYyODRhNjllYjg5L3Jlc291cmNlR3JvdXBzL3JlczcwODkvcHJvdmlkZXJzL01pY3Jvc29mdC5IZWFsdGhjYXJlQXBpcy9zZXJ2aWNlcy9taXNzaW5nYWNjb3VudD9hcGktdmVyc2lvbj0yMDE4LTA4LTIwLXByZXZpZXc=", + "RequestMethod": "DELETE", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "ccfc3a51-0fa5-4fbf-be57-638efc84c3e2" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.25211.01", + "Microsoft.Azure.Management.HealthcareApis.HealthcareApisManagementClient/1.0.0.0" + ] + }, + "ResponseBody": "", + "ResponseHeaders": { + "Content-Length": [ + "0" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Fri, 26 May 2017 11:20:00 GMT" + ], + "Pragma": [ + "no-cache" + ], + "Server": [ + "Microsoft-IIS/8.5" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-AspNet-Version": [ + "4.0.30319" + ], + "X-Powered-By": [ + "ASP.NET" + ], + "x-ms-ratelimit-remaining-subscription-writes": [ + "1194" + ], + "x-ms-request-id": [ + "7824fc5b-dcea-46b4-91b8-2992ec8a8bf6" + ], + "x-ms-correlation-request-id": [ + "7824fc5b-dcea-46b4-91b8-2992ec8a8bf6" + ], + "x-ms-routing-request-id": [ + "WESTUS:20170526T112000Z:7824fc5b-dcea-46b4-91b8-2992ec8a8bf6" + ] + }, + "StatusCode": 204 + } + ], + "Names": { + "CreateResourceGroup": [ + "res7089" + ], + "HealthcareApisDeleteTest": [ + "hca1234" + ] + }, + "Variables": { + "SubscriptionId": "cc148bf2-42fb-4913-a3fb-2f284a69eb89" + } +} diff --git a/src/SDKs/HealthcareApis/HealthcareApis.Tests/SessionRecords/HealthcareApisTests/HealthcareApisGetAccountTest.json b/src/SDKs/HealthcareApis/HealthcareApis.Tests/SessionRecords/HealthcareApisTests/HealthcareApisGetAccountTest.json new file mode 100644 index 0000000000000..3785e6e8fa23e --- /dev/null +++ b/src/SDKs/HealthcareApis/HealthcareApis.Tests/SessionRecords/HealthcareApisTests/HealthcareApisGetAccountTest.json @@ -0,0 +1,228 @@ +{ + "Entries": [ + { + "RequestUri": "/subscriptions/cc148bf2-42fb-4913-a3fb-2f284a69eb89/resourcegroups/res7089?api-version=2017-05-10", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvYzI0Mzc0NWQtNTBiYi00OGQxLTllNjItM2Y3MmVmYjMxNjZjL3Jlc291cmNlZ3JvdXBzL3JlczcwODk/YXBpLXZlcnNpb249MjAxNy0wNS0xMA==", + "RequestMethod": "PUT", + "RequestBody": "{\r\n \"location\": \"westus\"\r\n}", + "RequestHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Content-Length": [ + "28" + ], + "x-ms-client-request-id": [ + "89e61421-87a0-4d25-b6a1-946a8f9df00b" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.25211.01", + "Microsoft.Azure.Management.ResourceManager.ResourceManagementClient/1.6.0.0" + ] + }, + "ResponseBody": "{\r\n \"id\": \"/subscriptions/cc148bf2-42fb-4913-a3fb-2f284a69eb89/resourceGroups/res7089\",\r\n \"name\": \"hca1234\",\r\n \"location\": \"westus\",\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\"\r\n }\r\n}", + "ResponseHeaders": { + "Content-Length": [ + "167" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Fri, 09 Mar 2018 08:09:16 GMT" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-ratelimit-remaining-subscription-writes": [ + "1181" + ], + "x-ms-request-id": [ + "d55f54ca-0ad2-4798-9741-a96462bd1cb8" + ], + "x-ms-correlation-request-id": [ + "9e622289-028e-44a3-bbcd-904ae16adbd3" + ], + "x-ms-routing-request-id": [ + "WESTUS:20190618T153235Z:d55f54ca-0ad2-4798-9741-a96462bd1cb8" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ] + }, + "StatusCode": 201 + }, + { + "RequestUri": "/subscriptions/cc148bf2-42fb-4913-a3fb-2f284a69eb89/resourceGroups/res7089/providers/Microsoft.HealthcareApis/services/hca1234?api-version=2018-08-20-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvY2MxNDhiZjItNDJmYi00OTEzLWEzZmItMmYyODRhNjllYjg5L3Jlc291cmNlR3JvdXBzL3JlczcwODkvcHJvdmlkZXJzL01pY3Jvc29mdC5IZWFsdGhjYXJlQXBpcy9zZXJ2aWNlcy9oY2ExMjM0P2FwaS12ZXJzaW9uPTIwMTgtMDgtMjAtcHJldmlldw==", + "RequestMethod": "PUT", + "RequestBody": "{\r\n \"sku\": {\r\n \"name\": \"S1\"\r\n },\r\n \"location\": \"westus\",\r\n \"properties\": {}\r\n}", + "RequestHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Content-Length": [ + "113" + ], + "x-ms-client-request-id": [ + "39bce3ac-f86e-490f-92d3-260643c3a770" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.25211.01", + "Microsoft.Azure.Management.HealthcareApis.HealthcareApisManagementClient/1.0.0.0" + ] + }, + "ResponseBody": "{\r\n \"id\": \"/subscriptions/cc148bf2-42fb-4913-a3fb-2f284a69eb89/resourceGroups/res7089/providers/Microsoft.HealthcareApis/accounts/hca1234\",\r\n \"name\": \"hca1234\",\r\n \"type\": \"Microsoft.HealthcareApis/accounts\",\r\n \"etag\": \"\\\"0a002ee3-0000-0000-0000-5aa238d80000\\\"\",\r\n \"location\": \"westus\",\r\n \"sku\": {\r\n \"name\": \"S1\"\r\n },\r\n \"kind\": \"Fhir\",\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\"\r\n }\r\n}", + "ResponseHeaders": { + "Content-Length": [ + "570" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Fri, 09 Mar 2018 07:33:44 GMT" + ], + "Pragma": [ + "no-cache" + ], + "ETag": [ + "\"0a002ee3-0000-0000-0000-5aa238d80000\"" + ], + "Server": [ + "Microsoft-IIS/10.0" + ], + "x-ms-request-id": [ + "2263b931-e233-4217-bfba-448ee3ac8346" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-AspNet-Version": [ + "4.0.30319" + ], + "X-Powered-By": [ + "ASP.NET" + ], + "x-ms-ratelimit-remaining-subscription-writes": [ + "1196" + ], + "x-ms-correlation-request-id": [ + "977d2f5c-4af0-4c2e-8068-6de427d796c0" + ], + "x-ms-routing-request-id": [ + "WESTUS:20180309T073344Z:977d2f5c-4af0-4c2e-8068-6de427d796c0" + ], + "X-Content-Type-Options": [ + "nosniff" + ] + }, + "StatusCode": 201 + }, + { + "RequestUri": "/subscriptions/cc148bf2-42fb-4913-a3fb-2f284a69eb89/resourceGroups/res7089/providers/Microsoft.HealthcareApis/services/hca1234?api-version=2018-08-20-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvY2MxNDhiZjItNDJmYi00OTEzLWEzZmItMmYyODRhNjllYjg5L3Jlc291cmNlR3JvdXBzL3JlczcwODkvcHJvdmlkZXJzL01pY3Jvc29mdC5IZWFsdGhjYXJlQXBpcy9zZXJ2aWNlcy9oY2ExMjM0P2FwaS12ZXJzaW9uPTIwMTgtMDgtMjAtcHJldmlldw==", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "65c39c9c-dcfd-47d3-a5ea-a98bfd4989bb" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.25211.01", + "Microsoft.Azure.Management.HealthcareApis.HealthcareApisManagementClient/3.0.0.0" + ] + }, + "ResponseBody": "{\r\n \"id\": \"/subscriptions/cc148bf2-42fb-4913-a3fb-2f284a69eb89/resourceGroups/res7089/providers/Microsoft.HealthcareApis/services/hca1234\",\r\n \"name\": \"hca1234\",\r\n \"type\": \"Microsoft.HealthcareApis/accounts\",\r\n \"location\": \"westus\",\r\n \"sku\": {\r\n \"name\": \"S1\"\r\n },\r\n \"kind\": \"Fhir\",\r\n \"tags\": {\r\n \"key3\": \"value3\",\r\n \"key4\": \"value4\",\r\n \"key5\": \"value5\"\r\n },\"properties\": {\"provisioningState\": \"Succeeded\"}}", + "ResponseHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Fri, 09 Mar 2018 07:49:29 GMT" + ], + "Pragma": [ + "no-cache" + ], + "Transfer-Encoding": [ + "chunked" + ], + "ETag": [ + "\"0a00bcf7-0000-0000-0000-5aa23c880000\"" + ], + "Server": [ + "Microsoft-IIS/10.0" + ], + "Vary": [ + "Accept-Encoding" + ], + "x-ms-request-id": [ + "4697a59a-84eb-4e5c-967e-085b2a555af8" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-AspNet-Version": [ + "4.0.30319" + ], + "X-Powered-By": [ + "ASP.NET" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14953" + ], + "x-ms-correlation-request-id": [ + "122819a6-98f9-4c61-b68c-c06a134c084f" + ], + "x-ms-routing-request-id": [ + "JAPANWEST:20180309T074930Z:122819a6-98f9-4c61-b68c-c06a134c084f" + ], + "X-Content-Type-Options": [ + "nosniff" + ] + }, + "StatusCode": 200 + } + ], + "Names": { + "CreateResourceGroup": [ + "res7089" + ], + "HealthcareApisGetAccountTest": [ + "hca1234" + ] + }, + "Variables": { + "SubscriptionId": "cc148bf2-42fb-4913-a3fb-2f284a69eb89" + } +} diff --git a/src/SDKs/HealthcareApis/HealthcareApis.Tests/SessionRecords/HealthcareApisTests/HealthcareApisListAccountsTest.json b/src/SDKs/HealthcareApis/HealthcareApis.Tests/SessionRecords/HealthcareApisTests/HealthcareApisListAccountsTest.json new file mode 100644 index 0000000000000..9f7699addbdfc --- /dev/null +++ b/src/SDKs/HealthcareApis/HealthcareApis.Tests/SessionRecords/HealthcareApisTests/HealthcareApisListAccountsTest.json @@ -0,0 +1,82 @@ +{ + "Entries": [ + { + "RequestUri": "/subscriptions/cc148bf2-42fb-4913-a3fb-2f284a69eb89/resourceGroups/res7089/providers/Microsoft.HealthcareApis/services?api-version=2018-08-20-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvY2MxNDhiZjItNDJmYi00OTEzLWEzZmItMmYyODRhNjllYjg5L3Jlc291cmNlR3JvdXBzL3JlczcwODkvcHJvdmlkZXJzL01pY3Jvc29mdC5IZWFsdGhjYXJlQXBpcy9zZXJ2aWNlcz9hcGktdmVyc2lvbj0yMDE4LTA4LTIwLXByZXZpZXc=", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "74fad5d2-1e3c-4e30-a0b3-fcf319969fe0" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.25009.03", + "Microsoft.Azure.Management.Billing.BillingManagementClient/1.2.0-preview" + ] + }, + "ResponseBody": "{\r\n \"id\": \"/subscriptions/cc148bf2-42fb-4913-a3fb-2f284a69eb89/resourceGroups/res7089\",\r\n \"name\": \"res7089\",\r\n \"location\": \"westus\",\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\"\r\n }\r\n}", + "ResponseHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Thu, 20 Apr 2017 22:30:15 GMT" + ], + "Pragma": [ + "no-cache" + ], + "Transfer-Encoding": [ + "chunked" + ], + "Server": [ + "Microsoft-IIS/8.5" + ], + "Vary": [ + "Accept-Encoding" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-AspNet-Version": [ + "4.0.30319" + ], + "X-Powered-By": [ + "ASP.NET" + ], + "x-ms-ratelimit-remaining-tenant-reads": [ + "14993" + ], + "x-ms-request-id": [ + "5f1230a7-ea50-4e3a-80da-9123164fa07c" + ], + "x-ms-correlation-request-id": [ + "5f1230a7-ea50-4e3a-80da-9123164fa07c" + ], + "x-ms-routing-request-id": [ + "CENTRALUS:20170420T223015Z:5f1230a7-ea50-4e3a-80da-9123164fa07c" + ] + }, + "StatusCode": 200 + } + ], + "Names": { + "CreateResourceGroup": [ + "res7089" + ], + "HealthcareApisCreateTest": [ + "hca1234" + ] + }, + "Variables": { + "SubscriptionId": "cc148bf2-42fb-4913-a3fb-2f284a69eb89" + } +} \ No newline at end of file diff --git a/src/SDKs/HealthcareApis/HealthcareApis.Tests/Tests/HealthcareApisTests.cs b/src/SDKs/HealthcareApis/HealthcareApis.Tests/Tests/HealthcareApisTests.cs new file mode 100644 index 0000000000000..0c1dc839dc846 --- /dev/null +++ b/src/SDKs/HealthcareApis/HealthcareApis.Tests/Tests/HealthcareApisTests.cs @@ -0,0 +1,244 @@ +using HealthcareApis.Tests.Helpers; +using Microsoft.Azure.Management.HealthcareApis; +using Microsoft.Azure.Management.HealthcareApis.Models; +using Microsoft.Rest.ClientRuntime.Azure.TestFramework; +using System.Net; +using Xunit; + +namespace HealthcareApis.Tests +{ + public class HealthcareApisTests + { + + [Fact] + public void HealthcareApisCreateTest() + { + var handler = new RecordedDelegatingHandler { StatusCodeToReturn = HttpStatusCode.OK }; + + using (MockContext context = MockContext.Start(this.GetType().Name)) + { + var resourcesClient = HealthcareApisManagementTestUtilities.GetResourceManagementClient(context, handler); + var healthCareApisMgmtClient = HealthcareApisManagementTestUtilities.GetHealthcareApisManagementClient(context, handler); + + // Create resource group + var rgname = HealthcareApisManagementTestUtilities.CreateResourceGroup(resourcesClient); + + //generate account name + string accountName = TestUtilities.GenerateName("hca"); + + var serviceDescription = HealthcareApisManagementTestUtilities.GetServiceDescription(); + + //// Create healthcare apis account + var account = healthCareApisMgmtClient.Services.CreateOrUpdate(rgname, accountName, serviceDescription); + HealthcareApisManagementTestUtilities.VerifyAccountProperties(account, true); + } + } + + [Fact] + public void HealthcareApisCreateWithParametersTest() + { + var handler = new RecordedDelegatingHandler { StatusCodeToReturn = HttpStatusCode.OK }; + + using (MockContext context = MockContext.Start(this.GetType().Name)) + { + var resourcesClient = HealthcareApisManagementTestUtilities.GetResourceManagementClient(context, handler); + var healthCareApisMgmtClient = HealthcareApisManagementTestUtilities.GetHealthcareApisManagementClient(context, handler); + + // Create resource group + var rgname = HealthcareApisManagementTestUtilities.CreateResourceGroup(resourcesClient); + + //generate account name + string accountName = TestUtilities.GenerateName("hca"); + + var serviceDescription = HealthcareApisManagementTestUtilities.GetServiceDescription(); + + //// Create cognitive services account + var account = healthCareApisMgmtClient.Services.CreateOrUpdate(rgname, accountName, serviceDescription); + HealthcareApisManagementTestUtilities.VerifyAccountProperties(account, false); + } + } + + [Fact] + public void HealthcareApisCreateAccountErrorTest() + { + var handler = new RecordedDelegatingHandler { StatusCodeToReturn = HttpStatusCode.OK }; + + using (MockContext context = MockContext.Start(this.GetType().Name)) + { + var resourcesClient = HealthcareApisManagementTestUtilities.GetResourceManagementClient(context, handler); + var healthCareApisMgmtClient = HealthcareApisManagementTestUtilities.GetHealthcareApisManagementClient(context, handler); + + // Create resource group + var rgname = HealthcareApisManagementTestUtilities.CreateResourceGroup(resourcesClient); + + //generate account name + string accountName = TestUtilities.GenerateName("hca"); + + var serviceDescription = HealthcareApisManagementTestUtilities.GetServiceDescription(); + + // try to create account in non-existent RG + HealthcareApisManagementTestUtilities.ValidateExpectedException(() => + healthCareApisMgmtClient.Services.CreateOrUpdate("NotExistedRG", accountName, serviceDescription), + HttpStatusCode.NotFound.ToString()); + } + } + + [Fact] + public void HealthcareApisAccountUpdateWithCreateTest() + { + var handler = new RecordedDelegatingHandler { StatusCodeToReturn = HttpStatusCode.OK }; + + using (MockContext context = MockContext.Start(this.GetType().Name)) + { + var resourcesClient = HealthcareApisManagementTestUtilities.GetResourceManagementClient(context, handler); + var healthCareApisMgmtClient = HealthcareApisManagementTestUtilities.GetHealthcareApisManagementClient(context, handler); + + // Create resource group + var rgname = HealthcareApisManagementTestUtilities.CreateResourceGroup(resourcesClient); + + //generate account name + string accountName = TestUtilities.GenerateName("hca"); + + var serviceDescription = HealthcareApisManagementTestUtilities.GetServiceDescription(); + + //// Create cognitive services account + var createdAccount = healthCareApisMgmtClient.Services.CreateOrUpdate(rgname, accountName, serviceDescription); + + var servicePatchDescription = HealthcareApisManagementTestUtilities.GetServicePatchDescription(); + + // Update SKU + var account = healthCareApisMgmtClient.Services.Update(rgname, accountName, servicePatchDescription); + Assert.True(account.Tags.Values.Contains("value3")); + Assert.True(account.Tags.Values.Contains("value4")); + Assert.False(account.Tags.Values.Contains("value1")); + Assert.False(account.Tags.Values.Contains("value2")); + + // Validate + var fetchedAccount = healthCareApisMgmtClient.Services.Get(rgname, accountName); + Assert.Equal(servicePatchDescription.Tags.Count, fetchedAccount.Tags.Count); + Assert.Collection(fetchedAccount.Tags, + (keyValue) => { Assert.Equal("key3", keyValue.Key); Assert.Equal("value3", keyValue.Value); }, + (keyValue) => { Assert.Equal("key4", keyValue.Key); Assert.Equal("value4", keyValue.Value); }, + (keyValue) => { Assert.Equal("key5", keyValue.Key); Assert.Equal("value5", keyValue.Value); } + ); + } + } + + [Fact] + public void HealthcareApisListAccountsTest() + { + var handler = new RecordedDelegatingHandler { StatusCodeToReturn = HttpStatusCode.OK }; + + using (MockContext context = MockContext.Start(this.GetType().Name)) + { + var resourcesClient = HealthcareApisManagementTestUtilities.GetResourceManagementClient(context, handler); + var healthCareApisMgmtClient = HealthcareApisManagementTestUtilities.GetHealthcareApisManagementClient(context, handler); + + // Create resource group + var rgname = HealthcareApisManagementTestUtilities.CreateResourceGroup(resourcesClient); + + var serviceAccountsLists = healthCareApisMgmtClient.Services.ListByResourceGroupWithHttpMessagesAsync(rgname); + Assert.NotNull(serviceAccountsLists); + } + } + + [Fact] + public void HealthcareApisGetAccountTest() + { + var handler = new RecordedDelegatingHandler { StatusCodeToReturn = HttpStatusCode.OK }; + + using (MockContext context = MockContext.Start(this.GetType().Name)) + { + var resourcesClient = HealthcareApisManagementTestUtilities.GetResourceManagementClient(context, handler); + var healthCareApisMgmtClient = HealthcareApisManagementTestUtilities.GetHealthcareApisManagementClient(context, handler); + + // Create resource group + var rgname = HealthcareApisManagementTestUtilities.CreateResourceGroup(resourcesClient); + + //generate account name + string accountName = TestUtilities.GenerateName("hca"); + + var serviceDescription = HealthcareApisManagementTestUtilities.GetServiceDescription(); + + // Create healthCareApisAccount + var createdAccount = healthCareApisMgmtClient.Services.CreateOrUpdate(rgname, accountName, serviceDescription); + + // Validate + var fetchedAccount = healthCareApisMgmtClient.Services.Get(rgname, accountName); + Assert.Equal(accountName, fetchedAccount.Name); + Assert.Equal("westus", fetchedAccount.Location); + } + } + + [Fact] + public void HealthcareApisDeleteTest() + { + var handler = new RecordedDelegatingHandler { StatusCodeToReturn = HttpStatusCode.OK }; + + using (MockContext context = MockContext.Start(this.GetType().Name)) + { + var resourcesClient = HealthcareApisManagementTestUtilities.GetResourceManagementClient(context, handler); + var healthCareApisMgmtClient = HealthcareApisManagementTestUtilities.GetHealthcareApisManagementClient(context, handler); + + // Create resource group + var rgname = HealthcareApisManagementTestUtilities.CreateResourceGroup(resourcesClient); + + //generate account name + string accountName = TestUtilities.GenerateName("hca"); + + var serviceDescription = HealthcareApisManagementTestUtilities.GetServiceDescription(); + + //// Create healthcareApis services account + var account = healthCareApisMgmtClient.Services.CreateOrUpdate(rgname, accountName, serviceDescription); + + // Delete an account + healthCareApisMgmtClient.Services.Delete(rgname, accountName); + + // Delete an account which does not exist + healthCareApisMgmtClient.Services.Delete(rgname, "missingaccount"); + } + } + + + [Fact] + public void HealthcareApisDeleteAccountErrorTest() + { + var handler = new RecordedDelegatingHandler { StatusCodeToReturn = HttpStatusCode.OK }; + + using (MockContext context = MockContext.Start(this.GetType().Name)) + { + var resourcesClient = HealthcareApisManagementTestUtilities.GetResourceManagementClient(context, handler); + var healthCareApisMgmtClient = HealthcareApisManagementTestUtilities.GetHealthcareApisManagementClient(context, handler); + + // Create resource group + var rgname = HealthcareApisManagementTestUtilities.CreateResourceGroup(resourcesClient); + + // try to delete non-existent account + HealthcareApisManagementTestUtilities.ValidateExpectedException( + () => healthCareApisMgmtClient.Services.Delete("NotExistedRG", "nonExistedAccountName"), + HttpStatusCode.NotFound.ToString()); + } + } + + + + [Fact] + public void HealthcareApisCheckNameAvailabilityTest() + { + var handler = new RecordedDelegatingHandler { StatusCodeToReturn = HttpStatusCode.OK }; + + using (MockContext context = MockContext.Start(this.GetType().Name)) + { + var resourcesClient = HealthcareApisManagementTestUtilities.GetResourceManagementClient(context, handler); + var healthCareApisMgmtClient = HealthcareApisManagementTestUtilities.GetHealthcareApisManagementClient(context, handler); + CheckNameAvailabilityParameters checkNameAvailabilityParameters = new CheckNameAvailabilityParameters + { + Name = "hca1234", + Type = "Microsoft.HealthcareApis/services" + }; + var servicesNameAvailabilityInfo = healthCareApisMgmtClient.Services.CheckNameAvailability(checkNameAvailabilityParameters); + Assert.True(servicesNameAvailabilityInfo.NameAvailable); + } + } + } +} diff --git a/src/SDKs/HealthcareApis/HealthcareApis.Tests/app.config b/src/SDKs/HealthcareApis/HealthcareApis.Tests/app.config new file mode 100644 index 0000000000000..dde2c3cc64e79 --- /dev/null +++ b/src/SDKs/HealthcareApis/HealthcareApis.Tests/app.config @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/src/SDKs/HealthcareApis/HealthcareApis.Tests/packages.config b/src/SDKs/HealthcareApis/HealthcareApis.Tests/packages.config new file mode 100644 index 0000000000000..c36c30acd33ef --- /dev/null +++ b/src/SDKs/HealthcareApis/HealthcareApis.Tests/packages.config @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/SDKs/HealthcareApis/HealthcareApis.sln b/src/SDKs/HealthcareApis/HealthcareApis.sln index 53eaa8d8e7951..b98debae937c7 100644 --- a/src/SDKs/HealthcareApis/HealthcareApis.sln +++ b/src/SDKs/HealthcareApis/HealthcareApis.sln @@ -3,9 +3,9 @@ Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio 15 VisualStudioVersion = 15.0.28307.438 MinimumVisualStudioVersion = 10.0.40219.1 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft.Azure.Management.HealthcareApis", "Management.HealthcareApis\Microsoft.Azure.Management.HealthcareApis.csproj", "{6F4E6681-FA47-4FFC-8E02-32212FDEDDC9}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Azure.Management.HealthcareApis", "Management.HealthcareApis\Microsoft.Azure.Management.HealthcareApis.csproj", "{6F4E6681-FA47-4FFC-8E02-32212FDEDDC9}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft.Azure.Management.HealthcareApis.Tests", "Management.HealthcareApis.Tests\Microsoft.Azure.Management.HealthcareApis.Tests.csproj", "{D395417C-1205-48E3-B4DD-0A17D591F656}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HealthcareApis.Tests", "HealthcareApis.Tests\HealthcareApis.Tests.csproj", "{060A808A-4DE1-4072-9DEF-9DC75A353C51}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -17,10 +17,10 @@ Global {6F4E6681-FA47-4FFC-8E02-32212FDEDDC9}.Debug|Any CPU.Build.0 = Debug|Any CPU {6F4E6681-FA47-4FFC-8E02-32212FDEDDC9}.Release|Any CPU.ActiveCfg = Release|Any CPU {6F4E6681-FA47-4FFC-8E02-32212FDEDDC9}.Release|Any CPU.Build.0 = Release|Any CPU - {D395417C-1205-48E3-B4DD-0A17D591F656}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {D395417C-1205-48E3-B4DD-0A17D591F656}.Debug|Any CPU.Build.0 = Debug|Any CPU - {D395417C-1205-48E3-B4DD-0A17D591F656}.Release|Any CPU.ActiveCfg = Release|Any CPU - {D395417C-1205-48E3-B4DD-0A17D591F656}.Release|Any CPU.Build.0 = Release|Any CPU + {060A808A-4DE1-4072-9DEF-9DC75A353C51}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {060A808A-4DE1-4072-9DEF-9DC75A353C51}.Debug|Any CPU.Build.0 = Debug|Any CPU + {060A808A-4DE1-4072-9DEF-9DC75A353C51}.Release|Any CPU.ActiveCfg = Release|Any CPU + {060A808A-4DE1-4072-9DEF-9DC75A353C51}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/src/SDKs/HealthcareApis/Management.HealthcareApis.Tests/Microsoft.Azure.Management.HealthcareApis.Tests.csproj b/src/SDKs/HealthcareApis/Management.HealthcareApis.Tests/Microsoft.Azure.Management.HealthcareApis.Tests.csproj deleted file mode 100644 index d38f8fc29f873..0000000000000 --- a/src/SDKs/HealthcareApis/Management.HealthcareApis.Tests/Microsoft.Azure.Management.HealthcareApis.Tests.csproj +++ /dev/null @@ -1,15 +0,0 @@ - - - - Microsoft.Azure.Management.HealthcareApis.Tests - HealthcareApis.Tests Class Library - Microsoft.Azure.Management.HealthcareApis.Tests - 1.0.0 - true - {D395417C-1205-48E3-B4DD-0A17D591F656} - - - - - - \ No newline at end of file diff --git a/src/SDKs/HealthcareApis/Management.HealthcareApis/Generated/HealthcareApisManagementClient.cs b/src/SDKs/HealthcareApis/Management.HealthcareApis/Generated/HealthcareApisManagementClient.cs index 4c77b6d36362c..e66ca801eb685 100644 --- a/src/SDKs/HealthcareApis/Management.HealthcareApis/Generated/HealthcareApisManagementClient.cs +++ b/src/SDKs/HealthcareApis/Management.HealthcareApis/Generated/HealthcareApisManagementClient.cs @@ -45,7 +45,7 @@ public partial class HealthcareApisManagementClient : ServiceClient /// The subscription identifier. /// - public System.Guid SubscriptionId { get; set; } + public string SubscriptionId { get; set; } /// /// The version of the API. diff --git a/src/SDKs/HealthcareApis/Management.HealthcareApis/Generated/IHealthcareApisManagementClient.cs b/src/SDKs/HealthcareApis/Management.HealthcareApis/Generated/IHealthcareApisManagementClient.cs index fef00e4777543..96c1836d922cd 100644 --- a/src/SDKs/HealthcareApis/Management.HealthcareApis/Generated/IHealthcareApisManagementClient.cs +++ b/src/SDKs/HealthcareApis/Management.HealthcareApis/Generated/IHealthcareApisManagementClient.cs @@ -39,7 +39,7 @@ public partial interface IHealthcareApisManagementClient : System.IDisposable /// /// The subscription identifier. /// - System.Guid SubscriptionId { get; set; } + string SubscriptionId { get; set; } /// /// The version of the API. diff --git a/src/SDKs/HealthcareApis/Management.HealthcareApis/Microsoft.Azure.Management.HealthcareApis.csproj b/src/SDKs/HealthcareApis/Management.HealthcareApis/Microsoft.Azure.Management.HealthcareApis.csproj index cf6626a3721ad..ee98225a4203e 100644 --- a/src/SDKs/HealthcareApis/Management.HealthcareApis/Microsoft.Azure.Management.HealthcareApis.csproj +++ b/src/SDKs/HealthcareApis/Management.HealthcareApis/Microsoft.Azure.Management.HealthcareApis.csproj @@ -20,6 +20,14 @@ - + + + + + + all + runtime; build; native; contentfiles; analyzers + + diff --git a/src/SDKs/HealthcareApis/Management.HealthcareApis/Properties/AssemblyInfo.cs b/src/SDKs/HealthcareApis/Management.HealthcareApis/Properties/AssemblyInfo.cs deleted file mode 100644 index ce20d37ebc755..0000000000000 --- a/src/SDKs/HealthcareApis/Management.HealthcareApis/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,18 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. - -using System.Reflection; -using System.Resources; -using System.Runtime.InteropServices; - -[assembly: AssemblyTitle("Microsoft Azure Healthcare APIs Management Library")] -[assembly: AssemblyDescription("Provides management functionality for Microsoft Azure Healthcare APIs Resources.")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("Microsoft")] -[assembly: AssemblyProduct("Microsoft Azure .NET SDK")] -[assembly: AssemblyCopyright("Copyright (c) Microsoft Corporation")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] -[assembly: NeutralResourcesLanguage("en")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] From 803ad7bd079217064cc308fc644f4dbef619b694 Mon Sep 17 00:00:00 2001 From: Pooja Adhikari Date: Mon, 24 Jun 2019 10:24:15 -0700 Subject: [PATCH 06/14] Revert unwanted changes --- .../Microsoft.Azure.Management.HealthcareApis.csproj | 8 -------- 1 file changed, 8 deletions(-) diff --git a/src/SDKs/HealthcareApis/Management.HealthcareApis/Microsoft.Azure.Management.HealthcareApis.csproj b/src/SDKs/HealthcareApis/Management.HealthcareApis/Microsoft.Azure.Management.HealthcareApis.csproj index ee98225a4203e..13167cea2d25c 100644 --- a/src/SDKs/HealthcareApis/Management.HealthcareApis/Microsoft.Azure.Management.HealthcareApis.csproj +++ b/src/SDKs/HealthcareApis/Management.HealthcareApis/Microsoft.Azure.Management.HealthcareApis.csproj @@ -21,13 +21,5 @@ - - - - - all - runtime; build; native; contentfiles; analyzers - - From 6f88e83722e06d98f06aad80cef6f0f0d8bcd928 Mon Sep 17 00:00:00 2001 From: Pooja Adhikari Date: Mon, 24 Jun 2019 16:00:35 -0700 Subject: [PATCH 07/14] Code Regenration --- .../Models/ServiceCorsConfigurationInfo.cs | 18 +++++++ .../ServiceCosmosDbConfigurationInfo.cs | 18 +++++++ .../Generated/Models/ServicesProperties.cs | 8 ++++ .../MoveResourcesStatusOperations.cs | 6 ++- .../Generated/OperationResultsOperations.cs | 6 ++- .../SdkInfo_HealthcareApisManagementClient.cs | 11 ----- .../Generated/ServicesOperations.cs | 48 ++++++++++++++++--- .../Management.HealthcareApis/generate.ps1 | 3 +- src/SDKs/_metadata/HealthcareApis.txt | 14 ++++++ 9 files changed, 110 insertions(+), 22 deletions(-) create mode 100644 src/SDKs/_metadata/HealthcareApis.txt diff --git a/src/SDKs/HealthcareApis/Management.HealthcareApis/Generated/Models/ServiceCorsConfigurationInfo.cs b/src/SDKs/HealthcareApis/Management.HealthcareApis/Generated/Models/ServiceCorsConfigurationInfo.cs index 0bfaf07d6e20e..dd039cb279e38 100644 --- a/src/SDKs/HealthcareApis/Management.HealthcareApis/Generated/Models/ServiceCorsConfigurationInfo.cs +++ b/src/SDKs/HealthcareApis/Management.HealthcareApis/Generated/Models/ServiceCorsConfigurationInfo.cs @@ -6,6 +6,7 @@ namespace Microsoft.Azure.Management.HealthcareApis.Models { + using Microsoft.Rest; using Newtonsoft.Json; using System.Collections; using System.Collections.Generic; @@ -80,5 +81,22 @@ public ServiceCorsConfigurationInfo() [JsonProperty(PropertyName = "allowCredentials")] public bool? AllowCredentials { get; set; } + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (MaxAge > 99999) + { + throw new ValidationException(ValidationRules.InclusiveMaximum, "MaxAge", 99999); + } + if (MaxAge < 0) + { + throw new ValidationException(ValidationRules.InclusiveMinimum, "MaxAge", 0); + } + } } } diff --git a/src/SDKs/HealthcareApis/Management.HealthcareApis/Generated/Models/ServiceCosmosDbConfigurationInfo.cs b/src/SDKs/HealthcareApis/Management.HealthcareApis/Generated/Models/ServiceCosmosDbConfigurationInfo.cs index c9bf01bb80808..4909725ae9103 100644 --- a/src/SDKs/HealthcareApis/Management.HealthcareApis/Generated/Models/ServiceCosmosDbConfigurationInfo.cs +++ b/src/SDKs/HealthcareApis/Management.HealthcareApis/Generated/Models/ServiceCosmosDbConfigurationInfo.cs @@ -6,6 +6,7 @@ namespace Microsoft.Azure.Management.HealthcareApis.Models { + using Microsoft.Rest; using Newtonsoft.Json; using System.Linq; @@ -46,5 +47,22 @@ public ServiceCosmosDbConfigurationInfo() [JsonProperty(PropertyName = "offerThroughput")] public int? OfferThroughput { get; set; } + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (OfferThroughput > 10000) + { + throw new ValidationException(ValidationRules.InclusiveMaximum, "OfferThroughput", 10000); + } + if (OfferThroughput < 400) + { + throw new ValidationException(ValidationRules.InclusiveMinimum, "OfferThroughput", 400); + } + } } } diff --git a/src/SDKs/HealthcareApis/Management.HealthcareApis/Generated/Models/ServicesProperties.cs b/src/SDKs/HealthcareApis/Management.HealthcareApis/Generated/Models/ServicesProperties.cs index e489b976ab90b..4db764f6d2990 100644 --- a/src/SDKs/HealthcareApis/Management.HealthcareApis/Generated/Models/ServicesProperties.cs +++ b/src/SDKs/HealthcareApis/Management.HealthcareApis/Generated/Models/ServicesProperties.cs @@ -112,6 +112,14 @@ public virtual void Validate() } } } + if (CosmosDbConfiguration != null) + { + CosmosDbConfiguration.Validate(); + } + if (CorsConfiguration != null) + { + CorsConfiguration.Validate(); + } } } } diff --git a/src/SDKs/HealthcareApis/Management.HealthcareApis/Generated/MoveResourcesStatusOperations.cs b/src/SDKs/HealthcareApis/Management.HealthcareApis/Generated/MoveResourcesStatusOperations.cs index 30c1c30623bf7..b85ca0adcb1c7 100644 --- a/src/SDKs/HealthcareApis/Management.HealthcareApis/Generated/MoveResourcesStatusOperations.cs +++ b/src/SDKs/HealthcareApis/Management.HealthcareApis/Generated/MoveResourcesStatusOperations.cs @@ -78,6 +78,10 @@ internal MoveResourcesStatusOperations(HealthcareApisManagementClient client) /// public async Task> GetWithHttpMessagesAsync(string locationName, string operationResultId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } if (locationName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "locationName"); @@ -101,7 +105,7 @@ internal MoveResourcesStatusOperations(HealthcareApisManagementClient client) // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.HealthcareApis/locations/{locationName}/moveResourcesStatus/{operationResultId}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(Client.SubscriptionId, Client.SerializationSettings).Trim('"'))); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); _url = _url.Replace("{locationName}", System.Uri.EscapeDataString(locationName)); _url = _url.Replace("{operationResultId}", System.Uri.EscapeDataString(operationResultId)); List _queryParameters = new List(); diff --git a/src/SDKs/HealthcareApis/Management.HealthcareApis/Generated/OperationResultsOperations.cs b/src/SDKs/HealthcareApis/Management.HealthcareApis/Generated/OperationResultsOperations.cs index bb4ed03c5bc91..d2f0ca9bbc912 100644 --- a/src/SDKs/HealthcareApis/Management.HealthcareApis/Generated/OperationResultsOperations.cs +++ b/src/SDKs/HealthcareApis/Management.HealthcareApis/Generated/OperationResultsOperations.cs @@ -78,6 +78,10 @@ internal OperationResultsOperations(HealthcareApisManagementClient client) /// public async Task> GetWithHttpMessagesAsync(string locationName, string operationResultId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } if (locationName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "locationName"); @@ -101,7 +105,7 @@ internal OperationResultsOperations(HealthcareApisManagementClient client) // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.HealthcareApis/locations/{locationName}/operationresults/{operationResultId}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(Client.SubscriptionId, Client.SerializationSettings).Trim('"'))); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); _url = _url.Replace("{locationName}", System.Uri.EscapeDataString(locationName)); _url = _url.Replace("{operationResultId}", System.Uri.EscapeDataString(operationResultId)); List _queryParameters = new List(); diff --git a/src/SDKs/HealthcareApis/Management.HealthcareApis/Generated/SdkInfo_HealthcareApisManagementClient.cs b/src/SDKs/HealthcareApis/Management.HealthcareApis/Generated/SdkInfo_HealthcareApisManagementClient.cs index 5151f4da3096d..1b7156ad89624 100644 --- a/src/SDKs/HealthcareApis/Management.HealthcareApis/Generated/SdkInfo_HealthcareApisManagementClient.cs +++ b/src/SDKs/HealthcareApis/Management.HealthcareApis/Generated/SdkInfo_HealthcareApisManagementClient.cs @@ -25,16 +25,5 @@ public static IEnumerable> ApiInfo_HealthcareApisM }.AsEnumerable(); } } - // BEGIN: Code Generation Metadata Section - public static readonly String AutoRestVersion = "2.0.4283"; - public static readonly String AutoRestBootStrapperVersion = "autorest@2.0.4283"; - public static readonly String AutoRestCmdExecuted = "cmd.exe /c autorest.cmd C:/dev/yazanmsft/azure-rest-api-specs/specification/healthcareapis/resource-manager/readme.md --csharp --version=2.0.4283 --reflect-api-versions --csharp.namespace=Microsoft.Azure.Management.HealthcareApis --csharp.output-folder=C:/dev/yazanmsft/azure-sdk-for-net/src/SDKs/HealthcareApis/Management.HealthcareApis/Generated"; - public static readonly String GithubForkName = "Azure"; - public static readonly String GithubBranchName = "master"; - public static readonly String GithubCommidId = "a2e744bb0f7a32513b14ce9fa776e6cd9f906fc7"; - public static readonly String CodeGenerationErrors = ""; - public static readonly String GithubRepoName = "azure-rest-api-specs"; - // END: Code Generation Metadata Section } } - diff --git a/src/SDKs/HealthcareApis/Management.HealthcareApis/Generated/ServicesOperations.cs b/src/SDKs/HealthcareApis/Management.HealthcareApis/Generated/ServicesOperations.cs index a8e8e9764b9f2..37a96b445bfe7 100644 --- a/src/SDKs/HealthcareApis/Management.HealthcareApis/Generated/ServicesOperations.cs +++ b/src/SDKs/HealthcareApis/Management.HealthcareApis/Generated/ServicesOperations.cs @@ -78,6 +78,10 @@ internal ServicesOperations(HealthcareApisManagementClient client) /// public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string resourceName, 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"); @@ -127,7 +131,7 @@ internal ServicesOperations(HealthcareApisManagementClient client) // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/services/{resourceName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(Client.SubscriptionId, Client.SerializationSettings).Trim('"'))); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{resourceName}", System.Uri.EscapeDataString(resourceName)); List _queryParameters = new List(); @@ -342,11 +346,21 @@ internal ServicesOperations(HealthcareApisManagementClient client) /// /// 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(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -360,7 +374,7 @@ internal ServicesOperations(HealthcareApisManagementClient client) // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.HealthcareApis/services").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(Client.SubscriptionId, Client.SerializationSettings).Trim('"'))); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) { @@ -515,6 +529,10 @@ internal ServicesOperations(HealthcareApisManagementClient client) /// public async Task>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, 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"); @@ -548,7 +566,7 @@ internal ServicesOperations(HealthcareApisManagementClient client) // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/services").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(Client.SubscriptionId, Client.SerializationSettings).Trim('"'))); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -705,6 +723,10 @@ internal ServicesOperations(HealthcareApisManagementClient client) /// public async Task> CheckNameAvailabilityWithHttpMessagesAsync(CheckNameAvailabilityParameters checkNameAvailabilityInputs, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } if (checkNameAvailabilityInputs == null) { throw new ValidationException(ValidationRules.CannotBeNull, "checkNameAvailabilityInputs"); @@ -727,7 +749,7 @@ internal ServicesOperations(HealthcareApisManagementClient client) // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.HealthcareApis/checkNameAvailability").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(Client.SubscriptionId, Client.SerializationSettings).Trim('"'))); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) { @@ -894,6 +916,10 @@ internal ServicesOperations(HealthcareApisManagementClient client) /// public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string resourceName, ServicesDescription serviceDescription, 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"); @@ -952,7 +978,7 @@ internal ServicesOperations(HealthcareApisManagementClient client) // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/services/{resourceName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(Client.SubscriptionId, Client.SerializationSettings).Trim('"'))); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{resourceName}", System.Uri.EscapeDataString(resourceName)); List _queryParameters = new List(); @@ -1139,6 +1165,10 @@ internal ServicesOperations(HealthcareApisManagementClient client) /// public async Task> BeginUpdateWithHttpMessagesAsync(string resourceGroupName, string resourceName, ServicesPatchDescription servicePatchDescription, 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"); @@ -1193,7 +1223,7 @@ internal ServicesOperations(HealthcareApisManagementClient client) // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/services/{resourceName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(Client.SubscriptionId, Client.SerializationSettings).Trim('"'))); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{resourceName}", System.Uri.EscapeDataString(resourceName)); List _queryParameters = new List(); @@ -1356,6 +1386,10 @@ internal ServicesOperations(HealthcareApisManagementClient client) /// public async Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string resourceName, 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"); @@ -1405,7 +1439,7 @@ internal ServicesOperations(HealthcareApisManagementClient client) // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/services/{resourceName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(Client.SubscriptionId, Client.SerializationSettings).Trim('"'))); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{resourceName}", System.Uri.EscapeDataString(resourceName)); List _queryParameters = new List(); diff --git a/src/SDKs/HealthcareApis/Management.HealthcareApis/generate.ps1 b/src/SDKs/HealthcareApis/Management.HealthcareApis/generate.ps1 index d6c9d9096ecf8..abf24028ce46a 100644 --- a/src/SDKs/HealthcareApis/Management.HealthcareApis/generate.ps1 +++ b/src/SDKs/HealthcareApis/Management.HealthcareApis/generate.ps1 @@ -1,2 +1 @@ -Start-AutoRestCodeGenerationWithLocalConfig -ResourceProvider "healthcareapis/resource-manager" -AutoRestVersion "2.0.4283" -LocalConfigFilePath "C:/dev/yazanmsft/azure-rest-api-specs/specification/healthcareapis/resource-manager/readme.md" -SdkDirectory "C:/dev/yazanmsft/azure-sdk-for-net/src/SDKs/HealthcareApis/Management.HealthcareApis/Generated" -Namespace Microsoft.Azure.Management.HealthcareApis -# Start-AutoRestCodeGeneration -ResourceProvider "healthcareapis/resource-manager" -AutoRestVersion "latest" +Start-AutoRestCodeGeneration -ResourceProvider "healthcareapis/resource-manager" -AutoRestVersion "latest" diff --git a/src/SDKs/_metadata/HealthcareApis.txt b/src/SDKs/_metadata/HealthcareApis.txt new file mode 100644 index 0000000000000..04026deaba9e7 --- /dev/null +++ b/src/SDKs/_metadata/HealthcareApis.txt @@ -0,0 +1,14 @@ +Installing AutoRest version: latest +AutoRest installed successfully. +Commencing code generation +Generating CSharp code +Executing AutoRest command +cmd.exe /c autorest.cmd https://github.com/Azure/azure-rest-api-specs/blob/master/specification/HealthcareApis/readme.md --csharp --version=latest --reflect-api-versions --csharp-sdks-folder=C:\Repo\SDK\src\SDKs +2019-06-24 20:36:41 UTC +Azure-rest-api-specs repository information +GitHub fork: Azure +Branch: master +Commit: 3d442829ee4098d1981e53ad56ac96ae9d3ed812 +AutoRest information +Requested version: latest +Bootstrapper version: autorest@2.0.4283 From df46744479dbc2f2ba4b8cbb4763c0643aaa3b18 Mon Sep 17 00:00:00 2001 From: Pooja Adhikari Date: Mon, 24 Jun 2019 21:00:35 -0700 Subject: [PATCH 08/14] Code clean up --- .../Tests/HealthcareApisTests.cs | 22 +++++++++---------- 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/src/SDKs/HealthcareApis/HealthcareApis.Tests/Tests/HealthcareApisTests.cs b/src/SDKs/HealthcareApis/HealthcareApis.Tests/Tests/HealthcareApisTests.cs index 0c1dc839dc846..0163c0178b1e0 100644 --- a/src/SDKs/HealthcareApis/HealthcareApis.Tests/Tests/HealthcareApisTests.cs +++ b/src/SDKs/HealthcareApis/HealthcareApis.Tests/Tests/HealthcareApisTests.cs @@ -23,12 +23,12 @@ public void HealthcareApisCreateTest() // Create resource group var rgname = HealthcareApisManagementTestUtilities.CreateResourceGroup(resourcesClient); - //generate account name + // Generate account name string accountName = TestUtilities.GenerateName("hca"); var serviceDescription = HealthcareApisManagementTestUtilities.GetServiceDescription(); - //// Create healthcare apis account + // Create healthcare apis account var account = healthCareApisMgmtClient.Services.CreateOrUpdate(rgname, accountName, serviceDescription); HealthcareApisManagementTestUtilities.VerifyAccountProperties(account, true); } @@ -47,12 +47,12 @@ public void HealthcareApisCreateWithParametersTest() // Create resource group var rgname = HealthcareApisManagementTestUtilities.CreateResourceGroup(resourcesClient); - //generate account name + // Generate account name string accountName = TestUtilities.GenerateName("hca"); var serviceDescription = HealthcareApisManagementTestUtilities.GetServiceDescription(); - //// Create cognitive services account + // Create healthcareApis account var account = healthCareApisMgmtClient.Services.CreateOrUpdate(rgname, accountName, serviceDescription); HealthcareApisManagementTestUtilities.VerifyAccountProperties(account, false); } @@ -71,7 +71,7 @@ public void HealthcareApisCreateAccountErrorTest() // Create resource group var rgname = HealthcareApisManagementTestUtilities.CreateResourceGroup(resourcesClient); - //generate account name + // Generate account name string accountName = TestUtilities.GenerateName("hca"); var serviceDescription = HealthcareApisManagementTestUtilities.GetServiceDescription(); @@ -96,12 +96,12 @@ public void HealthcareApisAccountUpdateWithCreateTest() // Create resource group var rgname = HealthcareApisManagementTestUtilities.CreateResourceGroup(resourcesClient); - //generate account name + // Generate account name string accountName = TestUtilities.GenerateName("hca"); var serviceDescription = HealthcareApisManagementTestUtilities.GetServiceDescription(); - //// Create cognitive services account + //// Create healthcareApis account var createdAccount = healthCareApisMgmtClient.Services.CreateOrUpdate(rgname, accountName, serviceDescription); var servicePatchDescription = HealthcareApisManagementTestUtilities.GetServicePatchDescription(); @@ -160,7 +160,7 @@ public void HealthcareApisGetAccountTest() var serviceDescription = HealthcareApisManagementTestUtilities.GetServiceDescription(); - // Create healthCareApisAccount + // Create healthcareApis account var createdAccount = healthCareApisMgmtClient.Services.CreateOrUpdate(rgname, accountName, serviceDescription); // Validate @@ -183,12 +183,12 @@ public void HealthcareApisDeleteTest() // Create resource group var rgname = HealthcareApisManagementTestUtilities.CreateResourceGroup(resourcesClient); - //generate account name + // Generate account name string accountName = TestUtilities.GenerateName("hca"); var serviceDescription = HealthcareApisManagementTestUtilities.GetServiceDescription(); - //// Create healthcareApis services account + // Create healthcareApis account var account = healthCareApisMgmtClient.Services.CreateOrUpdate(rgname, accountName, serviceDescription); // Delete an account @@ -220,8 +220,6 @@ public void HealthcareApisDeleteAccountErrorTest() } } - - [Fact] public void HealthcareApisCheckNameAvailabilityTest() { From a21a2c41b093ca5350052f38a66e05a80d0402fd Mon Sep 17 00:00:00 2001 From: Pooja Adhikari Date: Mon, 24 Jun 2019 21:12:04 -0700 Subject: [PATCH 09/14] Code clean up --- .../Helpers/HealthcareApisManagementTestUtilities.cs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/SDKs/HealthcareApis/HealthcareApis.Tests/Helpers/HealthcareApisManagementTestUtilities.cs b/src/SDKs/HealthcareApis/HealthcareApis.Tests/Helpers/HealthcareApisManagementTestUtilities.cs index 900ddf6b59d95..2ed68078eaea2 100644 --- a/src/SDKs/HealthcareApis/HealthcareApis.Tests/Helpers/HealthcareApisManagementTestUtilities.cs +++ b/src/SDKs/HealthcareApis/HealthcareApis.Tests/Helpers/HealthcareApisManagementTestUtilities.cs @@ -15,8 +15,6 @@ public static class HealthcareApisManagementTestUtilities { public static bool IsTestTenant = false; private static HttpClientHandler Handler = null; - - private static System.Guid testSubscription = System.Guid.Empty; private static Uri testUri = null; // These are used to create default accounts @@ -159,8 +157,7 @@ public static ResourceManagementClient GetResourceManagementClient(MockContext c public static string CreateHealthcareApisServicesAccount(HealthcareApisManagementClient healthcareApisManagementClient, string rgname, string kind = null) { - string accountName = TestUtilities.GenerateName("csa"); - return accountName; + return TestUtilities.GenerateName("csa"); } public static string CreateResourceGroup(ResourceManagementClient resourcesClient) From 60d22bcd056b6d0f86fa234317467d8086d6606f Mon Sep 17 00:00:00 2001 From: Pooja Adhikari Date: Tue, 25 Jun 2019 10:14:28 -0700 Subject: [PATCH 10/14] Make code change in allignment with the SDK standard --- .../HealthcareApis.Tests.csproj | 157 ++++-------------- .../HealthcareApisManagementTestUtilities.cs | 13 +- .../Helpers/RecordedDelegatingHandler.cs | 5 +- ...Tests.cs => HealthcareApisAccountTests.cs} | 5 +- .../HealthcareApis.Tests/app.config | 11 -- .../HealthcareApis.Tests/packages.config | 21 --- src/SDKs/HealthcareApis/HealthcareApis.sln | 10 +- 7 files changed, 55 insertions(+), 167 deletions(-) rename src/SDKs/HealthcareApis/HealthcareApis.Tests/Tests/{HealthcareApisTests.cs => HealthcareApisAccountTests.cs} (98%) delete mode 100644 src/SDKs/HealthcareApis/HealthcareApis.Tests/app.config delete mode 100644 src/SDKs/HealthcareApis/HealthcareApis.Tests/packages.config diff --git a/src/SDKs/HealthcareApis/HealthcareApis.Tests/HealthcareApis.Tests.csproj b/src/SDKs/HealthcareApis/HealthcareApis.Tests/HealthcareApis.Tests.csproj index d242189170567..2e5b2ca51942a 100644 --- a/src/SDKs/HealthcareApis/HealthcareApis.Tests/HealthcareApis.Tests.csproj +++ b/src/SDKs/HealthcareApis/HealthcareApis.Tests/HealthcareApis.Tests.csproj @@ -1,153 +1,64 @@ - - - - + + - Debug - AnyCPU - {060A808A-4DE1-4072-9DEF-9DC75A353C51} + netstandard2.0 + Library - Properties - HealthcareApis.Tests + + + + + HealthcareApis.Tests + HealthcareApis.Tests Class Library HealthcareApis.Tests - v4.6.1 - 512 - true - - + 1.0.0-preview - - true - full - false + + + TRACE;netcoreapp20;DebugInVS bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 + obj\Debug\netcoreapp2.0\HealthcareApis.Tests.xml + - - ..\packages\Microsoft.Azure.Management.ResourceManager.2.1.0-preview\lib\net461\Microsoft.Azure.Management.ResourceManager.dll - - - ..\packages\Microsoft.Azure.Management.ResourceManager.Fluent.1.22.2\lib\net461\Microsoft.Azure.Management.ResourceManager.Fluent.dll - - - ..\packages\Microsoft.Azure.Test.HttpRecorder.1.13.2\lib\net461\Microsoft.Azure.Test.HttpRecorder.dll - - - ..\packages\Microsoft.IdentityModel.Clients.ActiveDirectory.3.14.0\lib\net45\Microsoft.IdentityModel.Clients.ActiveDirectory.dll - - - ..\packages\Microsoft.IdentityModel.Clients.ActiveDirectory.3.14.0\lib\net45\Microsoft.IdentityModel.Clients.ActiveDirectory.Platform.dll - - - ..\packages\Microsoft.IdentityModel.Logging.1.1.2\lib\net451\Microsoft.IdentityModel.Logging.dll - - - ..\packages\Microsoft.IdentityModel.Tokens.5.1.2\lib\net451\Microsoft.IdentityModel.Tokens.dll - - - ..\packages\Microsoft.Rest.ClientRuntime.2.3.19\lib\net461\Microsoft.Rest.ClientRuntime.dll - - - ..\packages\Microsoft.Rest.ClientRuntime.Azure.3.3.19\lib\net461\Microsoft.Rest.ClientRuntime.Azure.dll - - - ..\packages\Microsoft.Rest.ClientRuntime.Azure.Authentication.2.3.7\lib\net461\Microsoft.Rest.ClientRuntime.Azure.Authentication.dll - - - ..\packages\Microsoft.Rest.ClientRuntime.Azure.TestFramework.1.7.6\lib\net461\Microsoft.Rest.ClientRuntime.Azure.TestFramework.dll - - - ..\packages\Newtonsoft.Json.10.0.3\lib\net45\Newtonsoft.Json.dll - - - - - - - - - - - - - - - ..\packages\xunit.abstractions.2.0.3\lib\net35\xunit.abstractions.dll - - - ..\packages\xunit.assert.2.4.1\lib\netstandard1.1\xunit.assert.dll - - - ..\packages\xunit.extensibility.core.2.4.1\lib\net452\xunit.core.dll - - - ..\packages\xunit.extensibility.execution.2.4.1\lib\net452\xunit.execution.desktop.dll - + + + + + - - - - + + - - - - - - + Always - + Always - + Always - + Always - + Always - + Always - + Always - + Always - + Always - - - {6f4e6681-fa47-4ffc-8e02-32212fdeddc9} - Microsoft.Azure.Management.HealthcareApis - - - - - - This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - - - - - - \ No newline at end of file + + diff --git a/src/SDKs/HealthcareApis/HealthcareApis.Tests/Helpers/HealthcareApisManagementTestUtilities.cs b/src/SDKs/HealthcareApis/HealthcareApis.Tests/Helpers/HealthcareApisManagementTestUtilities.cs index 2ed68078eaea2..8a5407fa378dc 100644 --- a/src/SDKs/HealthcareApis/HealthcareApis.Tests/Helpers/HealthcareApisManagementTestUtilities.cs +++ b/src/SDKs/HealthcareApis/HealthcareApis.Tests/Helpers/HealthcareApisManagementTestUtilities.cs @@ -1,13 +1,16 @@ -using Microsoft.Azure.Management.HealthcareApis; +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. + +using Microsoft.Azure.Management.HealthcareApis; using Microsoft.Azure.Management.HealthcareApis.Models; -using Microsoft.Azure.Management.ResourceManager; -using Microsoft.Azure.Management.ResourceManager.Models; using Microsoft.Rest; +using Microsoft.Azure.Management.ResourceManager; using Microsoft.Rest.ClientRuntime.Azure.TestFramework; using System; using System.Collections.Generic; using System.Net.Http; using Xunit; +using Microsoft.Azure.Management.ResourceManager.Models; namespace HealthcareApis.Tests.Helpers { @@ -92,7 +95,7 @@ public static ServicesProperties GetServiceProperties() ServiceCosmosDbConfigurationInfo cosmosDbConfigurationInfo = new ServiceCosmosDbConfigurationInfo(offerThroughput); ServiceAuthenticationConfigurationInfo authenticationConfigurationInfo = new ServiceAuthenticationConfigurationInfo(authority, audience, smartOnFhirEnabled); - + var serviceProperties = new ServicesProperties(accessPolicies, provisioningState, cosmosDbConfigurationInfo, authenticationConfigurationInfo); return serviceProperties; @@ -106,7 +109,7 @@ public static string GetLocationFromProvider(this ResourceManagementClient resou public static void VerifyAccountProperties(ServicesDescription account, bool useDefaults, string location = "westus") { // verifies that the account is actually created - Assert.NotNull(account); + Assert.NotNull(account); Assert.NotNull(account.Id); Assert.NotNull(account.Location); Assert.NotNull(account.Name); diff --git a/src/SDKs/HealthcareApis/HealthcareApis.Tests/Helpers/RecordedDelegatingHandler.cs b/src/SDKs/HealthcareApis/HealthcareApis.Tests/Helpers/RecordedDelegatingHandler.cs index e46ccf157e147..5fa8485ce0d5d 100644 --- a/src/SDKs/HealthcareApis/HealthcareApis.Tests/Helpers/RecordedDelegatingHandler.cs +++ b/src/SDKs/HealthcareApis/HealthcareApis.Tests/Helpers/RecordedDelegatingHandler.cs @@ -1,4 +1,7 @@ -using System; +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. + +using System; using System.Net; using System.Net.Http; using System.Net.Http.Headers; diff --git a/src/SDKs/HealthcareApis/HealthcareApis.Tests/Tests/HealthcareApisTests.cs b/src/SDKs/HealthcareApis/HealthcareApis.Tests/Tests/HealthcareApisAccountTests.cs similarity index 98% rename from src/SDKs/HealthcareApis/HealthcareApis.Tests/Tests/HealthcareApisTests.cs rename to src/SDKs/HealthcareApis/HealthcareApis.Tests/Tests/HealthcareApisAccountTests.cs index 0163c0178b1e0..747e4807f8689 100644 --- a/src/SDKs/HealthcareApis/HealthcareApis.Tests/Tests/HealthcareApisTests.cs +++ b/src/SDKs/HealthcareApis/HealthcareApis.Tests/Tests/HealthcareApisAccountTests.cs @@ -1,4 +1,7 @@ -using HealthcareApis.Tests.Helpers; +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. + +using HealthcareApis.Tests.Helpers; using Microsoft.Azure.Management.HealthcareApis; using Microsoft.Azure.Management.HealthcareApis.Models; using Microsoft.Rest.ClientRuntime.Azure.TestFramework; diff --git a/src/SDKs/HealthcareApis/HealthcareApis.Tests/app.config b/src/SDKs/HealthcareApis/HealthcareApis.Tests/app.config deleted file mode 100644 index dde2c3cc64e79..0000000000000 --- a/src/SDKs/HealthcareApis/HealthcareApis.Tests/app.config +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - - \ No newline at end of file diff --git a/src/SDKs/HealthcareApis/HealthcareApis.Tests/packages.config b/src/SDKs/HealthcareApis/HealthcareApis.Tests/packages.config deleted file mode 100644 index c36c30acd33ef..0000000000000 --- a/src/SDKs/HealthcareApis/HealthcareApis.Tests/packages.config +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/SDKs/HealthcareApis/HealthcareApis.sln b/src/SDKs/HealthcareApis/HealthcareApis.sln index b98debae937c7..271217f3a3ff1 100644 --- a/src/SDKs/HealthcareApis/HealthcareApis.sln +++ b/src/SDKs/HealthcareApis/HealthcareApis.sln @@ -5,7 +5,7 @@ VisualStudioVersion = 15.0.28307.438 MinimumVisualStudioVersion = 10.0.40219.1 Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Azure.Management.HealthcareApis", "Management.HealthcareApis\Microsoft.Azure.Management.HealthcareApis.csproj", "{6F4E6681-FA47-4FFC-8E02-32212FDEDDC9}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HealthcareApis.Tests", "HealthcareApis.Tests\HealthcareApis.Tests.csproj", "{060A808A-4DE1-4072-9DEF-9DC75A353C51}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HealthcareApis.Tests", "HealthcareApis.Tests\HealthcareApis.Tests.csproj", "{FC36BDC8-F7B8-474D-BC49-15C11CA3C46A}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -17,10 +17,10 @@ Global {6F4E6681-FA47-4FFC-8E02-32212FDEDDC9}.Debug|Any CPU.Build.0 = Debug|Any CPU {6F4E6681-FA47-4FFC-8E02-32212FDEDDC9}.Release|Any CPU.ActiveCfg = Release|Any CPU {6F4E6681-FA47-4FFC-8E02-32212FDEDDC9}.Release|Any CPU.Build.0 = Release|Any CPU - {060A808A-4DE1-4072-9DEF-9DC75A353C51}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {060A808A-4DE1-4072-9DEF-9DC75A353C51}.Debug|Any CPU.Build.0 = Debug|Any CPU - {060A808A-4DE1-4072-9DEF-9DC75A353C51}.Release|Any CPU.ActiveCfg = Release|Any CPU - {060A808A-4DE1-4072-9DEF-9DC75A353C51}.Release|Any CPU.Build.0 = Release|Any CPU + {FC36BDC8-F7B8-474D-BC49-15C11CA3C46A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {FC36BDC8-F7B8-474D-BC49-15C11CA3C46A}.Debug|Any CPU.Build.0 = Debug|Any CPU + {FC36BDC8-F7B8-474D-BC49-15C11CA3C46A}.Release|Any CPU.ActiveCfg = Release|Any CPU + {FC36BDC8-F7B8-474D-BC49-15C11CA3C46A}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE From bd30f1a9fee11218ebe52ec3b81a088d2663b9f3 Mon Sep 17 00:00:00 2001 From: Pooja Adhikari Date: Tue, 25 Jun 2019 10:38:27 -0700 Subject: [PATCH 11/14] More clean up --- .../HealthcareApisAccountUpdateWithCreateTest.json | 8 ++++---- .../HealthcareApisCreateAccountErrorTest.json | 2 +- .../HealthcareApisTests/HealthcareApisCreateTest.json | 4 ++-- .../HealthcareApisCreateWithParametersTest.json | 4 ++-- .../HealthcareApisTests/HealthcareApisDeleteTest.json | 4 ++-- .../HealthcareApisTests/HealthcareApisGetAccountTest.json | 2 +- .../Tests/HealthcareApisAccountTests.cs | 2 +- 7 files changed, 13 insertions(+), 13 deletions(-) diff --git a/src/SDKs/HealthcareApis/HealthcareApis.Tests/SessionRecords/HealthcareApisTests/HealthcareApisAccountUpdateWithCreateTest.json b/src/SDKs/HealthcareApis/HealthcareApis.Tests/SessionRecords/HealthcareApisTests/HealthcareApisAccountUpdateWithCreateTest.json index 6ba1ea406c995..799a499be1159 100644 --- a/src/SDKs/HealthcareApis/HealthcareApis.Tests/SessionRecords/HealthcareApisTests/HealthcareApisAccountUpdateWithCreateTest.json +++ b/src/SDKs/HealthcareApis/HealthcareApis.Tests/SessionRecords/HealthcareApisTests/HealthcareApisAccountUpdateWithCreateTest.json @@ -68,7 +68,7 @@ "RequestUri": "/subscriptions/cc148bf2-42fb-4913-a3fb-2f284a69eb89/resourceGroups/res7089/providers/Microsoft.HealthcareApis/services/hca1234?api-version=2018-08-20-preview", "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvY2MxNDhiZjItNDJmYi00OTEzLWEzZmItMmYyODRhNjllYjg5L3Jlc291cmNlR3JvdXBzL3JlczcwODkvcHJvdmlkZXJzL01pY3Jvc29mdC5IZWFsdGhjYXJlQXBpcy9zZXJ2aWNlcy9oY2ExMjM0P2FwaS12ZXJzaW9uPTIwMTgtMDgtMjAtcHJldmlldw==", "RequestMethod": "PUT", - "RequestBody": "{\r\n \"sku\": {\r\n \"name\": \"S1\"\r\n },\r\n \"location\": \"westus\",\r\n \"properties\": {}\r\n}", + "RequestBody": "{\r\n \"name\": \"S1\"\r\n ,\r\n \"location\": \"westus\",\r\n \"properties\": {}\r\n}", "RequestHeaders": { "Content-Type": [ "application/json; charset=utf-8" @@ -87,7 +87,7 @@ "Microsoft.Azure.Management.HealthcareApis.HealthcareApisManagementClient/1.0.0.0" ] }, - "ResponseBody": "{\r\n \"id\": \"/subscriptions/cc148bf2-42fb-4913-a3fb-2f284a69eb89/resourceGroups/res7089/providers/Microsoft.HealthcareApis/accounts/hca1234\",\r\n \"name\": \"hca1234\",\r\n \"type\": \"Microsoft.HealthcareApis/accounts\",\r\n \"etag\": \"\\\"0a002ee3-0000-0000-0000-5aa238d80000\\\"\",\r\n \"location\": \"westus\",\r\n \"sku\": {\r\n \"name\": \"S1\"\r\n },\r\n \"kind\": \"Fhir\",\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\"\r\n }\r\n}", + "ResponseBody": "{\r\n \"id\": \"/subscriptions/cc148bf2-42fb-4913-a3fb-2f284a69eb89/resourceGroups/res7089/providers/Microsoft.HealthcareApis/accounts/hca1234\",\r\n \"name\": \"hca1234\",\r\n \"type\": \"Microsoft.HealthcareApis/accounts\",\r\n \"etag\": \"\\\"0a002ee3-0000-0000-0000-5aa238d80000\\\"\",\r\n \"location\": \"westus\",\r\n \"name\": \"S1\"\r\n ,\r\n \"kind\": \"Fhir\",\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\"\r\n }\r\n}", "ResponseHeaders": { "Content-Length": [ "570" @@ -163,7 +163,7 @@ "Microsoft.Azure.Management.HealthcareApis.HealthcareApisManagementClient/1.0.0.0\"" ] }, - "ResponseBody": "{\r\n \"id\": \"/subscriptions/cc148bf2-42fb-4913-a3fb-2f284a69eb89/resourceGroups/res7089/providers/Microsoft.HealthcareApis/services/account1234\",\r\n \"name\": \"account1234\",\r\n \"type\": \"Microsoft.HealthcareApis/accounts\",\r\n \"location\": \"westus\",\r\n \"sku\": {\r\n \"name\": \"S1\"\r\n },\r\n \"kind\": \"Fhir\",\r\n \"tags\": {\r\n \"key3\": \"value3\",\r\n \"key4\": \"value4\",\r\n \"key5\": \"value5\"\r\n },\"properties\": {\"provisioningState\": \"Succeeded\"}}", + "ResponseBody": "{\r\n \"id\": \"/subscriptions/cc148bf2-42fb-4913-a3fb-2f284a69eb89/resourceGroups/res7089/providers/Microsoft.HealthcareApis/services/account1234\",\r\n \"name\": \"account1234\",\r\n \"type\": \"Microsoft.HealthcareApis/accounts\",\r\n \"location\": \"westus\",\r\n \"name\": \"S1\"\r\n ,\r\n \"kind\": \"Fhir\",\r\n \"tags\": {\r\n \"key3\": \"value3\",\r\n \"key4\": \"value4\",\r\n \"key5\": \"value5\"\r\n },\"properties\": {\"provisioningState\": \"Succeeded\"}}", "ResponseHeaders": { "Content-Type": [ "application/json; charset=utf-8" @@ -236,7 +236,7 @@ "Microsoft.Azure.Management.HealthcareApis.HealthcareApisManagementClient/3.0.0.0" ] }, - "ResponseBody": "{\r\n \"id\": \"/subscriptions/cc148bf2-42fb-4913-a3fb-2f284a69eb89/resourceGroups/res7089/providers/Microsoft.HealthcareApis/services/hca1234\",\r\n \"name\": \"hca1234\",\r\n \"type\": \"Microsoft.HealthcareApis/accounts\",\r\n \"location\": \"westus\",\r\n \"sku\": {\r\n \"name\": \"S1\"\r\n },\r\n \"kind\": \"Fhir\",\r\n \"tags\": {\r\n \"key3\": \"value3\",\r\n \"key4\": \"value4\",\r\n \"key5\": \"value5\"\r\n },\"properties\": {\"provisioningState\": \"Succeeded\"}}", + "ResponseBody": "{\r\n \"id\": \"/subscriptions/cc148bf2-42fb-4913-a3fb-2f284a69eb89/resourceGroups/res7089/providers/Microsoft.HealthcareApis/services/hca1234\",\r\n \"name\": \"hca1234\",\r\n \"type\": \"Microsoft.HealthcareApis/accounts\",\r\n \"location\": \"westus\",\r\n \"name\": \"S1\"\r\n ,\r\n \"kind\": \"Fhir\",\r\n \"tags\": {\r\n \"key3\": \"value3\",\r\n \"key4\": \"value4\",\r\n \"key5\": \"value5\"\r\n },\"properties\": {\"provisioningState\": \"Succeeded\"}}", "ResponseHeaders": { "Content-Type": [ "application/json; charset=utf-8" diff --git a/src/SDKs/HealthcareApis/HealthcareApis.Tests/SessionRecords/HealthcareApisTests/HealthcareApisCreateAccountErrorTest.json b/src/SDKs/HealthcareApis/HealthcareApis.Tests/SessionRecords/HealthcareApisTests/HealthcareApisCreateAccountErrorTest.json index 098fdbb466179..fe25e66f46695 100644 --- a/src/SDKs/HealthcareApis/HealthcareApis.Tests/SessionRecords/HealthcareApisTests/HealthcareApisCreateAccountErrorTest.json +++ b/src/SDKs/HealthcareApis/HealthcareApis.Tests/SessionRecords/HealthcareApisTests/HealthcareApisCreateAccountErrorTest.json @@ -68,7 +68,7 @@ "RequestUri": "/subscriptions/cc148bf2-42fb-4913-a3fb-2f284a69eb89/resourceGroups/NotExistedRG/providers/Microsoft.HealthcareApis/services/hca1234?api-version=2018-08-20-preview", "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvY2MxNDhiZjItNDJmYi00OTEzLWEzZmItMmYyODRhNjllYjg5L3Jlc291cmNlR3JvdXBzL05vdEV4aXN0ZWRSRy9wcm92aWRlcnMvTWljcm9zb2Z0LkhlYWx0aGNhcmVBcGlzL3NlcnZpY2VzL2hjYTEyMzQ/YXBpLXZlcnNpb249MjAxOC0wOC0yMC1wcmV2aWV3", "RequestMethod": "PUT", - "RequestBody": "{\r\n \"sku\": {\r\n \"name\": \"S1\"\r\n },\r\n \"location\": \"westus\",\r\n \"properties\": {}\r\n}", + "RequestBody": "{\r\n \"name\": \"S1\"\r\n ,\r\n \"location\": \"westus\",\r\n \"properties\": {}\r\n}", "RequestHeaders": { "Content-Type": [ "application/json; charset=utf-8" diff --git a/src/SDKs/HealthcareApis/HealthcareApis.Tests/SessionRecords/HealthcareApisTests/HealthcareApisCreateTest.json b/src/SDKs/HealthcareApis/HealthcareApis.Tests/SessionRecords/HealthcareApisTests/HealthcareApisCreateTest.json index 24cad4e610769..47cac5653604f 100644 --- a/src/SDKs/HealthcareApis/HealthcareApis.Tests/SessionRecords/HealthcareApisTests/HealthcareApisCreateTest.json +++ b/src/SDKs/HealthcareApis/HealthcareApis.Tests/SessionRecords/HealthcareApisTests/HealthcareApisCreateTest.json @@ -68,7 +68,7 @@ "RequestUri": "/subscriptions/cc148bf2-42fb-4913-a3fb-2f284a69eb89/resourceGroups/res7089/providers/Microsoft.HealthcareApis/services/hca1234?api-version=2018-08-20-preview", "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvY2MxNDhiZjItNDJmYi00OTEzLWEzZmItMmYyODRhNjllYjg5L3Jlc291cmNlR3JvdXBzL3JlczcwODkvcHJvdmlkZXJzL01pY3Jvc29mdC5IZWFsdGhjYXJlQXBpcy9zZXJ2aWNlcy9oY2ExMjM0P2FwaS12ZXJzaW9uPTIwMTgtMDgtMjAtcHJldmlldw==", "RequestMethod": "PUT", - "RequestBody": "{\r\n \"sku\": {\r\n \"name\": \"S1\"\r\n },\r\n \"location\": \"westus\",\r\n \"properties\": {}\r\n}", + "RequestBody": "{\r\n \"name\": \"S1\"\r\n,\r\n \"location\": \"westus\",\r\n \"properties\": {}\r\n}", "RequestHeaders": { "Content-Type": [ "application/json; charset=utf-8" @@ -87,7 +87,7 @@ "Microsoft.Azure.Management.HealthcareApis.HealthcareApisManagementClient/1.0.0.0" ] }, - "ResponseBody": "{\r\n \"id\": \"/subscriptions/cc148bf2-42fb-4913-a3fb-2f284a69eb89/resourceGroups/res7089/providers/Microsoft.HealthcareApis/accounts/hca1234\",\r\n \"name\": \"hca1234\",\r\n \"type\": \"Microsoft.HealthcareApis/accounts\",\r\n \"etag\": \"\\\"0a002ee3-0000-0000-0000-5aa238d80000\\\"\",\r\n \"location\": \"westus\",\r\n \"sku\": {\r\n \"name\": \"S1\"\r\n },\r\n \"kind\": \"Fhir\",\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\"\r\n }\r\n}", + "ResponseBody": "{\r\n \"id\": \"/subscriptions/cc148bf2-42fb-4913-a3fb-2f284a69eb89/resourceGroups/res7089/providers/Microsoft.HealthcareApis/accounts/hca1234\",\r\n \"name\": \"hca1234\",\r\n \"type\": \"Microsoft.HealthcareApis/accounts\",\r\n \"etag\": \"\\\"0a002ee3-0000-0000-0000-5aa238d80000\\\"\",\r\n \"location\": \"westus\",\r\n \"name\": \"S1\"\r\n ,\r\n \"kind\": \"Fhir\",\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\"\r\n }\r\n}", "ResponseHeaders": { "Content-Length": [ "570" diff --git a/src/SDKs/HealthcareApis/HealthcareApis.Tests/SessionRecords/HealthcareApisTests/HealthcareApisCreateWithParametersTest.json b/src/SDKs/HealthcareApis/HealthcareApis.Tests/SessionRecords/HealthcareApisTests/HealthcareApisCreateWithParametersTest.json index e3e43d3672c2d..8879c710f9725 100644 --- a/src/SDKs/HealthcareApis/HealthcareApis.Tests/SessionRecords/HealthcareApisTests/HealthcareApisCreateWithParametersTest.json +++ b/src/SDKs/HealthcareApis/HealthcareApis.Tests/SessionRecords/HealthcareApisTests/HealthcareApisCreateWithParametersTest.json @@ -68,7 +68,7 @@ "RequestUri": "/subscriptions/cc148bf2-42fb-4913-a3fb-2f284a69eb89/resourceGroups/res7089/providers/Microsoft.HealthcareApis/services/hca1234?api-version=2018-08-20-preview", "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvY2MxNDhiZjItNDJmYi00OTEzLWEzZmItMmYyODRhNjllYjg5L3Jlc291cmNlR3JvdXBzL3JlczcwODkvcHJvdmlkZXJzL01pY3Jvc29mdC5IZWFsdGhjYXJlQXBpcy9zZXJ2aWNlcy9oY2ExMjM0P2FwaS12ZXJzaW9uPTIwMTgtMDgtMjAtcHJldmlldw==", "RequestMethod": "PUT", - "RequestBody": "{ \"sku\":{ \"name\": \"S1\" },\"location\":\"westus\", \"properties\": { \"authenticationConfiguration\": { \"authority\": \"https://login.microsoftonline.com/common\",\"audience\": \"https://azurehealthcareapis.com\",\"smartProxyEnabled\": \"false\" },\"cosmosDbConfiguration\": {\"offerThroughput\": \"400\"},\"accessPolicies\": [ {\"objectId\": \"7df19f2f-6169-40f0-ac1e-9a9b4e65a898\"}]}}", + "RequestBody": "{ \"name\": \"S1\" ,\"location\":\"westus\", \"properties\": { \"authenticationConfiguration\": { \"authority\": \"https://login.microsoftonline.com/common\",\"audience\": \"https://azurehealthcareapis.com\",\"smartProxyEnabled\": \"false\" },\"cosmosDbConfiguration\": {\"offerThroughput\": \"400\"},\"accessPolicies\": [ {\"objectId\": \"7df19f2f-6169-40f0-ac1e-9a9b4e65a898\"}]}}", "RequestHeaders": { "Content-Type": [ "application/json; charset=utf-8" @@ -87,7 +87,7 @@ "Microsoft.Azure.Management.HealthcareApis.HealthcareApisManagementClient/1.0.0.0" ] }, - "ResponseBody": "{\r\n \"id\": \"/subscriptions/cc148bf2-42fb-4913-a3fb-2f284a69eb89/resourceGroups/res7089/providers/Microsoft.HealthcareApis/accounts/hca1234\",\r\n \"name\": \"hca1234\",\r\n \"type\": \"Microsoft.HealthcareApis/accounts\",\r\n \"etag\": \"\\\"0a002ee3-0000-0000-0000-5aa238d80000\\\"\",\r\n \"location\": \"westus\",\r\n \"sku\": {\r\n \"name\": \"S1\"\r\n },\r\n \"kind\": \"Fhir\",\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\"\r\n , \"authenticationConfiguration\": { \"authority\": \"https://login.microsoftonline.com/common\",\"audience\": \"https://azurehealthcareapis.com\",\"smartProxyEnabled\": \"false\" },\"cosmosDbConfiguration\": {\"offerThroughput\": \"400\"},\"accessPolicies\": [ {\"objectId\": \"7df19f2f-6169-40f0-ac1e-9a9b4e65a898\"}]}}\r\n", + "ResponseBody": "{\r\n \"id\": \"/subscriptions/cc148bf2-42fb-4913-a3fb-2f284a69eb89/resourceGroups/res7089/providers/Microsoft.HealthcareApis/accounts/hca1234\",\r\n \"name\": \"hca1234\",\r\n \"type\": \"Microsoft.HealthcareApis/accounts\",\r\n \"etag\": \"\\\"0a002ee3-0000-0000-0000-5aa238d80000\\\"\",\r\n \"location\": \"westus\",\r\n \"name\": \"S1\"\r\n ,\r\n \"kind\": \"Fhir\",\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\"\r\n , \"authenticationConfiguration\": { \"authority\": \"https://login.microsoftonline.com/common\",\"audience\": \"https://azurehealthcareapis.com\",\"smartProxyEnabled\": \"false\" },\"cosmosDbConfiguration\": {\"offerThroughput\": \"400\"},\"accessPolicies\": [ {\"objectId\": \"7df19f2f-6169-40f0-ac1e-9a9b4e65a898\"}]}}\r\n", "ResponseHeaders": { "Content-Length": [ "570" diff --git a/src/SDKs/HealthcareApis/HealthcareApis.Tests/SessionRecords/HealthcareApisTests/HealthcareApisDeleteTest.json b/src/SDKs/HealthcareApis/HealthcareApis.Tests/SessionRecords/HealthcareApisTests/HealthcareApisDeleteTest.json index 6f8d9b5b5c30a..77a59397d82f1 100644 --- a/src/SDKs/HealthcareApis/HealthcareApis.Tests/SessionRecords/HealthcareApisTests/HealthcareApisDeleteTest.json +++ b/src/SDKs/HealthcareApis/HealthcareApis.Tests/SessionRecords/HealthcareApisTests/HealthcareApisDeleteTest.json @@ -68,7 +68,7 @@ "RequestUri": "/subscriptions/cc148bf2-42fb-4913-a3fb-2f284a69eb89/resourceGroups/res7089/providers/Microsoft.HealthcareApis/services/hca1234?api-version=2018-08-20-preview", "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvY2MxNDhiZjItNDJmYi00OTEzLWEzZmItMmYyODRhNjllYjg5L3Jlc291cmNlR3JvdXBzL3JlczcwODkvcHJvdmlkZXJzL01pY3Jvc29mdC5IZWFsdGhjYXJlQXBpcy9zZXJ2aWNlcy9oY2ExMjM0P2FwaS12ZXJzaW9uPTIwMTgtMDgtMjAtcHJldmlldw==", "RequestMethod": "PUT", - "RequestBody": "{\r\n \"sku\": {\r\n \"name\": \"S1\"\r\n },\r\n \"location\": \"westus\",\r\n \"properties\": {}\r\n}", + "RequestBody": "{\r\n \"name\": \"S1\"\r\n ,\r\n \"location\": \"westus\",\r\n \"properties\": {}\r\n}", "RequestHeaders": { "Content-Type": [ "application/json; charset=utf-8" @@ -87,7 +87,7 @@ "Microsoft.Azure.Management.HealthcareApis.HealthcareApisManagementClient/1.0.0.0" ] }, - "ResponseBody": "{\r\n \"id\": \"/subscriptions/cc148bf2-42fb-4913-a3fb-2f284a69eb89/resourceGroups/res7089/providers/Microsoft.HealthcareApis/accounts/hca1234\",\r\n \"name\": \"hca1234\",\r\n \"type\": \"Microsoft.HealthcareApis/accounts\",\r\n \"etag\": \"\\\"0a002ee3-0000-0000-0000-5aa238d80000\\\"\",\r\n \"location\": \"westus\",\r\n \"sku\": {\r\n \"name\": \"S1\"\r\n },\r\n \"kind\": \"Fhir\",\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\"\r\n }\r\n}", + "ResponseBody": "{\r\n \"id\": \"/subscriptions/cc148bf2-42fb-4913-a3fb-2f284a69eb89/resourceGroups/res7089/providers/Microsoft.HealthcareApis/accounts/hca1234\",\r\n \"name\": \"hca1234\",\r\n \"type\": \"Microsoft.HealthcareApis/accounts\",\r\n \"etag\": \"\\\"0a002ee3-0000-0000-0000-5aa238d80000\\\"\",\r\n \"location\": \"westus\",\r\n \"name\": \"S1\"\r\n ,\r\n \"kind\": \"Fhir\",\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\"\r\n }\r\n}", "ResponseHeaders": { "Content-Length": [ "570" diff --git a/src/SDKs/HealthcareApis/HealthcareApis.Tests/SessionRecords/HealthcareApisTests/HealthcareApisGetAccountTest.json b/src/SDKs/HealthcareApis/HealthcareApis.Tests/SessionRecords/HealthcareApisTests/HealthcareApisGetAccountTest.json index 3785e6e8fa23e..0952c2e4671f8 100644 --- a/src/SDKs/HealthcareApis/HealthcareApis.Tests/SessionRecords/HealthcareApisTests/HealthcareApisGetAccountTest.json +++ b/src/SDKs/HealthcareApis/HealthcareApis.Tests/SessionRecords/HealthcareApisTests/HealthcareApisGetAccountTest.json @@ -68,7 +68,7 @@ "RequestUri": "/subscriptions/cc148bf2-42fb-4913-a3fb-2f284a69eb89/resourceGroups/res7089/providers/Microsoft.HealthcareApis/services/hca1234?api-version=2018-08-20-preview", "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvY2MxNDhiZjItNDJmYi00OTEzLWEzZmItMmYyODRhNjllYjg5L3Jlc291cmNlR3JvdXBzL3JlczcwODkvcHJvdmlkZXJzL01pY3Jvc29mdC5IZWFsdGhjYXJlQXBpcy9zZXJ2aWNlcy9oY2ExMjM0P2FwaS12ZXJzaW9uPTIwMTgtMDgtMjAtcHJldmlldw==", "RequestMethod": "PUT", - "RequestBody": "{\r\n \"sku\": {\r\n \"name\": \"S1\"\r\n },\r\n \"location\": \"westus\",\r\n \"properties\": {}\r\n}", + "RequestBody": "{\r\n \"name\": \"S1\"\r\n ,\r\n \"location\": \"westus\",\r\n \"properties\": {}\r\n}", "RequestHeaders": { "Content-Type": [ "application/json; charset=utf-8" diff --git a/src/SDKs/HealthcareApis/HealthcareApis.Tests/Tests/HealthcareApisAccountTests.cs b/src/SDKs/HealthcareApis/HealthcareApis.Tests/Tests/HealthcareApisAccountTests.cs index 747e4807f8689..49369327d5f17 100644 --- a/src/SDKs/HealthcareApis/HealthcareApis.Tests/Tests/HealthcareApisAccountTests.cs +++ b/src/SDKs/HealthcareApis/HealthcareApis.Tests/Tests/HealthcareApisAccountTests.cs @@ -109,7 +109,7 @@ public void HealthcareApisAccountUpdateWithCreateTest() var servicePatchDescription = HealthcareApisManagementTestUtilities.GetServicePatchDescription(); - // Update SKU + // Update Tags var account = healthCareApisMgmtClient.Services.Update(rgname, accountName, servicePatchDescription); Assert.True(account.Tags.Values.Contains("value3")); Assert.True(account.Tags.Values.Contains("value4")); From 7d6ae9d82e3636f6391d2952e3b948a06f7bef78 Mon Sep 17 00:00:00 2001 From: Pooja Adhikari Date: Fri, 28 Jun 2019 10:45:31 -0700 Subject: [PATCH 12/14] Comments per code review --- .../HealthcareApisManagementTestUtilities.cs | 14 -------------- .../Helpers/RecordedDelegatingHandler.cs | 7 ------- .../HealthcareApisListAccountsTest.json | 2 +- .../Tests/HealthcareApisAccountTests.cs | 2 +- 4 files changed, 2 insertions(+), 23 deletions(-) diff --git a/src/SDKs/HealthcareApis/HealthcareApis.Tests/Helpers/HealthcareApisManagementTestUtilities.cs b/src/SDKs/HealthcareApis/HealthcareApis.Tests/Helpers/HealthcareApisManagementTestUtilities.cs index 8a5407fa378dc..ace31a3845c49 100644 --- a/src/SDKs/HealthcareApis/HealthcareApis.Tests/Helpers/HealthcareApisManagementTestUtilities.cs +++ b/src/SDKs/HealthcareApis/HealthcareApis.Tests/Helpers/HealthcareApisManagementTestUtilities.cs @@ -68,14 +68,12 @@ public static ServicesDescription GetServiceDescription() { var serviceDescription = new ServicesDescription(DefaultLocation); return serviceDescription; - } public static ServicesPatchDescription GetServicePatchDescription() { var servicePatchDescription = new ServicesPatchDescription(UpdateTags); return servicePatchDescription; - } public static ServicesDescription GetServiceDescriptionWithProperties() @@ -87,7 +85,6 @@ public static ServicesDescription GetServiceDescriptionWithProperties() public static ServicesProperties GetServiceProperties() { - IList accessPolicies = new List(); accessPolicies.Add(new ServiceAccessPolicyEntry(objectId)); @@ -101,11 +98,6 @@ public static ServicesProperties GetServiceProperties() return serviceProperties; } - public static string GetLocationFromProvider(this ResourceManagementClient resourceManagementClient) - { - return "westus2"; - } - public static void VerifyAccountProperties(ServicesDescription account, bool useDefaults, string location = "westus") { // verifies that the account is actually created @@ -158,11 +150,6 @@ public static ResourceManagementClient GetResourceManagementClient(MockContext c } } - public static string CreateHealthcareApisServicesAccount(HealthcareApisManagementClient healthcareApisManagementClient, string rgname, string kind = null) - { - return TestUtilities.GenerateName("csa"); - } - public static string CreateResourceGroup(ResourceManagementClient resourcesClient) { var rgname = "res7089"; @@ -176,7 +163,6 @@ public static string CreateResourceGroup(ResourceManagementClient resourcesClien Location = DefaultLocation }); } - return rgname; } } diff --git a/src/SDKs/HealthcareApis/HealthcareApis.Tests/Helpers/RecordedDelegatingHandler.cs b/src/SDKs/HealthcareApis/HealthcareApis.Tests/Helpers/RecordedDelegatingHandler.cs index 5fa8485ce0d5d..dc8d149ed1fea 100644 --- a/src/SDKs/HealthcareApis/HealthcareApis.Tests/Helpers/RecordedDelegatingHandler.cs +++ b/src/SDKs/HealthcareApis/HealthcareApis.Tests/Helpers/RecordedDelegatingHandler.cs @@ -20,13 +20,6 @@ public RecordedDelegatingHandler() SubsequentStatusCodeToReturn = StatusCodeToReturn; } - public RecordedDelegatingHandler(HttpResponseMessage response) - { - StatusCodeToReturn = HttpStatusCode.Created; - SubsequentStatusCodeToReturn = StatusCodeToReturn; - _response = response; - } - public HttpStatusCode StatusCodeToReturn { get; set; } public HttpStatusCode SubsequentStatusCodeToReturn { get; set; } diff --git a/src/SDKs/HealthcareApis/HealthcareApis.Tests/SessionRecords/HealthcareApisTests/HealthcareApisListAccountsTest.json b/src/SDKs/HealthcareApis/HealthcareApis.Tests/SessionRecords/HealthcareApisTests/HealthcareApisListAccountsTest.json index 9f7699addbdfc..84c26180b097b 100644 --- a/src/SDKs/HealthcareApis/HealthcareApis.Tests/SessionRecords/HealthcareApisTests/HealthcareApisListAccountsTest.json +++ b/src/SDKs/HealthcareApis/HealthcareApis.Tests/SessionRecords/HealthcareApisTests/HealthcareApisListAccountsTest.json @@ -14,7 +14,7 @@ ], "User-Agent": [ "FxVersion/4.6.25009.03", - "Microsoft.Azure.Management.Billing.BillingManagementClient/1.2.0-preview" + "Microsoft.Azure.Management.HealthcareApis.HealthcareApisManagementClient/1.0.0.0" ] }, "ResponseBody": "{\r\n \"id\": \"/subscriptions/cc148bf2-42fb-4913-a3fb-2f284a69eb89/resourceGroups/res7089\",\r\n \"name\": \"res7089\",\r\n \"location\": \"westus\",\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\"\r\n }\r\n}", diff --git a/src/SDKs/HealthcareApis/HealthcareApis.Tests/Tests/HealthcareApisAccountTests.cs b/src/SDKs/HealthcareApis/HealthcareApis.Tests/Tests/HealthcareApisAccountTests.cs index 49369327d5f17..0ad6d1da32d77 100644 --- a/src/SDKs/HealthcareApis/HealthcareApis.Tests/Tests/HealthcareApisAccountTests.cs +++ b/src/SDKs/HealthcareApis/HealthcareApis.Tests/Tests/HealthcareApisAccountTests.cs @@ -53,7 +53,7 @@ public void HealthcareApisCreateWithParametersTest() // Generate account name string accountName = TestUtilities.GenerateName("hca"); - var serviceDescription = HealthcareApisManagementTestUtilities.GetServiceDescription(); + var serviceDescription = HealthcareApisManagementTestUtilities.GetServiceDescriptionWithProperties(); // Create healthcareApis account var account = healthCareApisMgmtClient.Services.CreateOrUpdate(rgname, accountName, serviceDescription); From 6e8a1e5e274f7097ce2a2ab1297e0666f9aaa19f Mon Sep 17 00:00:00 2001 From: Pooja Adhikari Date: Fri, 28 Jun 2019 22:43:16 -0700 Subject: [PATCH 13/14] Code changes per code review --- .../HealthcareApis.Tests.csproj | 2 +- .../HealthcareApisManagementTestUtilities.cs | 11 + .../Helpers/RecordedDelegatingHandler.cs | 7 + ...areApisListAccountByResourceGroupTest.json | 378 ++++++++++++++++++ .../HealthcareApisListAccountsTest.json | 82 ---- .../Tests/HealthcareApisAccountTests.cs | 20 +- 6 files changed, 413 insertions(+), 87 deletions(-) create mode 100644 src/SDKs/HealthcareApis/HealthcareApis.Tests/SessionRecords/HealthcareApisTests/HealthcareApisListAccountByResourceGroupTest.json delete mode 100644 src/SDKs/HealthcareApis/HealthcareApis.Tests/SessionRecords/HealthcareApisTests/HealthcareApisListAccountsTest.json diff --git a/src/SDKs/HealthcareApis/HealthcareApis.Tests/HealthcareApis.Tests.csproj b/src/SDKs/HealthcareApis/HealthcareApis.Tests/HealthcareApis.Tests.csproj index 2e5b2ca51942a..7a08cc9abd2c4 100644 --- a/src/SDKs/HealthcareApis/HealthcareApis.Tests/HealthcareApis.Tests.csproj +++ b/src/SDKs/HealthcareApis/HealthcareApis.Tests/HealthcareApis.Tests.csproj @@ -56,7 +56,7 @@ Always - + Always diff --git a/src/SDKs/HealthcareApis/HealthcareApis.Tests/Helpers/HealthcareApisManagementTestUtilities.cs b/src/SDKs/HealthcareApis/HealthcareApis.Tests/Helpers/HealthcareApisManagementTestUtilities.cs index ace31a3845c49..ac0ec46ea6c94 100644 --- a/src/SDKs/HealthcareApis/HealthcareApis.Tests/Helpers/HealthcareApisManagementTestUtilities.cs +++ b/src/SDKs/HealthcareApis/HealthcareApis.Tests/Helpers/HealthcareApisManagementTestUtilities.cs @@ -98,6 +98,17 @@ public static ServicesProperties GetServiceProperties() return serviceProperties; } + public static string CreateHealthcareApisAccount(HealthcareApisManagementClient healthcareApisManagementClient, string rgname, string kind = null) + { + // Generate account name + string accountName = TestUtilities.GenerateName("hca"); + + // Create healthcareApis account + var createdAccount = healthcareApisManagementClient.Services.CreateOrUpdate(rgname, accountName, GetServiceDescriptionWithProperties()); + + return accountName; + } + public static void VerifyAccountProperties(ServicesDescription account, bool useDefaults, string location = "westus") { // verifies that the account is actually created diff --git a/src/SDKs/HealthcareApis/HealthcareApis.Tests/Helpers/RecordedDelegatingHandler.cs b/src/SDKs/HealthcareApis/HealthcareApis.Tests/Helpers/RecordedDelegatingHandler.cs index dc8d149ed1fea..5fa8485ce0d5d 100644 --- a/src/SDKs/HealthcareApis/HealthcareApis.Tests/Helpers/RecordedDelegatingHandler.cs +++ b/src/SDKs/HealthcareApis/HealthcareApis.Tests/Helpers/RecordedDelegatingHandler.cs @@ -20,6 +20,13 @@ public RecordedDelegatingHandler() SubsequentStatusCodeToReturn = StatusCodeToReturn; } + public RecordedDelegatingHandler(HttpResponseMessage response) + { + StatusCodeToReturn = HttpStatusCode.Created; + SubsequentStatusCodeToReturn = StatusCodeToReturn; + _response = response; + } + public HttpStatusCode StatusCodeToReturn { get; set; } public HttpStatusCode SubsequentStatusCodeToReturn { get; set; } diff --git a/src/SDKs/HealthcareApis/HealthcareApis.Tests/SessionRecords/HealthcareApisTests/HealthcareApisListAccountByResourceGroupTest.json b/src/SDKs/HealthcareApis/HealthcareApis.Tests/SessionRecords/HealthcareApisTests/HealthcareApisListAccountByResourceGroupTest.json new file mode 100644 index 0000000000000..b769c077447d1 --- /dev/null +++ b/src/SDKs/HealthcareApis/HealthcareApis.Tests/SessionRecords/HealthcareApisTests/HealthcareApisListAccountByResourceGroupTest.json @@ -0,0 +1,378 @@ +{ + "Entries": [ + { + "RequestUri": "/subscriptions/cc148bf2-42fb-4913-a3fb-2f284a69eb89/resourcegroups/res7089?api-version=2018-08-20-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvY2MxNDhiZjItNDJmYi00OTEzLWEzZmItMmYyODRhNjllYjg5L3Jlc291cmNlZ3JvdXBzL3JlczcwODk/YXBpLXZlcnNpb249MjAxOC0wOC0yMC1wcmV2aWV3", + "RequestMethod": "PUT", + "RequestBody": "{\r\n \"location\": \"westus\"\r\n}", + "RequestHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Content-Length": [ + "28" + ], + "x-ms-client-request-id": [ + "89e61421-87a0-4d25-b6a1-946a8f9df00b" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.25211.01", + "Microsoft.Azure.Management.ResourceManager.ResourceManagementClient/1.6.0.0" + ] + }, + "ResponseBody": "{\r\n \"id\": \"/subscriptions/cc148bf2-42fb-4913-a3fb-2f284a69eb89/resourceGroups/res7089\",\r\n \"name\": \"hca1234\",\r\n \"location\": \"westus\",\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\"\r\n }\r\n}", + "ResponseHeaders": { + "Content-Length": [ + "167" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Fri, 09 Mar 2018 08:09:16 GMT" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-ratelimit-remaining-subscription-writes": [ + "1181" + ], + "x-ms-request-id": [ + "d55f54ca-0ad2-4798-9741-a96462bd1cb8" + ], + "x-ms-correlation-request-id": [ + "9e622289-028e-44a3-bbcd-904ae16adbd3" + ], + "x-ms-routing-request-id": [ + "WESTUS:20190618T153235Z:d55f54ca-0ad2-4798-9741-a96462bd1cb8" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ] + }, + "StatusCode": 201 + }, + { + "RequestUri": "/subscriptions/cc148bf2-42fb-4913-a3fb-2f284a69eb89/resourceGroups/res7089/providers/Microsoft.HealthcareApis/services?api-version=2018-08-20-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvY2MxNDhiZjItNDJmYi00OTEzLWEzZmItMmYyODRhNjllYjg5L3Jlc291cmNlR3JvdXBzL3JlczcwODkvcHJvdmlkZXJzL01pY3Jvc29mdC5IZWFsdGhjYXJlQXBpcy9zZXJ2aWNlcz9hcGktdmVyc2lvbj0yMDE4LTA4LTIwLXByZXZpZXc=", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "65c39c9c-dcfd-47d3-a5ea-a98bfd4989bb" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.25211.01", + "Microsoft.Azure.Management.HealthcareApis.HealthcareApisManagementClient/3.0.0.0" + ] + }, + "ResponseBody": "{\r\n \"value\": []\r\n}", + "ResponseHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Fri, 09 Mar 2018 07:49:29 GMT" + ], + "Pragma": [ + "no-cache" + ], + "Transfer-Encoding": [ + "chunked" + ], + "ETag": [ + "\"0a00bcf7-0000-0000-0000-5aa23c880000\"" + ], + "Server": [ + "Microsoft-IIS/10.0" + ], + "Vary": [ + "Accept-Encoding" + ], + "x-ms-request-id": [ + "4697a59a-84eb-4e5c-967e-085b2a555af8" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-AspNet-Version": [ + "4.0.30319" + ], + "X-Powered-By": [ + "ASP.NET" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14953" + ], + "x-ms-correlation-request-id": [ + "122819a6-98f9-4c61-b68c-c06a134c084f" + ], + "x-ms-routing-request-id": [ + "JAPANWEST:20180309T074930Z:122819a6-98f9-4c61-b68c-c06a134c084f" + ], + "X-Content-Type-Options": [ + "nosniff" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/cc148bf2-42fb-4913-a3fb-2f284a69eb89/resourceGroups/res7089/providers/Microsoft.HealthcareApis/services/hca1235?api-version=2018-08-20-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvY2MxNDhiZjItNDJmYi00OTEzLWEzZmItMmYyODRhNjllYjg5L3Jlc291cmNlR3JvdXBzL3JlczcwODkvcHJvdmlkZXJzL01pY3Jvc29mdC5IZWFsdGhjYXJlQXBpcy9zZXJ2aWNlcy9oY2ExMjM1P2FwaS12ZXJzaW9uPTIwMTgtMDgtMjAtcHJldmlldw==", + "RequestMethod": "PUT", + "RequestBody": "{\r\n \"name\": \"S1\"\r\n ,\r\n \"location\": \"westus\",\r\n \"properties\": {}\r\n}", + "RequestHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Content-Length": [ + "113" + ], + "x-ms-client-request-id": [ + "39bce3ac-f86e-490f-92d3-260643c3a770" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.25211.01", + "Microsoft.Azure.Management.HealthcareApis.HealthcareApisManagementClient/1.0.0.0" + ] + }, + "ResponseBody": "{\r\n \"id\": \"/subscriptions/cc148bf2-42fb-4913-a3fb-2f284a69eb89/resourceGroups/res7089/providers/Microsoft.HealthcareApis/accounts/hca1235\",\r\n \"name\": \"hca1234\",\r\n \"type\": \"Microsoft.HealthcareApis/accounts\",\r\n \"etag\": \"\\\"0a002ee3-0000-0000-0000-5aa238d80000\\\"\",\r\n \"location\": \"westus\",\r\n \"name\": \"S1\"\r\n ,\r\n \"kind\": \"Fhir\",\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\"\r\n }\r\n}", + "ResponseHeaders": { + "Content-Length": [ + "570" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Fri, 09 Mar 2018 07:33:44 GMT" + ], + "Pragma": [ + "no-cache" + ], + "ETag": [ + "\"0a002ee3-0000-0000-0000-5aa238d80000\"" + ], + "Server": [ + "Microsoft-IIS/10.0" + ], + "x-ms-request-id": [ + "2263b931-e233-4217-bfba-448ee3ac8346" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-AspNet-Version": [ + "4.0.30319" + ], + "X-Powered-By": [ + "ASP.NET" + ], + "x-ms-ratelimit-remaining-subscription-writes": [ + "1196" + ], + "x-ms-correlation-request-id": [ + "977d2f5c-4af0-4c2e-8068-6de427d796c0" + ], + "x-ms-routing-request-id": [ + "WESTUS:20180309T073344Z:977d2f5c-4af0-4c2e-8068-6de427d796c0" + ], + "X-Content-Type-Options": [ + "nosniff" + ] + }, + "StatusCode": 201 + }, + { + "RequestUri": "/subscriptions/cc148bf2-42fb-4913-a3fb-2f284a69eb89/resourceGroups/res7089/providers/Microsoft.HealthcareApis/services/hca1235?api-version=2018-08-20-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvY2MxNDhiZjItNDJmYi00OTEzLWEzZmItMmYyODRhNjllYjg5L3Jlc291cmNlR3JvdXBzL3JlczcwODkvcHJvdmlkZXJzL01pY3Jvc29mdC5IZWFsdGhjYXJlQXBpcy9zZXJ2aWNlcy9oY2ExMjM0P2FwaS12ZXJzaW9uPTIwMTgtMDgtMjAtcHJldmlldw==", + "RequestMethod": "PUT", + "RequestBody": "{\r\n \"name\": \"S1\"\r\n ,\r\n \"location\": \"westus\",\r\n \"properties\": {}\r\n}", + "RequestHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Content-Length": [ + "113" + ], + "x-ms-client-request-id": [ + "39bce3ac-f86e-490f-92d3-260643c3a770" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.25211.01", + "Microsoft.Azure.Management.HealthcareApis.HealthcareApisManagementClient/1.0.0.0" + ] + }, + "ResponseBody": "{\r\n \"id\": \"/subscriptions/cc148bf2-42fb-4913-a3fb-2f284a69eb89/resourceGroups/res7089/providers/Microsoft.HealthcareApis/accounts/hca1235\",\r\n \"name\": \"hca1234\",\r\n \"type\": \"Microsoft.HealthcareApis/accounts\",\r\n \"etag\": \"\\\"0a002ee3-0000-0000-0000-5aa238d80000\\\"\",\r\n \"location\": \"westus\",\r\n \"name\": \"S1\"\r\n ,\r\n \"kind\": \"Fhir\",\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\"\r\n }\r\n}", + "ResponseHeaders": { + "Content-Length": [ + "570" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Fri, 09 Mar 2018 07:33:44 GMT" + ], + "Pragma": [ + "no-cache" + ], + "ETag": [ + "\"0a002ee3-0000-0000-0000-5aa238d80000\"" + ], + "Server": [ + "Microsoft-IIS/10.0" + ], + "x-ms-request-id": [ + "2263b931-e233-4217-bfba-448ee3ac8346" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-AspNet-Version": [ + "4.0.30319" + ], + "X-Powered-By": [ + "ASP.NET" + ], + "x-ms-ratelimit-remaining-subscription-writes": [ + "1196" + ], + "x-ms-correlation-request-id": [ + "977d2f5c-4af0-4c2e-8068-6de427d796c0" + ], + "x-ms-routing-request-id": [ + "WESTUS:20180309T073344Z:977d2f5c-4af0-4c2e-8068-6de427d796c0" + ], + "X-Content-Type-Options": [ + "nosniff" + ] + }, + "StatusCode": 201 + }, + { + "RequestUri": "/subscriptions/cc148bf2-42fb-4913-a3fb-2f284a69eb89/resourceGroups/res7089/providers/Microsoft.HealthcareApis/services?api-version=2018-08-20-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvY2MxNDhiZjItNDJmYi00OTEzLWEzZmItMmYyODRhNjllYjg5L3Jlc291cmNlR3JvdXBzL3JlczcwODkvcHJvdmlkZXJzL01pY3Jvc29mdC5IZWFsdGhjYXJlQXBpcy9zZXJ2aWNlcz9hcGktdmVyc2lvbj0yMDE4LTA4LTIwLXByZXZpZXc=", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "65c39c9c-dcfd-47d3-a5ea-a98bfd4989bb" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.25211.01", + "Microsoft.Azure.Management.HealthcareApis.HealthcareApisManagementClient/3.0.0.0" + ] + }, + "ResponseBody": "{\r\n \"value\": [\r\n {\r\n \"id\": \"/subscriptions/cc148bf2-42fb-4913-a3fb-2f284a69eb89/resourceGroups/res7089/providers/Microsoft.HealthcareApus/services/hcs1234\",\r\n \"name\": \"hca1234\",\"etag\": \"0a002ee3-0000-0000-0000-5aa238d80000\",\r\n \"type\": \"Microsoft.HealthcareApis/services\",\r\n \"location\": \"westus\",\r\n \"sku\": {\r\n \"name\": \"S1\"\r\n },\r\n \"kind\": \"Fhir\",\r\n \"tags\": {\r\n \"key1\": \"value1\",\r\n \"key2\": \"value2\"\r\n },\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\"}\r\n },\r\n {\r\n \"id\": \"/subscriptions/cc148bf2-42fb-4913-a3fb-2f284a69eb89/resourceGroups/res7089/providers/Microsoft.HealthcareApis/services/hca1235\",\r\n \"name\": \"hca1235\",\r\n \"type\": \"Microsoft.HealthcareApis/services\",\r\n \"location\": \"westus\",\r\n \"name\": \"S1\"\r\n ,\r\n \"kind\": \"Fhir\",\"etag\": \"0a002ee3-0000-0000-0000-5aa238d800\",\r\n \"tags\": {\r\n \"key1\": \"value1\",\r\n \"key2\": \"value2\"\r\n },\r\n \"etag\": \"W/\\\"datetime'2017-05-26T11%3A20%3A39.9949008Z'\\\"\",\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\"}\r\n }\r\n ]\r\n}", + "ResponseHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Fri, 09 Mar 2018 07:49:29 GMT" + ], + "Pragma": [ + "no-cache" + ], + "Transfer-Encoding": [ + "chunked" + ], + "ETag": [ + "\"0a00bcf7-0000-0000-0000-5aa23c880000\"" + ], + "Server": [ + "Microsoft-IIS/10.0" + ], + "Vary": [ + "Accept-Encoding" + ], + "x-ms-request-id": [ + "4697a59a-84eb-4e5c-967e-085b2a555af8" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-AspNet-Version": [ + "4.0.30319" + ], + "X-Powered-By": [ + "ASP.NET" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14953" + ], + "x-ms-correlation-request-id": [ + "122819a6-98f9-4c61-b68c-c06a134c084f" + ], + "x-ms-routing-request-id": [ + "JAPANWEST:20180309T074930Z:122819a6-98f9-4c61-b68c-c06a134c084f" + ], + "X-Content-Type-Options": [ + "nosniff" + ] + }, + "StatusCode": 200 + } + ], + "Names": { + "CreateResourceGroup": [ + "res7089" + ], + "CreateHealthcareApisAccount": [ + "hca1234", + "hca1235" + ] + }, + "Variables": { + "SubscriptionId": "cc148bf2-42fb-4913-a3fb-2f284a69eb89" + } +} diff --git a/src/SDKs/HealthcareApis/HealthcareApis.Tests/SessionRecords/HealthcareApisTests/HealthcareApisListAccountsTest.json b/src/SDKs/HealthcareApis/HealthcareApis.Tests/SessionRecords/HealthcareApisTests/HealthcareApisListAccountsTest.json deleted file mode 100644 index 84c26180b097b..0000000000000 --- a/src/SDKs/HealthcareApis/HealthcareApis.Tests/SessionRecords/HealthcareApisTests/HealthcareApisListAccountsTest.json +++ /dev/null @@ -1,82 +0,0 @@ -{ - "Entries": [ - { - "RequestUri": "/subscriptions/cc148bf2-42fb-4913-a3fb-2f284a69eb89/resourceGroups/res7089/providers/Microsoft.HealthcareApis/services?api-version=2018-08-20-preview", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvY2MxNDhiZjItNDJmYi00OTEzLWEzZmItMmYyODRhNjllYjg5L3Jlc291cmNlR3JvdXBzL3JlczcwODkvcHJvdmlkZXJzL01pY3Jvc29mdC5IZWFsdGhjYXJlQXBpcy9zZXJ2aWNlcz9hcGktdmVyc2lvbj0yMDE4LTA4LTIwLXByZXZpZXc=", - "RequestMethod": "GET", - "RequestBody": "", - "RequestHeaders": { - "x-ms-client-request-id": [ - "74fad5d2-1e3c-4e30-a0b3-fcf319969fe0" - ], - "accept-language": [ - "en-US" - ], - "User-Agent": [ - "FxVersion/4.6.25009.03", - "Microsoft.Azure.Management.HealthcareApis.HealthcareApisManagementClient/1.0.0.0" - ] - }, - "ResponseBody": "{\r\n \"id\": \"/subscriptions/cc148bf2-42fb-4913-a3fb-2f284a69eb89/resourceGroups/res7089\",\r\n \"name\": \"res7089\",\r\n \"location\": \"westus\",\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\"\r\n }\r\n}", - "ResponseHeaders": { - "Content-Type": [ - "application/json; charset=utf-8" - ], - "Expires": [ - "-1" - ], - "Cache-Control": [ - "no-cache" - ], - "Date": [ - "Thu, 20 Apr 2017 22:30:15 GMT" - ], - "Pragma": [ - "no-cache" - ], - "Transfer-Encoding": [ - "chunked" - ], - "Server": [ - "Microsoft-IIS/8.5" - ], - "Vary": [ - "Accept-Encoding" - ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains" - ], - "X-AspNet-Version": [ - "4.0.30319" - ], - "X-Powered-By": [ - "ASP.NET" - ], - "x-ms-ratelimit-remaining-tenant-reads": [ - "14993" - ], - "x-ms-request-id": [ - "5f1230a7-ea50-4e3a-80da-9123164fa07c" - ], - "x-ms-correlation-request-id": [ - "5f1230a7-ea50-4e3a-80da-9123164fa07c" - ], - "x-ms-routing-request-id": [ - "CENTRALUS:20170420T223015Z:5f1230a7-ea50-4e3a-80da-9123164fa07c" - ] - }, - "StatusCode": 200 - } - ], - "Names": { - "CreateResourceGroup": [ - "res7089" - ], - "HealthcareApisCreateTest": [ - "hca1234" - ] - }, - "Variables": { - "SubscriptionId": "cc148bf2-42fb-4913-a3fb-2f284a69eb89" - } -} \ No newline at end of file diff --git a/src/SDKs/HealthcareApis/HealthcareApis.Tests/Tests/HealthcareApisAccountTests.cs b/src/SDKs/HealthcareApis/HealthcareApis.Tests/Tests/HealthcareApisAccountTests.cs index 0ad6d1da32d77..ca84bbf5d3fb3 100644 --- a/src/SDKs/HealthcareApis/HealthcareApis.Tests/Tests/HealthcareApisAccountTests.cs +++ b/src/SDKs/HealthcareApis/HealthcareApis.Tests/Tests/HealthcareApisAccountTests.cs @@ -5,6 +5,7 @@ using Microsoft.Azure.Management.HealthcareApis; using Microsoft.Azure.Management.HealthcareApis.Models; using Microsoft.Rest.ClientRuntime.Azure.TestFramework; +using System.Linq; using System.Net; using Xunit; @@ -104,7 +105,7 @@ public void HealthcareApisAccountUpdateWithCreateTest() var serviceDescription = HealthcareApisManagementTestUtilities.GetServiceDescription(); - //// Create healthcareApis account + // Create healthcareApis account var createdAccount = healthCareApisMgmtClient.Services.CreateOrUpdate(rgname, accountName, serviceDescription); var servicePatchDescription = HealthcareApisManagementTestUtilities.GetServicePatchDescription(); @@ -128,7 +129,7 @@ public void HealthcareApisAccountUpdateWithCreateTest() } [Fact] - public void HealthcareApisListAccountsTest() + public void HealthcareApisListAccountByResourceGroupTest() { var handler = new RecordedDelegatingHandler { StatusCodeToReturn = HttpStatusCode.OK }; @@ -140,8 +141,19 @@ public void HealthcareApisListAccountsTest() // Create resource group var rgname = HealthcareApisManagementTestUtilities.CreateResourceGroup(resourcesClient); - var serviceAccountsLists = healthCareApisMgmtClient.Services.ListByResourceGroupWithHttpMessagesAsync(rgname); - Assert.NotNull(serviceAccountsLists); + var accounts = healthCareApisMgmtClient.Services.ListByResourceGroup(rgname); + + Assert.Empty(accounts); + + string accountName1 = HealthcareApisManagementTestUtilities.CreateHealthcareApisAccount(healthCareApisMgmtClient, rgname); + string accountName2 = HealthcareApisManagementTestUtilities.CreateHealthcareApisAccount(healthCareApisMgmtClient, rgname); + + accounts = healthCareApisMgmtClient.Services.ListByResourceGroup(rgname); + + Assert.Equal(2, accounts.Count()); + + HealthcareApisManagementTestUtilities.VerifyAccountProperties(accounts.First(), true); + HealthcareApisManagementTestUtilities.VerifyAccountProperties(accounts.Skip(1).First(), true); } } From 9790eb99ad6732b7716648b5688601741bf3ce2b Mon Sep 17 00:00:00 2001 From: Pooja Adhikari Date: Mon, 1 Jul 2019 09:26:05 -0700 Subject: [PATCH 14/14] Added mised changes suggested in Code Review --- .../Helpers/RecordedDelegatingHandler.cs | 7 ------- src/SDKs/_metadata/HealthcareApis.txt | 14 -------------- 2 files changed, 21 deletions(-) delete mode 100644 src/SDKs/_metadata/HealthcareApis.txt diff --git a/src/SDKs/HealthcareApis/HealthcareApis.Tests/Helpers/RecordedDelegatingHandler.cs b/src/SDKs/HealthcareApis/HealthcareApis.Tests/Helpers/RecordedDelegatingHandler.cs index 5fa8485ce0d5d..dc8d149ed1fea 100644 --- a/src/SDKs/HealthcareApis/HealthcareApis.Tests/Helpers/RecordedDelegatingHandler.cs +++ b/src/SDKs/HealthcareApis/HealthcareApis.Tests/Helpers/RecordedDelegatingHandler.cs @@ -20,13 +20,6 @@ public RecordedDelegatingHandler() SubsequentStatusCodeToReturn = StatusCodeToReturn; } - public RecordedDelegatingHandler(HttpResponseMessage response) - { - StatusCodeToReturn = HttpStatusCode.Created; - SubsequentStatusCodeToReturn = StatusCodeToReturn; - _response = response; - } - public HttpStatusCode StatusCodeToReturn { get; set; } public HttpStatusCode SubsequentStatusCodeToReturn { get; set; } diff --git a/src/SDKs/_metadata/HealthcareApis.txt b/src/SDKs/_metadata/HealthcareApis.txt deleted file mode 100644 index 04026deaba9e7..0000000000000 --- a/src/SDKs/_metadata/HealthcareApis.txt +++ /dev/null @@ -1,14 +0,0 @@ -Installing AutoRest version: latest -AutoRest installed successfully. -Commencing code generation -Generating CSharp code -Executing AutoRest command -cmd.exe /c autorest.cmd https://github.com/Azure/azure-rest-api-specs/blob/master/specification/HealthcareApis/readme.md --csharp --version=latest --reflect-api-versions --csharp-sdks-folder=C:\Repo\SDK\src\SDKs -2019-06-24 20:36:41 UTC -Azure-rest-api-specs repository information -GitHub fork: Azure -Branch: master -Commit: 3d442829ee4098d1981e53ad56ac96ae9d3ed812 -AutoRest information -Requested version: latest -Bootstrapper version: autorest@2.0.4283