From e18e1ef11ddb302d927f362bed53be477bee83d3 Mon Sep 17 00:00:00 2001 From: Tanyi Chen Date: Mon, 19 Oct 2020 15:38:02 +0800 Subject: [PATCH] Mgmt: generate healthcareapis (#16504) * generate healthcareapis * fix compile error --- sdk/healthcareapis/mgmt-v2020_03_30/pom.xml | 135 ++ .../v2020_03_30/AzureEntityResource.java | 34 + .../CheckNameAvailabilityParameters.java | 69 + .../v2020_03_30/ErrorDetailsInternal.java | 62 + .../healthcareapis/v2020_03_30/Kind.java | 56 + .../ManagedServiceIdentityType.java | 41 + .../healthcareapis/v2020_03_30/Operation.java | 35 + .../v2020_03_30/OperationDisplay.java | 77 ++ .../v2020_03_30/OperationResultStatus.java | 50 + .../v2020_03_30/OperationResults.java | 29 + .../v2020_03_30/Operations.java | 27 + .../v2020_03_30/PrivateEndpoint.java | 32 + .../PrivateEndpointConnection.java | 163 +++ ...teEndpointConnectionProvisioningState.java | 47 + .../PrivateEndpointConnections.java | 53 + ...rivateEndpointServiceConnectionStatus.java | 44 + .../v2020_03_30/PrivateLinkResource.java | 53 + .../PrivateLinkResourceListResult.java | 27 + .../v2020_03_30/PrivateLinkResources.java | 40 + .../PrivateLinkServiceConnectionState.java | 99 ++ .../v2020_03_30/ProvisioningState.java | 62 + .../v2020_03_30/PublicNetworkAccess.java | 41 + .../v2020_03_30/ServiceAccessPolicyEntry.java | 44 + ...erviceAuthenticationConfigurationInfo.java | 95 ++ .../ServiceCorsConfigurationInfo.java | 148 ++ .../ServiceCosmosDbConfigurationInfo.java | 69 + .../ServiceExportConfigurationInfo.java | 43 + .../ServiceNameUnavailabilityReason.java | 53 + .../healthcareapis/v2020_03_30/Services.java | 34 + .../v2020_03_30/ServicesDescription.java | 148 ++ .../ServicesNameAvailabilityInfo.java | 35 + .../v2020_03_30/ServicesPatchDescription.java | 74 + .../v2020_03_30/ServicesProperties.java | 221 +++ .../v2020_03_30/ServicesResource.java | 99 ++ .../v2020_03_30/ServicesResourceIdentity.java | 75 + .../implementation/ErrorDetailsInner.java | 44 + .../ErrorDetailsInnerException.java | 44 + .../HealthcareApisManagementClientImpl.java | 252 ++++ .../implementation/HealthcareApisManager.java | 147 ++ .../implementation/IdParsingUtils.java | 57 + .../implementation/OperationImpl.java | 42 + .../implementation/OperationInner.java | 74 + .../OperationResultsDescriptionInner.java | 105 ++ .../implementation/OperationResultsImpl.java | 35 + .../implementation/OperationResultsInner.java | 146 ++ .../implementation/OperationsImpl.java | 49 + .../implementation/OperationsInner.java | 282 ++++ .../v2020_03_30/implementation/PageImpl.java | 75 + .../v2020_03_30/implementation/PageImpl1.java | 75 + .../PrivateEndpointConnectionImpl.java | 130 ++ .../PrivateEndpointConnectionInner.java | 103 ++ .../PrivateEndpointConnectionsImpl.java | 85 ++ .../PrivateEndpointConnectionsInner.java | 622 +++++++++ .../PrivateLinkResourceImpl.java | 74 + .../PrivateLinkResourceInner.java | 77 ++ .../PrivateLinkResourceListResultImpl.java | 32 + .../PrivateLinkResourceListResultInner.java | 44 + .../PrivateLinkResourcesImpl.java | 63 + .../PrivateLinkResourcesInner.java | 242 ++++ .../ServicesDescriptionImpl.java | 121 ++ .../ServicesDescriptionInner.java | 45 + .../implementation/ServicesImpl.java | 152 ++ .../implementation/ServicesInner.java | 1227 +++++++++++++++++ .../ServicesNameAvailabilityInfoImpl.java | 42 + .../ServicesNameAvailabilityInfoInner.java | 75 + .../implementation/package-info.java | 11 + .../v2020_03_30/package-info.java | 11 + sdk/healthcareapis/pom.mgmt.xml | 1 + 68 files changed, 6998 insertions(+) create mode 100644 sdk/healthcareapis/mgmt-v2020_03_30/pom.xml create mode 100644 sdk/healthcareapis/mgmt-v2020_03_30/src/main/java/com/microsoft/azure/management/healthcareapis/v2020_03_30/AzureEntityResource.java create mode 100644 sdk/healthcareapis/mgmt-v2020_03_30/src/main/java/com/microsoft/azure/management/healthcareapis/v2020_03_30/CheckNameAvailabilityParameters.java create mode 100644 sdk/healthcareapis/mgmt-v2020_03_30/src/main/java/com/microsoft/azure/management/healthcareapis/v2020_03_30/ErrorDetailsInternal.java create mode 100644 sdk/healthcareapis/mgmt-v2020_03_30/src/main/java/com/microsoft/azure/management/healthcareapis/v2020_03_30/Kind.java create mode 100644 sdk/healthcareapis/mgmt-v2020_03_30/src/main/java/com/microsoft/azure/management/healthcareapis/v2020_03_30/ManagedServiceIdentityType.java create mode 100644 sdk/healthcareapis/mgmt-v2020_03_30/src/main/java/com/microsoft/azure/management/healthcareapis/v2020_03_30/Operation.java create mode 100644 sdk/healthcareapis/mgmt-v2020_03_30/src/main/java/com/microsoft/azure/management/healthcareapis/v2020_03_30/OperationDisplay.java create mode 100644 sdk/healthcareapis/mgmt-v2020_03_30/src/main/java/com/microsoft/azure/management/healthcareapis/v2020_03_30/OperationResultStatus.java create mode 100644 sdk/healthcareapis/mgmt-v2020_03_30/src/main/java/com/microsoft/azure/management/healthcareapis/v2020_03_30/OperationResults.java create mode 100644 sdk/healthcareapis/mgmt-v2020_03_30/src/main/java/com/microsoft/azure/management/healthcareapis/v2020_03_30/Operations.java create mode 100644 sdk/healthcareapis/mgmt-v2020_03_30/src/main/java/com/microsoft/azure/management/healthcareapis/v2020_03_30/PrivateEndpoint.java create mode 100644 sdk/healthcareapis/mgmt-v2020_03_30/src/main/java/com/microsoft/azure/management/healthcareapis/v2020_03_30/PrivateEndpointConnection.java create mode 100644 sdk/healthcareapis/mgmt-v2020_03_30/src/main/java/com/microsoft/azure/management/healthcareapis/v2020_03_30/PrivateEndpointConnectionProvisioningState.java create mode 100644 sdk/healthcareapis/mgmt-v2020_03_30/src/main/java/com/microsoft/azure/management/healthcareapis/v2020_03_30/PrivateEndpointConnections.java create mode 100644 sdk/healthcareapis/mgmt-v2020_03_30/src/main/java/com/microsoft/azure/management/healthcareapis/v2020_03_30/PrivateEndpointServiceConnectionStatus.java create mode 100644 sdk/healthcareapis/mgmt-v2020_03_30/src/main/java/com/microsoft/azure/management/healthcareapis/v2020_03_30/PrivateLinkResource.java create mode 100644 sdk/healthcareapis/mgmt-v2020_03_30/src/main/java/com/microsoft/azure/management/healthcareapis/v2020_03_30/PrivateLinkResourceListResult.java create mode 100644 sdk/healthcareapis/mgmt-v2020_03_30/src/main/java/com/microsoft/azure/management/healthcareapis/v2020_03_30/PrivateLinkResources.java create mode 100644 sdk/healthcareapis/mgmt-v2020_03_30/src/main/java/com/microsoft/azure/management/healthcareapis/v2020_03_30/PrivateLinkServiceConnectionState.java create mode 100644 sdk/healthcareapis/mgmt-v2020_03_30/src/main/java/com/microsoft/azure/management/healthcareapis/v2020_03_30/ProvisioningState.java create mode 100644 sdk/healthcareapis/mgmt-v2020_03_30/src/main/java/com/microsoft/azure/management/healthcareapis/v2020_03_30/PublicNetworkAccess.java create mode 100644 sdk/healthcareapis/mgmt-v2020_03_30/src/main/java/com/microsoft/azure/management/healthcareapis/v2020_03_30/ServiceAccessPolicyEntry.java create mode 100644 sdk/healthcareapis/mgmt-v2020_03_30/src/main/java/com/microsoft/azure/management/healthcareapis/v2020_03_30/ServiceAuthenticationConfigurationInfo.java create mode 100644 sdk/healthcareapis/mgmt-v2020_03_30/src/main/java/com/microsoft/azure/management/healthcareapis/v2020_03_30/ServiceCorsConfigurationInfo.java create mode 100644 sdk/healthcareapis/mgmt-v2020_03_30/src/main/java/com/microsoft/azure/management/healthcareapis/v2020_03_30/ServiceCosmosDbConfigurationInfo.java create mode 100644 sdk/healthcareapis/mgmt-v2020_03_30/src/main/java/com/microsoft/azure/management/healthcareapis/v2020_03_30/ServiceExportConfigurationInfo.java create mode 100644 sdk/healthcareapis/mgmt-v2020_03_30/src/main/java/com/microsoft/azure/management/healthcareapis/v2020_03_30/ServiceNameUnavailabilityReason.java create mode 100644 sdk/healthcareapis/mgmt-v2020_03_30/src/main/java/com/microsoft/azure/management/healthcareapis/v2020_03_30/Services.java create mode 100644 sdk/healthcareapis/mgmt-v2020_03_30/src/main/java/com/microsoft/azure/management/healthcareapis/v2020_03_30/ServicesDescription.java create mode 100644 sdk/healthcareapis/mgmt-v2020_03_30/src/main/java/com/microsoft/azure/management/healthcareapis/v2020_03_30/ServicesNameAvailabilityInfo.java create mode 100644 sdk/healthcareapis/mgmt-v2020_03_30/src/main/java/com/microsoft/azure/management/healthcareapis/v2020_03_30/ServicesPatchDescription.java create mode 100644 sdk/healthcareapis/mgmt-v2020_03_30/src/main/java/com/microsoft/azure/management/healthcareapis/v2020_03_30/ServicesProperties.java create mode 100644 sdk/healthcareapis/mgmt-v2020_03_30/src/main/java/com/microsoft/azure/management/healthcareapis/v2020_03_30/ServicesResource.java create mode 100644 sdk/healthcareapis/mgmt-v2020_03_30/src/main/java/com/microsoft/azure/management/healthcareapis/v2020_03_30/ServicesResourceIdentity.java create mode 100644 sdk/healthcareapis/mgmt-v2020_03_30/src/main/java/com/microsoft/azure/management/healthcareapis/v2020_03_30/implementation/ErrorDetailsInner.java create mode 100644 sdk/healthcareapis/mgmt-v2020_03_30/src/main/java/com/microsoft/azure/management/healthcareapis/v2020_03_30/implementation/ErrorDetailsInnerException.java create mode 100644 sdk/healthcareapis/mgmt-v2020_03_30/src/main/java/com/microsoft/azure/management/healthcareapis/v2020_03_30/implementation/HealthcareApisManagementClientImpl.java create mode 100644 sdk/healthcareapis/mgmt-v2020_03_30/src/main/java/com/microsoft/azure/management/healthcareapis/v2020_03_30/implementation/HealthcareApisManager.java create mode 100644 sdk/healthcareapis/mgmt-v2020_03_30/src/main/java/com/microsoft/azure/management/healthcareapis/v2020_03_30/implementation/IdParsingUtils.java create mode 100644 sdk/healthcareapis/mgmt-v2020_03_30/src/main/java/com/microsoft/azure/management/healthcareapis/v2020_03_30/implementation/OperationImpl.java create mode 100644 sdk/healthcareapis/mgmt-v2020_03_30/src/main/java/com/microsoft/azure/management/healthcareapis/v2020_03_30/implementation/OperationInner.java create mode 100644 sdk/healthcareapis/mgmt-v2020_03_30/src/main/java/com/microsoft/azure/management/healthcareapis/v2020_03_30/implementation/OperationResultsDescriptionInner.java create mode 100644 sdk/healthcareapis/mgmt-v2020_03_30/src/main/java/com/microsoft/azure/management/healthcareapis/v2020_03_30/implementation/OperationResultsImpl.java create mode 100644 sdk/healthcareapis/mgmt-v2020_03_30/src/main/java/com/microsoft/azure/management/healthcareapis/v2020_03_30/implementation/OperationResultsInner.java create mode 100644 sdk/healthcareapis/mgmt-v2020_03_30/src/main/java/com/microsoft/azure/management/healthcareapis/v2020_03_30/implementation/OperationsImpl.java create mode 100644 sdk/healthcareapis/mgmt-v2020_03_30/src/main/java/com/microsoft/azure/management/healthcareapis/v2020_03_30/implementation/OperationsInner.java create mode 100644 sdk/healthcareapis/mgmt-v2020_03_30/src/main/java/com/microsoft/azure/management/healthcareapis/v2020_03_30/implementation/PageImpl.java create mode 100644 sdk/healthcareapis/mgmt-v2020_03_30/src/main/java/com/microsoft/azure/management/healthcareapis/v2020_03_30/implementation/PageImpl1.java create mode 100644 sdk/healthcareapis/mgmt-v2020_03_30/src/main/java/com/microsoft/azure/management/healthcareapis/v2020_03_30/implementation/PrivateEndpointConnectionImpl.java create mode 100644 sdk/healthcareapis/mgmt-v2020_03_30/src/main/java/com/microsoft/azure/management/healthcareapis/v2020_03_30/implementation/PrivateEndpointConnectionInner.java create mode 100644 sdk/healthcareapis/mgmt-v2020_03_30/src/main/java/com/microsoft/azure/management/healthcareapis/v2020_03_30/implementation/PrivateEndpointConnectionsImpl.java create mode 100644 sdk/healthcareapis/mgmt-v2020_03_30/src/main/java/com/microsoft/azure/management/healthcareapis/v2020_03_30/implementation/PrivateEndpointConnectionsInner.java create mode 100644 sdk/healthcareapis/mgmt-v2020_03_30/src/main/java/com/microsoft/azure/management/healthcareapis/v2020_03_30/implementation/PrivateLinkResourceImpl.java create mode 100644 sdk/healthcareapis/mgmt-v2020_03_30/src/main/java/com/microsoft/azure/management/healthcareapis/v2020_03_30/implementation/PrivateLinkResourceInner.java create mode 100644 sdk/healthcareapis/mgmt-v2020_03_30/src/main/java/com/microsoft/azure/management/healthcareapis/v2020_03_30/implementation/PrivateLinkResourceListResultImpl.java create mode 100644 sdk/healthcareapis/mgmt-v2020_03_30/src/main/java/com/microsoft/azure/management/healthcareapis/v2020_03_30/implementation/PrivateLinkResourceListResultInner.java create mode 100644 sdk/healthcareapis/mgmt-v2020_03_30/src/main/java/com/microsoft/azure/management/healthcareapis/v2020_03_30/implementation/PrivateLinkResourcesImpl.java create mode 100644 sdk/healthcareapis/mgmt-v2020_03_30/src/main/java/com/microsoft/azure/management/healthcareapis/v2020_03_30/implementation/PrivateLinkResourcesInner.java create mode 100644 sdk/healthcareapis/mgmt-v2020_03_30/src/main/java/com/microsoft/azure/management/healthcareapis/v2020_03_30/implementation/ServicesDescriptionImpl.java create mode 100644 sdk/healthcareapis/mgmt-v2020_03_30/src/main/java/com/microsoft/azure/management/healthcareapis/v2020_03_30/implementation/ServicesDescriptionInner.java create mode 100644 sdk/healthcareapis/mgmt-v2020_03_30/src/main/java/com/microsoft/azure/management/healthcareapis/v2020_03_30/implementation/ServicesImpl.java create mode 100644 sdk/healthcareapis/mgmt-v2020_03_30/src/main/java/com/microsoft/azure/management/healthcareapis/v2020_03_30/implementation/ServicesInner.java create mode 100644 sdk/healthcareapis/mgmt-v2020_03_30/src/main/java/com/microsoft/azure/management/healthcareapis/v2020_03_30/implementation/ServicesNameAvailabilityInfoImpl.java create mode 100644 sdk/healthcareapis/mgmt-v2020_03_30/src/main/java/com/microsoft/azure/management/healthcareapis/v2020_03_30/implementation/ServicesNameAvailabilityInfoInner.java create mode 100644 sdk/healthcareapis/mgmt-v2020_03_30/src/main/java/com/microsoft/azure/management/healthcareapis/v2020_03_30/implementation/package-info.java create mode 100644 sdk/healthcareapis/mgmt-v2020_03_30/src/main/java/com/microsoft/azure/management/healthcareapis/v2020_03_30/package-info.java diff --git a/sdk/healthcareapis/mgmt-v2020_03_30/pom.xml b/sdk/healthcareapis/mgmt-v2020_03_30/pom.xml new file mode 100644 index 0000000000000..5f94d69165359 --- /dev/null +++ b/sdk/healthcareapis/mgmt-v2020_03_30/pom.xml @@ -0,0 +1,135 @@ + + + 4.0.0 + com.microsoft.azure.healthcareapis.v2020_03_30 + + com.microsoft.azure + azure-arm-parent + 1.3.2 + ../../parents/azure-arm-parent/pom.xml + + azure-mgmt-healthcareapis + 1.0.0-beta + jar + Microsoft Azure SDK for HealthcareApis Management + This package contains Microsoft HealthcareApis Management SDK. + https://github.com/Azure/azure-sdk-for-java + + + The MIT License (MIT) + http://opensource.org/licenses/MIT + repo + + + + scm:git:https://github.com/Azure/azure-sdk-for-java + scm:git:git@github.com:Azure/azure-sdk-for-java.git + HEAD + + + UTF-8 + + + + + microsoft + Microsoft + + + + + com.microsoft.azure + azure-client-runtime + + + com.microsoft.azure + azure-arm-client-runtime + + + junit + junit + test + + + com.microsoft.azure + azure-client-authentication + test + + + com.microsoft.azure + azure-mgmt-resources + test + + + com.microsoft.azure + azure-arm-client-runtime + test-jar + test + + 1.6.5 + + + + + + org.apache.maven.plugins + maven-jar-plugin + + + + true + true + + + + + + org.codehaus.mojo + build-helper-maven-plugin + + + org.apache.maven.plugins + maven-compiler-plugin + 3.1 + + 1.7 + 1.7 + + + com.microsoft.azure.management.apigeneration.LangDefinitionProcessor + + + true + true + + true + true + + + + + org.apache.maven.plugins + maven-javadoc-plugin + 2.8 + + *.implementation.*;*.utils.*;com.microsoft.schemas._2003._10.serialization;*.blob.core.search + + + /** +
* Copyright (c) Microsoft Corporation. All rights reserved. +
* Licensed under the MIT License. See License.txt in the project root for +
* license information. +
*/ + ]]> +
+
+
+
+
+
diff --git a/sdk/healthcareapis/mgmt-v2020_03_30/src/main/java/com/microsoft/azure/management/healthcareapis/v2020_03_30/AzureEntityResource.java b/sdk/healthcareapis/mgmt-v2020_03_30/src/main/java/com/microsoft/azure/management/healthcareapis/v2020_03_30/AzureEntityResource.java new file mode 100644 index 0000000000000..0281a623817a5 --- /dev/null +++ b/sdk/healthcareapis/mgmt-v2020_03_30/src/main/java/com/microsoft/azure/management/healthcareapis/v2020_03_30/AzureEntityResource.java @@ -0,0 +1,34 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.healthcareapis.v2020_03_30; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.azure.ProxyResource; + +/** + * The resource model definition for a Azure Resource Manager resource with an + * etag. + */ +public class AzureEntityResource extends ProxyResource { + /** + * Resource Etag. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /** + * Get resource Etag. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + +} diff --git a/sdk/healthcareapis/mgmt-v2020_03_30/src/main/java/com/microsoft/azure/management/healthcareapis/v2020_03_30/CheckNameAvailabilityParameters.java b/sdk/healthcareapis/mgmt-v2020_03_30/src/main/java/com/microsoft/azure/management/healthcareapis/v2020_03_30/CheckNameAvailabilityParameters.java new file mode 100644 index 0000000000000..5f526ab550083 --- /dev/null +++ b/sdk/healthcareapis/mgmt-v2020_03_30/src/main/java/com/microsoft/azure/management/healthcareapis/v2020_03_30/CheckNameAvailabilityParameters.java @@ -0,0 +1,69 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.healthcareapis.v2020_03_30; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Input values. + */ +public class CheckNameAvailabilityParameters { + /** + * The name of the service instance to check. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /** + * The fully qualified resource type which includes provider namespace. + */ + @JsonProperty(value = "type", required = true) + private String type; + + /** + * Get the name of the service instance to check. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name of the service instance to check. + * + * @param name the name value to set + * @return the CheckNameAvailabilityParameters object itself. + */ + public CheckNameAvailabilityParameters withName(String name) { + this.name = name; + return this; + } + + /** + * Get the fully qualified resource type which includes provider namespace. + * + * @return the type value + */ + public String type() { + return this.type; + } + + /** + * Set the fully qualified resource type which includes provider namespace. + * + * @param type the type value to set + * @return the CheckNameAvailabilityParameters object itself. + */ + public CheckNameAvailabilityParameters withType(String type) { + this.type = type; + return this; + } + +} diff --git a/sdk/healthcareapis/mgmt-v2020_03_30/src/main/java/com/microsoft/azure/management/healthcareapis/v2020_03_30/ErrorDetailsInternal.java b/sdk/healthcareapis/mgmt-v2020_03_30/src/main/java/com/microsoft/azure/management/healthcareapis/v2020_03_30/ErrorDetailsInternal.java new file mode 100644 index 0000000000000..ae48efdf4c38d --- /dev/null +++ b/sdk/healthcareapis/mgmt-v2020_03_30/src/main/java/com/microsoft/azure/management/healthcareapis/v2020_03_30/ErrorDetailsInternal.java @@ -0,0 +1,62 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.healthcareapis.v2020_03_30; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Error details. + */ +public class ErrorDetailsInternal { + /** + * The error code. + */ + @JsonProperty(value = "code", access = JsonProperty.Access.WRITE_ONLY) + private String code; + + /** + * The error message. + */ + @JsonProperty(value = "message", access = JsonProperty.Access.WRITE_ONLY) + private String message; + + /** + * The target of the particular error. + */ + @JsonProperty(value = "target", access = JsonProperty.Access.WRITE_ONLY) + private String target; + + /** + * Get the error code. + * + * @return the code value + */ + public String code() { + return this.code; + } + + /** + * Get the error message. + * + * @return the message value + */ + public String message() { + return this.message; + } + + /** + * Get the target of the particular error. + * + * @return the target value + */ + public String target() { + return this.target; + } + +} diff --git a/sdk/healthcareapis/mgmt-v2020_03_30/src/main/java/com/microsoft/azure/management/healthcareapis/v2020_03_30/Kind.java b/sdk/healthcareapis/mgmt-v2020_03_30/src/main/java/com/microsoft/azure/management/healthcareapis/v2020_03_30/Kind.java new file mode 100644 index 0000000000000..6dc461ad58c57 --- /dev/null +++ b/sdk/healthcareapis/mgmt-v2020_03_30/src/main/java/com/microsoft/azure/management/healthcareapis/v2020_03_30/Kind.java @@ -0,0 +1,56 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.healthcareapis.v2020_03_30; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for Kind. + */ +public enum Kind { + /** Enum value fhir. */ + FHIR("fhir"), + + /** Enum value fhir-Stu3. */ + FHIR_STU3("fhir-Stu3"), + + /** Enum value fhir-R4. */ + FHIR_R4("fhir-R4"); + + /** The actual serialized value for a Kind instance. */ + private String value; + + Kind(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a Kind instance. + * + * @param value the serialized value to parse. + * @return the parsed Kind object, or null if unable to parse. + */ + @JsonCreator + public static Kind fromString(String value) { + Kind[] items = Kind.values(); + for (Kind item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/healthcareapis/mgmt-v2020_03_30/src/main/java/com/microsoft/azure/management/healthcareapis/v2020_03_30/ManagedServiceIdentityType.java b/sdk/healthcareapis/mgmt-v2020_03_30/src/main/java/com/microsoft/azure/management/healthcareapis/v2020_03_30/ManagedServiceIdentityType.java new file mode 100644 index 0000000000000..571cdf43c438b --- /dev/null +++ b/sdk/healthcareapis/mgmt-v2020_03_30/src/main/java/com/microsoft/azure/management/healthcareapis/v2020_03_30/ManagedServiceIdentityType.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.healthcareapis.v2020_03_30; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for ManagedServiceIdentityType. + */ +public final class ManagedServiceIdentityType extends ExpandableStringEnum { + /** Static value SystemAssigned for ManagedServiceIdentityType. */ + public static final ManagedServiceIdentityType SYSTEM_ASSIGNED = fromString("SystemAssigned"); + + /** Static value None for ManagedServiceIdentityType. */ + public static final ManagedServiceIdentityType NONE = fromString("None"); + + /** + * Creates or finds a ManagedServiceIdentityType from its string representation. + * @param name a name to look for + * @return the corresponding ManagedServiceIdentityType + */ + @JsonCreator + public static ManagedServiceIdentityType fromString(String name) { + return fromString(name, ManagedServiceIdentityType.class); + } + + /** + * @return known ManagedServiceIdentityType values + */ + public static Collection values() { + return values(ManagedServiceIdentityType.class); + } +} diff --git a/sdk/healthcareapis/mgmt-v2020_03_30/src/main/java/com/microsoft/azure/management/healthcareapis/v2020_03_30/Operation.java b/sdk/healthcareapis/mgmt-v2020_03_30/src/main/java/com/microsoft/azure/management/healthcareapis/v2020_03_30/Operation.java new file mode 100644 index 0000000000000..d1f1a5d6c5e55 --- /dev/null +++ b/sdk/healthcareapis/mgmt-v2020_03_30/src/main/java/com/microsoft/azure/management/healthcareapis/v2020_03_30/Operation.java @@ -0,0 +1,35 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.healthcareapis.v2020_03_30; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.healthcareapis.v2020_03_30.implementation.HealthcareApisManager; +import com.microsoft.azure.management.healthcareapis.v2020_03_30.implementation.OperationInner; + +/** + * Type representing Operation. + */ +public interface Operation extends HasInner, HasManager { + /** + * @return the display value. + */ + OperationDisplay display(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the origin value. + */ + String origin(); + +} diff --git a/sdk/healthcareapis/mgmt-v2020_03_30/src/main/java/com/microsoft/azure/management/healthcareapis/v2020_03_30/OperationDisplay.java b/sdk/healthcareapis/mgmt-v2020_03_30/src/main/java/com/microsoft/azure/management/healthcareapis/v2020_03_30/OperationDisplay.java new file mode 100644 index 0000000000000..96df8ec9d9116 --- /dev/null +++ b/sdk/healthcareapis/mgmt-v2020_03_30/src/main/java/com/microsoft/azure/management/healthcareapis/v2020_03_30/OperationDisplay.java @@ -0,0 +1,77 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.healthcareapis.v2020_03_30; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The object that represents the operation. + */ +public class OperationDisplay { + /** + * Service provider: Microsoft.HealthcareApis. + */ + @JsonProperty(value = "provider", access = JsonProperty.Access.WRITE_ONLY) + private String provider; + + /** + * Resource Type: Services. + */ + @JsonProperty(value = "resource", access = JsonProperty.Access.WRITE_ONLY) + private String resource; + + /** + * Name of the operation. + */ + @JsonProperty(value = "operation", access = JsonProperty.Access.WRITE_ONLY) + private String operation; + + /** + * Friendly description for the operation,. + */ + @JsonProperty(value = "description", access = JsonProperty.Access.WRITE_ONLY) + private String description; + + /** + * Get service provider: Microsoft.HealthcareApis. + * + * @return the provider value + */ + public String provider() { + return this.provider; + } + + /** + * Get resource Type: Services. + * + * @return the resource value + */ + public String resource() { + return this.resource; + } + + /** + * Get name of the operation. + * + * @return the operation value + */ + public String operation() { + return this.operation; + } + + /** + * Get friendly description for the operation,. + * + * @return the description value + */ + public String description() { + return this.description; + } + +} diff --git a/sdk/healthcareapis/mgmt-v2020_03_30/src/main/java/com/microsoft/azure/management/healthcareapis/v2020_03_30/OperationResultStatus.java b/sdk/healthcareapis/mgmt-v2020_03_30/src/main/java/com/microsoft/azure/management/healthcareapis/v2020_03_30/OperationResultStatus.java new file mode 100644 index 0000000000000..2a796a6bbd073 --- /dev/null +++ b/sdk/healthcareapis/mgmt-v2020_03_30/src/main/java/com/microsoft/azure/management/healthcareapis/v2020_03_30/OperationResultStatus.java @@ -0,0 +1,50 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.healthcareapis.v2020_03_30; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for OperationResultStatus. + */ +public final class OperationResultStatus extends ExpandableStringEnum { + /** Static value Canceled for OperationResultStatus. */ + public static final OperationResultStatus CANCELED = fromString("Canceled"); + + /** Static value Succeeded for OperationResultStatus. */ + public static final OperationResultStatus SUCCEEDED = fromString("Succeeded"); + + /** Static value Failed for OperationResultStatus. */ + public static final OperationResultStatus FAILED = fromString("Failed"); + + /** Static value Requested for OperationResultStatus. */ + public static final OperationResultStatus REQUESTED = fromString("Requested"); + + /** Static value Running for OperationResultStatus. */ + public static final OperationResultStatus RUNNING = fromString("Running"); + + /** + * Creates or finds a OperationResultStatus from its string representation. + * @param name a name to look for + * @return the corresponding OperationResultStatus + */ + @JsonCreator + public static OperationResultStatus fromString(String name) { + return fromString(name, OperationResultStatus.class); + } + + /** + * @return known OperationResultStatus values + */ + public static Collection values() { + return values(OperationResultStatus.class); + } +} diff --git a/sdk/healthcareapis/mgmt-v2020_03_30/src/main/java/com/microsoft/azure/management/healthcareapis/v2020_03_30/OperationResults.java b/sdk/healthcareapis/mgmt-v2020_03_30/src/main/java/com/microsoft/azure/management/healthcareapis/v2020_03_30/OperationResults.java new file mode 100644 index 0000000000000..b67e1aae98104 --- /dev/null +++ b/sdk/healthcareapis/mgmt-v2020_03_30/src/main/java/com/microsoft/azure/management/healthcareapis/v2020_03_30/OperationResults.java @@ -0,0 +1,29 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.healthcareapis.v2020_03_30; + +import rx.Observable; +import com.microsoft.azure.management.healthcareapis.v2020_03_30.implementation.OperationResultsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing OperationResults. + */ +public interface OperationResults extends HasInner { + /** + * Get the operation result for a long running operation. + * + * @param locationName The location of the operation. + * @param operationResultId The ID of the operation result to get. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String locationName, String operationResultId); + +} diff --git a/sdk/healthcareapis/mgmt-v2020_03_30/src/main/java/com/microsoft/azure/management/healthcareapis/v2020_03_30/Operations.java b/sdk/healthcareapis/mgmt-v2020_03_30/src/main/java/com/microsoft/azure/management/healthcareapis/v2020_03_30/Operations.java new file mode 100644 index 0000000000000..ac898e66f6c62 --- /dev/null +++ b/sdk/healthcareapis/mgmt-v2020_03_30/src/main/java/com/microsoft/azure/management/healthcareapis/v2020_03_30/Operations.java @@ -0,0 +1,27 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.healthcareapis.v2020_03_30; + +import rx.Observable; +import com.microsoft.azure.management.healthcareapis.v2020_03_30.implementation.OperationsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing Operations. + */ +public interface Operations extends HasInner { + /** + * Lists all of the available Healthcare service REST API operations. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(); + +} diff --git a/sdk/healthcareapis/mgmt-v2020_03_30/src/main/java/com/microsoft/azure/management/healthcareapis/v2020_03_30/PrivateEndpoint.java b/sdk/healthcareapis/mgmt-v2020_03_30/src/main/java/com/microsoft/azure/management/healthcareapis/v2020_03_30/PrivateEndpoint.java new file mode 100644 index 0000000000000..f8a5d7431224f --- /dev/null +++ b/sdk/healthcareapis/mgmt-v2020_03_30/src/main/java/com/microsoft/azure/management/healthcareapis/v2020_03_30/PrivateEndpoint.java @@ -0,0 +1,32 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.healthcareapis.v2020_03_30; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The Private Endpoint resource. + */ +public class PrivateEndpoint { + /** + * The ARM identifier for Private Endpoint. + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /** + * Get the ARM identifier for Private Endpoint. + * + * @return the id value + */ + public String id() { + return this.id; + } + +} diff --git a/sdk/healthcareapis/mgmt-v2020_03_30/src/main/java/com/microsoft/azure/management/healthcareapis/v2020_03_30/PrivateEndpointConnection.java b/sdk/healthcareapis/mgmt-v2020_03_30/src/main/java/com/microsoft/azure/management/healthcareapis/v2020_03_30/PrivateEndpointConnection.java new file mode 100644 index 0000000000000..95c150efc4306 --- /dev/null +++ b/sdk/healthcareapis/mgmt-v2020_03_30/src/main/java/com/microsoft/azure/management/healthcareapis/v2020_03_30/PrivateEndpointConnection.java @@ -0,0 +1,163 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.healthcareapis.v2020_03_30; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.healthcareapis.v2020_03_30.implementation.PrivateEndpointConnectionInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.healthcareapis.v2020_03_30.implementation.HealthcareApisManager; + +/** + * Type representing PrivateEndpointConnection. + */ +public interface PrivateEndpointConnection extends HasInner, Indexable, Refreshable, Updatable, HasManager { + /** + * @return the id value. + */ + String id(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the privateEndpoint value. + */ + PrivateEndpoint privateEndpoint(); + + /** + * @return the privateLinkServiceConnectionState value. + */ + PrivateLinkServiceConnectionState privateLinkServiceConnectionState(); + + /** + * @return the provisioningState value. + */ + PrivateEndpointConnectionProvisioningState provisioningState(); + + /** + * @return the type value. + */ + String type(); + + /** + * The entirety of the PrivateEndpointConnection definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithService, DefinitionStages.WithPrivateLinkServiceConnectionState, DefinitionStages.WithCreate { + } + + /** + * Grouping of PrivateEndpointConnection definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a PrivateEndpointConnection definition. + */ + interface Blank extends WithService { + } + + /** + * The stage of the privateendpointconnection definition allowing to specify Service. + */ + interface WithService { + /** + * Specifies resourceGroupName, resourceName. + * @param resourceGroupName The name of the resource group that contains the service instance + * @param resourceName The name of the service instance + * @return the next definition stage + */ + WithPrivateLinkServiceConnectionState withExistingService(String resourceGroupName, String resourceName); + } + + /** + * The stage of the privateendpointconnection definition allowing to specify PrivateLinkServiceConnectionState. + */ + interface WithPrivateLinkServiceConnectionState { + /** + * Specifies privateLinkServiceConnectionState. + * @param privateLinkServiceConnectionState A collection of information about the state of the connection between service consumer and provider + * @return the next definition stage + */ + WithCreate withPrivateLinkServiceConnectionState(PrivateLinkServiceConnectionState privateLinkServiceConnectionState); + } + + /** + * The stage of the privateendpointconnection definition allowing to specify PrivateEndpoint. + */ + interface WithPrivateEndpoint { + /** + * Specifies privateEndpoint. + * @param privateEndpoint The resource of private end point + * @return the next definition stage + */ + WithCreate withPrivateEndpoint(PrivateEndpoint privateEndpoint); + } + + /** + * The stage of the privateendpointconnection definition allowing to specify ProvisioningState. + */ + interface WithProvisioningState { + /** + * Specifies provisioningState. + * @param provisioningState The provisioning state of the private endpoint connection resource. Possible values include: 'Succeeded', 'Creating', 'Deleting', 'Failed' + * @return the next definition stage + */ + WithCreate withProvisioningState(PrivateEndpointConnectionProvisioningState provisioningState); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, DefinitionStages.WithPrivateEndpoint, DefinitionStages.WithProvisioningState { + } + } + /** + * The template for a PrivateEndpointConnection update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, UpdateStages.WithPrivateEndpoint, UpdateStages.WithProvisioningState { + } + + /** + * Grouping of PrivateEndpointConnection update stages. + */ + interface UpdateStages { + /** + * The stage of the privateendpointconnection update allowing to specify PrivateEndpoint. + */ + interface WithPrivateEndpoint { + /** + * Specifies privateEndpoint. + * @param privateEndpoint The resource of private end point + * @return the next update stage + */ + Update withPrivateEndpoint(PrivateEndpoint privateEndpoint); + } + + /** + * The stage of the privateendpointconnection update allowing to specify ProvisioningState. + */ + interface WithProvisioningState { + /** + * Specifies provisioningState. + * @param provisioningState The provisioning state of the private endpoint connection resource. Possible values include: 'Succeeded', 'Creating', 'Deleting', 'Failed' + * @return the next update stage + */ + Update withProvisioningState(PrivateEndpointConnectionProvisioningState provisioningState); + } + + } +} diff --git a/sdk/healthcareapis/mgmt-v2020_03_30/src/main/java/com/microsoft/azure/management/healthcareapis/v2020_03_30/PrivateEndpointConnectionProvisioningState.java b/sdk/healthcareapis/mgmt-v2020_03_30/src/main/java/com/microsoft/azure/management/healthcareapis/v2020_03_30/PrivateEndpointConnectionProvisioningState.java new file mode 100644 index 0000000000000..26cd89c689a1d --- /dev/null +++ b/sdk/healthcareapis/mgmt-v2020_03_30/src/main/java/com/microsoft/azure/management/healthcareapis/v2020_03_30/PrivateEndpointConnectionProvisioningState.java @@ -0,0 +1,47 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.healthcareapis.v2020_03_30; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for PrivateEndpointConnectionProvisioningState. + */ +public final class PrivateEndpointConnectionProvisioningState extends ExpandableStringEnum { + /** Static value Succeeded for PrivateEndpointConnectionProvisioningState. */ + public static final PrivateEndpointConnectionProvisioningState SUCCEEDED = fromString("Succeeded"); + + /** Static value Creating for PrivateEndpointConnectionProvisioningState. */ + public static final PrivateEndpointConnectionProvisioningState CREATING = fromString("Creating"); + + /** Static value Deleting for PrivateEndpointConnectionProvisioningState. */ + public static final PrivateEndpointConnectionProvisioningState DELETING = fromString("Deleting"); + + /** Static value Failed for PrivateEndpointConnectionProvisioningState. */ + public static final PrivateEndpointConnectionProvisioningState FAILED = fromString("Failed"); + + /** + * Creates or finds a PrivateEndpointConnectionProvisioningState from its string representation. + * @param name a name to look for + * @return the corresponding PrivateEndpointConnectionProvisioningState + */ + @JsonCreator + public static PrivateEndpointConnectionProvisioningState fromString(String name) { + return fromString(name, PrivateEndpointConnectionProvisioningState.class); + } + + /** + * @return known PrivateEndpointConnectionProvisioningState values + */ + public static Collection values() { + return values(PrivateEndpointConnectionProvisioningState.class); + } +} diff --git a/sdk/healthcareapis/mgmt-v2020_03_30/src/main/java/com/microsoft/azure/management/healthcareapis/v2020_03_30/PrivateEndpointConnections.java b/sdk/healthcareapis/mgmt-v2020_03_30/src/main/java/com/microsoft/azure/management/healthcareapis/v2020_03_30/PrivateEndpointConnections.java new file mode 100644 index 0000000000000..51bce5a8779a5 --- /dev/null +++ b/sdk/healthcareapis/mgmt-v2020_03_30/src/main/java/com/microsoft/azure/management/healthcareapis/v2020_03_30/PrivateEndpointConnections.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.healthcareapis.v2020_03_30; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import rx.Completable; +import rx.Observable; +import com.microsoft.azure.management.healthcareapis.v2020_03_30.implementation.PrivateEndpointConnectionsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing PrivateEndpointConnections. + */ +public interface PrivateEndpointConnections extends SupportsCreating, HasInner { + /** + * Gets the specified private endpoint connection associated with the service. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param resourceName The name of the service instance. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure resource + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String resourceName, String privateEndpointConnectionName); + + /** + * Lists all private endpoint connections for a service. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param resourceName The name of the service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listByServiceAsync(String resourceGroupName, String resourceName); + + /** + * Deletes a private endpoint connection. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param resourceName The name of the service instance. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure resource + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable deleteAsync(String resourceGroupName, String resourceName, String privateEndpointConnectionName); + +} diff --git a/sdk/healthcareapis/mgmt-v2020_03_30/src/main/java/com/microsoft/azure/management/healthcareapis/v2020_03_30/PrivateEndpointServiceConnectionStatus.java b/sdk/healthcareapis/mgmt-v2020_03_30/src/main/java/com/microsoft/azure/management/healthcareapis/v2020_03_30/PrivateEndpointServiceConnectionStatus.java new file mode 100644 index 0000000000000..b4f8dde8db93f --- /dev/null +++ b/sdk/healthcareapis/mgmt-v2020_03_30/src/main/java/com/microsoft/azure/management/healthcareapis/v2020_03_30/PrivateEndpointServiceConnectionStatus.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.healthcareapis.v2020_03_30; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for PrivateEndpointServiceConnectionStatus. + */ +public final class PrivateEndpointServiceConnectionStatus extends ExpandableStringEnum { + /** Static value Pending for PrivateEndpointServiceConnectionStatus. */ + public static final PrivateEndpointServiceConnectionStatus PENDING = fromString("Pending"); + + /** Static value Approved for PrivateEndpointServiceConnectionStatus. */ + public static final PrivateEndpointServiceConnectionStatus APPROVED = fromString("Approved"); + + /** Static value Rejected for PrivateEndpointServiceConnectionStatus. */ + public static final PrivateEndpointServiceConnectionStatus REJECTED = fromString("Rejected"); + + /** + * Creates or finds a PrivateEndpointServiceConnectionStatus from its string representation. + * @param name a name to look for + * @return the corresponding PrivateEndpointServiceConnectionStatus + */ + @JsonCreator + public static PrivateEndpointServiceConnectionStatus fromString(String name) { + return fromString(name, PrivateEndpointServiceConnectionStatus.class); + } + + /** + * @return known PrivateEndpointServiceConnectionStatus values + */ + public static Collection values() { + return values(PrivateEndpointServiceConnectionStatus.class); + } +} diff --git a/sdk/healthcareapis/mgmt-v2020_03_30/src/main/java/com/microsoft/azure/management/healthcareapis/v2020_03_30/PrivateLinkResource.java b/sdk/healthcareapis/mgmt-v2020_03_30/src/main/java/com/microsoft/azure/management/healthcareapis/v2020_03_30/PrivateLinkResource.java new file mode 100644 index 0000000000000..6423574e4b296 --- /dev/null +++ b/sdk/healthcareapis/mgmt-v2020_03_30/src/main/java/com/microsoft/azure/management/healthcareapis/v2020_03_30/PrivateLinkResource.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.healthcareapis.v2020_03_30; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.healthcareapis.v2020_03_30.implementation.PrivateLinkResourceInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.healthcareapis.v2020_03_30.implementation.HealthcareApisManager; +import java.util.List; + +/** + * Type representing PrivateLinkResource. + */ +public interface PrivateLinkResource extends HasInner, Indexable, Refreshable, HasManager { + /** + * @return the groupId value. + */ + String groupId(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the requiredMembers value. + */ + List requiredMembers(); + + /** + * @return the requiredZoneNames value. + */ + List requiredZoneNames(); + + /** + * @return the type value. + */ + String type(); + +} diff --git a/sdk/healthcareapis/mgmt-v2020_03_30/src/main/java/com/microsoft/azure/management/healthcareapis/v2020_03_30/PrivateLinkResourceListResult.java b/sdk/healthcareapis/mgmt-v2020_03_30/src/main/java/com/microsoft/azure/management/healthcareapis/v2020_03_30/PrivateLinkResourceListResult.java new file mode 100644 index 0000000000000..b1e332e04e6f1 --- /dev/null +++ b/sdk/healthcareapis/mgmt-v2020_03_30/src/main/java/com/microsoft/azure/management/healthcareapis/v2020_03_30/PrivateLinkResourceListResult.java @@ -0,0 +1,27 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.healthcareapis.v2020_03_30; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.healthcareapis.v2020_03_30.implementation.HealthcareApisManager; +import com.microsoft.azure.management.healthcareapis.v2020_03_30.implementation.PrivateLinkResourceListResultInner; +import com.microsoft.azure.management.healthcareapis.v2020_03_30.implementation.PrivateLinkResourceInner; +import java.util.List; + +/** + * Type representing PrivateLinkResourceListResult. + */ +public interface PrivateLinkResourceListResult extends HasInner, HasManager { + /** + * @return the value value. + */ + List value(); + +} diff --git a/sdk/healthcareapis/mgmt-v2020_03_30/src/main/java/com/microsoft/azure/management/healthcareapis/v2020_03_30/PrivateLinkResources.java b/sdk/healthcareapis/mgmt-v2020_03_30/src/main/java/com/microsoft/azure/management/healthcareapis/v2020_03_30/PrivateLinkResources.java new file mode 100644 index 0000000000000..0038ebbaae6ff --- /dev/null +++ b/sdk/healthcareapis/mgmt-v2020_03_30/src/main/java/com/microsoft/azure/management/healthcareapis/v2020_03_30/PrivateLinkResources.java @@ -0,0 +1,40 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.healthcareapis.v2020_03_30; + +import rx.Observable; +import com.microsoft.azure.management.healthcareapis.v2020_03_30.implementation.PrivateLinkResourcesInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing PrivateLinkResources. + */ +public interface PrivateLinkResources extends HasInner { + /** + * Gets the private link resources that need to be created for a service. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param resourceName The name of the service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listByServiceAsync(String resourceGroupName, String resourceName); + + /** + * Gets a private link resource that need to be created for a service. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param resourceName The name of the service instance. + * @param groupName The name of the private link resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String resourceName, String groupName); + +} diff --git a/sdk/healthcareapis/mgmt-v2020_03_30/src/main/java/com/microsoft/azure/management/healthcareapis/v2020_03_30/PrivateLinkServiceConnectionState.java b/sdk/healthcareapis/mgmt-v2020_03_30/src/main/java/com/microsoft/azure/management/healthcareapis/v2020_03_30/PrivateLinkServiceConnectionState.java new file mode 100644 index 0000000000000..2c86dcc78dfeb --- /dev/null +++ b/sdk/healthcareapis/mgmt-v2020_03_30/src/main/java/com/microsoft/azure/management/healthcareapis/v2020_03_30/PrivateLinkServiceConnectionState.java @@ -0,0 +1,99 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.healthcareapis.v2020_03_30; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * A collection of information about the state of the connection between + * service consumer and provider. + */ +public class PrivateLinkServiceConnectionState { + /** + * Indicates whether the connection has been Approved/Rejected/Removed by + * the owner of the service. Possible values include: 'Pending', + * 'Approved', 'Rejected'. + */ + @JsonProperty(value = "status") + private PrivateEndpointServiceConnectionStatus status; + + /** + * The reason for approval/rejection of the connection. + */ + @JsonProperty(value = "description") + private String description; + + /** + * A message indicating if changes on the service provider require any + * updates on the consumer. + */ + @JsonProperty(value = "actionsRequired") + private String actionsRequired; + + /** + * Get indicates whether the connection has been Approved/Rejected/Removed by the owner of the service. Possible values include: 'Pending', 'Approved', 'Rejected'. + * + * @return the status value + */ + public PrivateEndpointServiceConnectionStatus status() { + return this.status; + } + + /** + * Set indicates whether the connection has been Approved/Rejected/Removed by the owner of the service. Possible values include: 'Pending', 'Approved', 'Rejected'. + * + * @param status the status value to set + * @return the PrivateLinkServiceConnectionState object itself. + */ + public PrivateLinkServiceConnectionState withStatus(PrivateEndpointServiceConnectionStatus status) { + this.status = status; + return this; + } + + /** + * Get the reason for approval/rejection of the connection. + * + * @return the description value + */ + public String description() { + return this.description; + } + + /** + * Set the reason for approval/rejection of the connection. + * + * @param description the description value to set + * @return the PrivateLinkServiceConnectionState object itself. + */ + public PrivateLinkServiceConnectionState withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get a message indicating if changes on the service provider require any updates on the consumer. + * + * @return the actionsRequired value + */ + public String actionsRequired() { + return this.actionsRequired; + } + + /** + * Set a message indicating if changes on the service provider require any updates on the consumer. + * + * @param actionsRequired the actionsRequired value to set + * @return the PrivateLinkServiceConnectionState object itself. + */ + public PrivateLinkServiceConnectionState withActionsRequired(String actionsRequired) { + this.actionsRequired = actionsRequired; + return this; + } + +} diff --git a/sdk/healthcareapis/mgmt-v2020_03_30/src/main/java/com/microsoft/azure/management/healthcareapis/v2020_03_30/ProvisioningState.java b/sdk/healthcareapis/mgmt-v2020_03_30/src/main/java/com/microsoft/azure/management/healthcareapis/v2020_03_30/ProvisioningState.java new file mode 100644 index 0000000000000..33d8e4c786377 --- /dev/null +++ b/sdk/healthcareapis/mgmt-v2020_03_30/src/main/java/com/microsoft/azure/management/healthcareapis/v2020_03_30/ProvisioningState.java @@ -0,0 +1,62 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.healthcareapis.v2020_03_30; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for ProvisioningState. + */ +public final class ProvisioningState extends ExpandableStringEnum { + /** Static value Deleting for ProvisioningState. */ + public static final ProvisioningState DELETING = fromString("Deleting"); + + /** Static value Succeeded for ProvisioningState. */ + public static final ProvisioningState SUCCEEDED = fromString("Succeeded"); + + /** Static value Creating for ProvisioningState. */ + public static final ProvisioningState CREATING = fromString("Creating"); + + /** Static value Accepted for ProvisioningState. */ + public static final ProvisioningState ACCEPTED = fromString("Accepted"); + + /** Static value Verifying for ProvisioningState. */ + public static final ProvisioningState VERIFYING = fromString("Verifying"); + + /** Static value Updating for ProvisioningState. */ + public static final ProvisioningState UPDATING = fromString("Updating"); + + /** Static value Failed for ProvisioningState. */ + public static final ProvisioningState FAILED = fromString("Failed"); + + /** Static value Canceled for ProvisioningState. */ + public static final ProvisioningState CANCELED = fromString("Canceled"); + + /** Static value Deprovisioned for ProvisioningState. */ + public static final ProvisioningState DEPROVISIONED = fromString("Deprovisioned"); + + /** + * Creates or finds a ProvisioningState from its string representation. + * @param name a name to look for + * @return the corresponding ProvisioningState + */ + @JsonCreator + public static ProvisioningState fromString(String name) { + return fromString(name, ProvisioningState.class); + } + + /** + * @return known ProvisioningState values + */ + public static Collection values() { + return values(ProvisioningState.class); + } +} diff --git a/sdk/healthcareapis/mgmt-v2020_03_30/src/main/java/com/microsoft/azure/management/healthcareapis/v2020_03_30/PublicNetworkAccess.java b/sdk/healthcareapis/mgmt-v2020_03_30/src/main/java/com/microsoft/azure/management/healthcareapis/v2020_03_30/PublicNetworkAccess.java new file mode 100644 index 0000000000000..43060114c3f70 --- /dev/null +++ b/sdk/healthcareapis/mgmt-v2020_03_30/src/main/java/com/microsoft/azure/management/healthcareapis/v2020_03_30/PublicNetworkAccess.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.healthcareapis.v2020_03_30; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for PublicNetworkAccess. + */ +public final class PublicNetworkAccess extends ExpandableStringEnum { + /** Static value Enabled for PublicNetworkAccess. */ + public static final PublicNetworkAccess ENABLED = fromString("Enabled"); + + /** Static value Disabled for PublicNetworkAccess. */ + public static final PublicNetworkAccess DISABLED = fromString("Disabled"); + + /** + * Creates or finds a PublicNetworkAccess from its string representation. + * @param name a name to look for + * @return the corresponding PublicNetworkAccess + */ + @JsonCreator + public static PublicNetworkAccess fromString(String name) { + return fromString(name, PublicNetworkAccess.class); + } + + /** + * @return known PublicNetworkAccess values + */ + public static Collection values() { + return values(PublicNetworkAccess.class); + } +} diff --git a/sdk/healthcareapis/mgmt-v2020_03_30/src/main/java/com/microsoft/azure/management/healthcareapis/v2020_03_30/ServiceAccessPolicyEntry.java b/sdk/healthcareapis/mgmt-v2020_03_30/src/main/java/com/microsoft/azure/management/healthcareapis/v2020_03_30/ServiceAccessPolicyEntry.java new file mode 100644 index 0000000000000..c15d2dc3cd53e --- /dev/null +++ b/sdk/healthcareapis/mgmt-v2020_03_30/src/main/java/com/microsoft/azure/management/healthcareapis/v2020_03_30/ServiceAccessPolicyEntry.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.healthcareapis.v2020_03_30; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * An access policy entry. + */ +public class ServiceAccessPolicyEntry { + /** + * An Azure AD object ID (User or Apps) that is allowed access to the FHIR + * service. + */ + @JsonProperty(value = "objectId", required = true) + private String objectId; + + /** + * Get an Azure AD object ID (User or Apps) that is allowed access to the FHIR service. + * + * @return the objectId value + */ + public String objectId() { + return this.objectId; + } + + /** + * Set an Azure AD object ID (User or Apps) that is allowed access to the FHIR service. + * + * @param objectId the objectId value to set + * @return the ServiceAccessPolicyEntry object itself. + */ + public ServiceAccessPolicyEntry withObjectId(String objectId) { + this.objectId = objectId; + return this; + } + +} diff --git a/sdk/healthcareapis/mgmt-v2020_03_30/src/main/java/com/microsoft/azure/management/healthcareapis/v2020_03_30/ServiceAuthenticationConfigurationInfo.java b/sdk/healthcareapis/mgmt-v2020_03_30/src/main/java/com/microsoft/azure/management/healthcareapis/v2020_03_30/ServiceAuthenticationConfigurationInfo.java new file mode 100644 index 0000000000000..e48478fa8b268 --- /dev/null +++ b/sdk/healthcareapis/mgmt-v2020_03_30/src/main/java/com/microsoft/azure/management/healthcareapis/v2020_03_30/ServiceAuthenticationConfigurationInfo.java @@ -0,0 +1,95 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.healthcareapis.v2020_03_30; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Authentication configuration information. + */ +public class ServiceAuthenticationConfigurationInfo { + /** + * The authority url for the service. + */ + @JsonProperty(value = "authority") + private String authority; + + /** + * The audience url for the service. + */ + @JsonProperty(value = "audience") + private String audience; + + /** + * If the SMART on FHIR proxy is enabled. + */ + @JsonProperty(value = "smartProxyEnabled") + private Boolean smartProxyEnabled; + + /** + * Get the authority url for the service. + * + * @return the authority value + */ + public String authority() { + return this.authority; + } + + /** + * Set the authority url for the service. + * + * @param authority the authority value to set + * @return the ServiceAuthenticationConfigurationInfo object itself. + */ + public ServiceAuthenticationConfigurationInfo withAuthority(String authority) { + this.authority = authority; + return this; + } + + /** + * Get the audience url for the service. + * + * @return the audience value + */ + public String audience() { + return this.audience; + } + + /** + * Set the audience url for the service. + * + * @param audience the audience value to set + * @return the ServiceAuthenticationConfigurationInfo object itself. + */ + public ServiceAuthenticationConfigurationInfo withAudience(String audience) { + this.audience = audience; + return this; + } + + /** + * Get if the SMART on FHIR proxy is enabled. + * + * @return the smartProxyEnabled value + */ + public Boolean smartProxyEnabled() { + return this.smartProxyEnabled; + } + + /** + * Set if the SMART on FHIR proxy is enabled. + * + * @param smartProxyEnabled the smartProxyEnabled value to set + * @return the ServiceAuthenticationConfigurationInfo object itself. + */ + public ServiceAuthenticationConfigurationInfo withSmartProxyEnabled(Boolean smartProxyEnabled) { + this.smartProxyEnabled = smartProxyEnabled; + return this; + } + +} diff --git a/sdk/healthcareapis/mgmt-v2020_03_30/src/main/java/com/microsoft/azure/management/healthcareapis/v2020_03_30/ServiceCorsConfigurationInfo.java b/sdk/healthcareapis/mgmt-v2020_03_30/src/main/java/com/microsoft/azure/management/healthcareapis/v2020_03_30/ServiceCorsConfigurationInfo.java new file mode 100644 index 0000000000000..6a8dd90f0ac75 --- /dev/null +++ b/sdk/healthcareapis/mgmt-v2020_03_30/src/main/java/com/microsoft/azure/management/healthcareapis/v2020_03_30/ServiceCorsConfigurationInfo.java @@ -0,0 +1,148 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.healthcareapis.v2020_03_30; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The settings for the CORS configuration of the service instance. + */ +public class ServiceCorsConfigurationInfo { + /** + * The origins to be allowed via CORS. + */ + @JsonProperty(value = "origins") + private List origins; + + /** + * The headers to be allowed via CORS. + */ + @JsonProperty(value = "headers") + private List headers; + + /** + * The methods to be allowed via CORS. + */ + @JsonProperty(value = "methods") + private List methods; + + /** + * The max age to be allowed via CORS. + */ + @JsonProperty(value = "maxAge") + private Integer maxAge; + + /** + * If credentials are allowed via CORS. + */ + @JsonProperty(value = "allowCredentials") + private Boolean allowCredentials; + + /** + * Get the origins to be allowed via CORS. + * + * @return the origins value + */ + public List origins() { + return this.origins; + } + + /** + * Set the origins to be allowed via CORS. + * + * @param origins the origins value to set + * @return the ServiceCorsConfigurationInfo object itself. + */ + public ServiceCorsConfigurationInfo withOrigins(List origins) { + this.origins = origins; + return this; + } + + /** + * Get the headers to be allowed via CORS. + * + * @return the headers value + */ + public List headers() { + return this.headers; + } + + /** + * Set the headers to be allowed via CORS. + * + * @param headers the headers value to set + * @return the ServiceCorsConfigurationInfo object itself. + */ + public ServiceCorsConfigurationInfo withHeaders(List headers) { + this.headers = headers; + return this; + } + + /** + * Get the methods to be allowed via CORS. + * + * @return the methods value + */ + public List methods() { + return this.methods; + } + + /** + * Set the methods to be allowed via CORS. + * + * @param methods the methods value to set + * @return the ServiceCorsConfigurationInfo object itself. + */ + public ServiceCorsConfigurationInfo withMethods(List methods) { + this.methods = methods; + return this; + } + + /** + * Get the max age to be allowed via CORS. + * + * @return the maxAge value + */ + public Integer maxAge() { + return this.maxAge; + } + + /** + * Set the max age to be allowed via CORS. + * + * @param maxAge the maxAge value to set + * @return the ServiceCorsConfigurationInfo object itself. + */ + public ServiceCorsConfigurationInfo withMaxAge(Integer maxAge) { + this.maxAge = maxAge; + return this; + } + + /** + * Get if credentials are allowed via CORS. + * + * @return the allowCredentials value + */ + public Boolean allowCredentials() { + return this.allowCredentials; + } + + /** + * Set if credentials are allowed via CORS. + * + * @param allowCredentials the allowCredentials value to set + * @return the ServiceCorsConfigurationInfo object itself. + */ + public ServiceCorsConfigurationInfo withAllowCredentials(Boolean allowCredentials) { + this.allowCredentials = allowCredentials; + return this; + } + +} diff --git a/sdk/healthcareapis/mgmt-v2020_03_30/src/main/java/com/microsoft/azure/management/healthcareapis/v2020_03_30/ServiceCosmosDbConfigurationInfo.java b/sdk/healthcareapis/mgmt-v2020_03_30/src/main/java/com/microsoft/azure/management/healthcareapis/v2020_03_30/ServiceCosmosDbConfigurationInfo.java new file mode 100644 index 0000000000000..f86c74eb84faa --- /dev/null +++ b/sdk/healthcareapis/mgmt-v2020_03_30/src/main/java/com/microsoft/azure/management/healthcareapis/v2020_03_30/ServiceCosmosDbConfigurationInfo.java @@ -0,0 +1,69 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.healthcareapis.v2020_03_30; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The settings for the Cosmos DB database backing the service. + */ +public class ServiceCosmosDbConfigurationInfo { + /** + * The provisioned throughput for the backing database. + */ + @JsonProperty(value = "offerThroughput") + private Integer offerThroughput; + + /** + * The URI of the customer-managed key for the backing database. + */ + @JsonProperty(value = "keyVaultKeyUri") + private String keyVaultKeyUri; + + /** + * Get the provisioned throughput for the backing database. + * + * @return the offerThroughput value + */ + public Integer offerThroughput() { + return this.offerThroughput; + } + + /** + * Set the provisioned throughput for the backing database. + * + * @param offerThroughput the offerThroughput value to set + * @return the ServiceCosmosDbConfigurationInfo object itself. + */ + public ServiceCosmosDbConfigurationInfo withOfferThroughput(Integer offerThroughput) { + this.offerThroughput = offerThroughput; + return this; + } + + /** + * Get the URI of the customer-managed key for the backing database. + * + * @return the keyVaultKeyUri value + */ + public String keyVaultKeyUri() { + return this.keyVaultKeyUri; + } + + /** + * Set the URI of the customer-managed key for the backing database. + * + * @param keyVaultKeyUri the keyVaultKeyUri value to set + * @return the ServiceCosmosDbConfigurationInfo object itself. + */ + public ServiceCosmosDbConfigurationInfo withKeyVaultKeyUri(String keyVaultKeyUri) { + this.keyVaultKeyUri = keyVaultKeyUri; + return this; + } + +} diff --git a/sdk/healthcareapis/mgmt-v2020_03_30/src/main/java/com/microsoft/azure/management/healthcareapis/v2020_03_30/ServiceExportConfigurationInfo.java b/sdk/healthcareapis/mgmt-v2020_03_30/src/main/java/com/microsoft/azure/management/healthcareapis/v2020_03_30/ServiceExportConfigurationInfo.java new file mode 100644 index 0000000000000..da7ae97d170e0 --- /dev/null +++ b/sdk/healthcareapis/mgmt-v2020_03_30/src/main/java/com/microsoft/azure/management/healthcareapis/v2020_03_30/ServiceExportConfigurationInfo.java @@ -0,0 +1,43 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.healthcareapis.v2020_03_30; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Export operation configuration information. + */ +public class ServiceExportConfigurationInfo { + /** + * The name of the default export storage account. + */ + @JsonProperty(value = "storageAccountName") + private String storageAccountName; + + /** + * Get the name of the default export storage account. + * + * @return the storageAccountName value + */ + public String storageAccountName() { + return this.storageAccountName; + } + + /** + * Set the name of the default export storage account. + * + * @param storageAccountName the storageAccountName value to set + * @return the ServiceExportConfigurationInfo object itself. + */ + public ServiceExportConfigurationInfo withStorageAccountName(String storageAccountName) { + this.storageAccountName = storageAccountName; + return this; + } + +} diff --git a/sdk/healthcareapis/mgmt-v2020_03_30/src/main/java/com/microsoft/azure/management/healthcareapis/v2020_03_30/ServiceNameUnavailabilityReason.java b/sdk/healthcareapis/mgmt-v2020_03_30/src/main/java/com/microsoft/azure/management/healthcareapis/v2020_03_30/ServiceNameUnavailabilityReason.java new file mode 100644 index 0000000000000..4a49185402a76 --- /dev/null +++ b/sdk/healthcareapis/mgmt-v2020_03_30/src/main/java/com/microsoft/azure/management/healthcareapis/v2020_03_30/ServiceNameUnavailabilityReason.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.healthcareapis.v2020_03_30; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for ServiceNameUnavailabilityReason. + */ +public enum ServiceNameUnavailabilityReason { + /** Enum value Invalid. */ + INVALID("Invalid"), + + /** Enum value AlreadyExists. */ + ALREADY_EXISTS("AlreadyExists"); + + /** The actual serialized value for a ServiceNameUnavailabilityReason instance. */ + private String value; + + ServiceNameUnavailabilityReason(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a ServiceNameUnavailabilityReason instance. + * + * @param value the serialized value to parse. + * @return the parsed ServiceNameUnavailabilityReason object, or null if unable to parse. + */ + @JsonCreator + public static ServiceNameUnavailabilityReason fromString(String value) { + ServiceNameUnavailabilityReason[] items = ServiceNameUnavailabilityReason.values(); + for (ServiceNameUnavailabilityReason item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/healthcareapis/mgmt-v2020_03_30/src/main/java/com/microsoft/azure/management/healthcareapis/v2020_03_30/Services.java b/sdk/healthcareapis/mgmt-v2020_03_30/src/main/java/com/microsoft/azure/management/healthcareapis/v2020_03_30/Services.java new file mode 100644 index 0000000000000..65f05a8430e0a --- /dev/null +++ b/sdk/healthcareapis/mgmt-v2020_03_30/src/main/java/com/microsoft/azure/management/healthcareapis/v2020_03_30/Services.java @@ -0,0 +1,34 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.healthcareapis.v2020_03_30; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import com.microsoft.azure.arm.resources.collection.SupportsDeletingByResourceGroup; +import com.microsoft.azure.arm.resources.collection.SupportsBatchDeletion; +import com.microsoft.azure.arm.resources.collection.SupportsGettingByResourceGroup; +import rx.Observable; +import com.microsoft.azure.arm.resources.collection.SupportsListingByResourceGroup; +import com.microsoft.azure.arm.collection.SupportsListing; +import com.microsoft.azure.management.healthcareapis.v2020_03_30.implementation.ServicesInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing Services. + */ +public interface Services extends SupportsCreating, SupportsDeletingByResourceGroup, SupportsBatchDeletion, SupportsGettingByResourceGroup, SupportsListingByResourceGroup, SupportsListing, HasInner { + /** + * Check if a service instance name is available. + * + * @param checkNameAvailabilityInputs Set the name parameter in the CheckNameAvailabilityParameters structure to the name of the service instance to check. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable checkNameAvailabilityAsync(CheckNameAvailabilityParameters checkNameAvailabilityInputs); + +} diff --git a/sdk/healthcareapis/mgmt-v2020_03_30/src/main/java/com/microsoft/azure/management/healthcareapis/v2020_03_30/ServicesDescription.java b/sdk/healthcareapis/mgmt-v2020_03_30/src/main/java/com/microsoft/azure/management/healthcareapis/v2020_03_30/ServicesDescription.java new file mode 100644 index 0000000000000..3a7affb4ce58e --- /dev/null +++ b/sdk/healthcareapis/mgmt-v2020_03_30/src/main/java/com/microsoft/azure/management/healthcareapis/v2020_03_30/ServicesDescription.java @@ -0,0 +1,148 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.healthcareapis.v2020_03_30; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.Resource; +import com.microsoft.azure.arm.resources.models.GroupableResourceCore; +import com.microsoft.azure.arm.resources.models.HasResourceGroup; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.healthcareapis.v2020_03_30.implementation.HealthcareApisManager; +import com.microsoft.azure.management.healthcareapis.v2020_03_30.implementation.ServicesDescriptionInner; + +/** + * Type representing ServicesDescription. + */ +public interface ServicesDescription extends HasInner, Resource, GroupableResourceCore, HasResourceGroup, Refreshable, Updatable, HasManager { + /** + * @return the etag value. + */ + String etag(); + + /** + * @return the identity value. + */ + ServicesResourceIdentity identity(); + + /** + * @return the kind value. + */ + Kind kind(); + + /** + * @return the properties value. + */ + ServicesProperties properties(); + + /** + * The entirety of the ServicesDescription definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithGroup, DefinitionStages.WithKind, DefinitionStages.WithCreate { + } + + /** + * Grouping of ServicesDescription definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a ServicesDescription definition. + */ + interface Blank extends GroupableResourceCore.DefinitionWithRegion { + } + + /** + * The stage of the ServicesDescription definition allowing to specify the resource group. + */ + interface WithGroup extends GroupableResourceCore.DefinitionStages.WithGroup { + } + + /** + * The stage of the servicesdescription definition allowing to specify Kind. + */ + interface WithKind { + /** + * Specifies kind. + * @param kind The kind of the service. Possible values include: 'fhir', 'fhir-Stu3', 'fhir-R4' + * @return the next definition stage +*/ + WithCreate withKind(Kind kind); + } + + /** + * The stage of the servicesdescription definition allowing to specify Etag. + */ + interface WithEtag { + /** + * Specifies etag. + * @param etag An etag associated with the resource, used for optimistic concurrency when editing it + * @return the next definition stage + */ + WithCreate withEtag(String etag); + } + + /** + * The stage of the servicesdescription definition allowing to specify Identity. + */ + interface WithIdentity { + /** + * Specifies identity. + * @param identity Setting indicating whether the service has a managed identity associated with it + * @return the next definition stage + */ + WithCreate withIdentity(ServicesResourceIdentity identity); + } + + /** + * The stage of the servicesdescription definition allowing to specify Properties. + */ + interface WithProperties { + /** + * Specifies properties. + * @param properties The common properties of a service + * @return the next definition stage + */ + WithCreate withProperties(ServicesProperties properties); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, Resource.DefinitionWithTags, DefinitionStages.WithEtag, DefinitionStages.WithIdentity, DefinitionStages.WithProperties { + } + } + /** + * The template for a ServicesDescription update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, Resource.UpdateWithTags, UpdateStages.WithPublicNetworkAccess { + } + + /** + * Grouping of ServicesDescription update stages. + */ + interface UpdateStages { + /** + * The stage of the servicesdescription update allowing to specify PublicNetworkAccess. + */ + interface WithPublicNetworkAccess { + /** + * Specifies publicNetworkAccess. + * @param publicNetworkAccess Control permission for data plane traffic coming from public networks while private endpoint is enabled. Possible values include: 'Enabled', 'Disabled' + * @return the next update stage + */ + Update withPublicNetworkAccess(PublicNetworkAccess publicNetworkAccess); + } + + } +} diff --git a/sdk/healthcareapis/mgmt-v2020_03_30/src/main/java/com/microsoft/azure/management/healthcareapis/v2020_03_30/ServicesNameAvailabilityInfo.java b/sdk/healthcareapis/mgmt-v2020_03_30/src/main/java/com/microsoft/azure/management/healthcareapis/v2020_03_30/ServicesNameAvailabilityInfo.java new file mode 100644 index 0000000000000..b8beab00df9fa --- /dev/null +++ b/sdk/healthcareapis/mgmt-v2020_03_30/src/main/java/com/microsoft/azure/management/healthcareapis/v2020_03_30/ServicesNameAvailabilityInfo.java @@ -0,0 +1,35 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.healthcareapis.v2020_03_30; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.healthcareapis.v2020_03_30.implementation.HealthcareApisManager; +import com.microsoft.azure.management.healthcareapis.v2020_03_30.implementation.ServicesNameAvailabilityInfoInner; + +/** + * Type representing ServicesNameAvailabilityInfo. + */ +public interface ServicesNameAvailabilityInfo extends HasInner, HasManager { + /** + * @return the message value. + */ + String message(); + + /** + * @return the nameAvailable value. + */ + Boolean nameAvailable(); + + /** + * @return the reason value. + */ + ServiceNameUnavailabilityReason reason(); + +} diff --git a/sdk/healthcareapis/mgmt-v2020_03_30/src/main/java/com/microsoft/azure/management/healthcareapis/v2020_03_30/ServicesPatchDescription.java b/sdk/healthcareapis/mgmt-v2020_03_30/src/main/java/com/microsoft/azure/management/healthcareapis/v2020_03_30/ServicesPatchDescription.java new file mode 100644 index 0000000000000..fc0c32f61b159 --- /dev/null +++ b/sdk/healthcareapis/mgmt-v2020_03_30/src/main/java/com/microsoft/azure/management/healthcareapis/v2020_03_30/ServicesPatchDescription.java @@ -0,0 +1,74 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.healthcareapis.v2020_03_30; + +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * The description of the service. + */ +@JsonFlatten +public class ServicesPatchDescription { + /** + * Instance tags. + */ + @JsonProperty(value = "tags") + private Map tags; + + /** + * Control permission for data plane traffic coming from public networks + * while private endpoint is enabled. Possible values include: 'Enabled', + * 'Disabled'. + */ + @JsonProperty(value = "properties.publicNetworkAccess") + private PublicNetworkAccess publicNetworkAccess; + + /** + * Get instance tags. + * + * @return the tags value + */ + public Map tags() { + return this.tags; + } + + /** + * Set instance tags. + * + * @param tags the tags value to set + * @return the ServicesPatchDescription object itself. + */ + public ServicesPatchDescription withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Get control permission for data plane traffic coming from public networks while private endpoint is enabled. Possible values include: 'Enabled', 'Disabled'. + * + * @return the publicNetworkAccess value + */ + public PublicNetworkAccess publicNetworkAccess() { + return this.publicNetworkAccess; + } + + /** + * Set control permission for data plane traffic coming from public networks while private endpoint is enabled. Possible values include: 'Enabled', 'Disabled'. + * + * @param publicNetworkAccess the publicNetworkAccess value to set + * @return the ServicesPatchDescription object itself. + */ + public ServicesPatchDescription withPublicNetworkAccess(PublicNetworkAccess publicNetworkAccess) { + this.publicNetworkAccess = publicNetworkAccess; + return this; + } + +} diff --git a/sdk/healthcareapis/mgmt-v2020_03_30/src/main/java/com/microsoft/azure/management/healthcareapis/v2020_03_30/ServicesProperties.java b/sdk/healthcareapis/mgmt-v2020_03_30/src/main/java/com/microsoft/azure/management/healthcareapis/v2020_03_30/ServicesProperties.java new file mode 100644 index 0000000000000..bec54fe7d5d7c --- /dev/null +++ b/sdk/healthcareapis/mgmt-v2020_03_30/src/main/java/com/microsoft/azure/management/healthcareapis/v2020_03_30/ServicesProperties.java @@ -0,0 +1,221 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.healthcareapis.v2020_03_30; + +import java.util.List; +import com.microsoft.azure.management.healthcareapis.v2020_03_30.implementation.PrivateEndpointConnectionInner; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The properties of a service instance. + */ +public class ServicesProperties { + /** + * The provisioning state. Possible values include: 'Deleting', + * 'Succeeded', 'Creating', 'Accepted', 'Verifying', 'Updating', 'Failed', + * 'Canceled', 'Deprovisioned'. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /** + * The access policies of the service instance. + */ + @JsonProperty(value = "accessPolicies") + private List accessPolicies; + + /** + * The settings for the Cosmos DB database backing the service. + */ + @JsonProperty(value = "cosmosDbConfiguration") + private ServiceCosmosDbConfigurationInfo cosmosDbConfiguration; + + /** + * The authentication configuration for the service instance. + */ + @JsonProperty(value = "authenticationConfiguration") + private ServiceAuthenticationConfigurationInfo authenticationConfiguration; + + /** + * The settings for the CORS configuration of the service instance. + */ + @JsonProperty(value = "corsConfiguration") + private ServiceCorsConfigurationInfo corsConfiguration; + + /** + * The settings for the export operation of the service instance. + */ + @JsonProperty(value = "exportConfiguration") + private ServiceExportConfigurationInfo exportConfiguration; + + /** + * The list of private endpoint connections that are set up for this + * resource. + */ + @JsonProperty(value = "privateEndpointConnections") + private List privateEndpointConnections; + + /** + * Control permission for data plane traffic coming from public networks + * while private endpoint is enabled. Possible values include: 'Enabled', + * 'Disabled'. + */ + @JsonProperty(value = "publicNetworkAccess") + private PublicNetworkAccess publicNetworkAccess; + + /** + * Get the provisioning state. Possible values include: 'Deleting', 'Succeeded', 'Creating', 'Accepted', 'Verifying', 'Updating', 'Failed', 'Canceled', 'Deprovisioned'. + * + * @return the provisioningState value + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the access policies of the service instance. + * + * @return the accessPolicies value + */ + public List accessPolicies() { + return this.accessPolicies; + } + + /** + * Set the access policies of the service instance. + * + * @param accessPolicies the accessPolicies value to set + * @return the ServicesProperties object itself. + */ + public ServicesProperties withAccessPolicies(List accessPolicies) { + this.accessPolicies = accessPolicies; + return this; + } + + /** + * Get the settings for the Cosmos DB database backing the service. + * + * @return the cosmosDbConfiguration value + */ + public ServiceCosmosDbConfigurationInfo cosmosDbConfiguration() { + return this.cosmosDbConfiguration; + } + + /** + * Set the settings for the Cosmos DB database backing the service. + * + * @param cosmosDbConfiguration the cosmosDbConfiguration value to set + * @return the ServicesProperties object itself. + */ + public ServicesProperties withCosmosDbConfiguration(ServiceCosmosDbConfigurationInfo cosmosDbConfiguration) { + this.cosmosDbConfiguration = cosmosDbConfiguration; + return this; + } + + /** + * Get the authentication configuration for the service instance. + * + * @return the authenticationConfiguration value + */ + public ServiceAuthenticationConfigurationInfo authenticationConfiguration() { + return this.authenticationConfiguration; + } + + /** + * Set the authentication configuration for the service instance. + * + * @param authenticationConfiguration the authenticationConfiguration value to set + * @return the ServicesProperties object itself. + */ + public ServicesProperties withAuthenticationConfiguration(ServiceAuthenticationConfigurationInfo authenticationConfiguration) { + this.authenticationConfiguration = authenticationConfiguration; + return this; + } + + /** + * Get the settings for the CORS configuration of the service instance. + * + * @return the corsConfiguration value + */ + public ServiceCorsConfigurationInfo corsConfiguration() { + return this.corsConfiguration; + } + + /** + * Set the settings for the CORS configuration of the service instance. + * + * @param corsConfiguration the corsConfiguration value to set + * @return the ServicesProperties object itself. + */ + public ServicesProperties withCorsConfiguration(ServiceCorsConfigurationInfo corsConfiguration) { + this.corsConfiguration = corsConfiguration; + return this; + } + + /** + * Get the settings for the export operation of the service instance. + * + * @return the exportConfiguration value + */ + public ServiceExportConfigurationInfo exportConfiguration() { + return this.exportConfiguration; + } + + /** + * Set the settings for the export operation of the service instance. + * + * @param exportConfiguration the exportConfiguration value to set + * @return the ServicesProperties object itself. + */ + public ServicesProperties withExportConfiguration(ServiceExportConfigurationInfo exportConfiguration) { + this.exportConfiguration = exportConfiguration; + return this; + } + + /** + * Get the list of private endpoint connections that are set up for this resource. + * + * @return the privateEndpointConnections value + */ + public List privateEndpointConnections() { + return this.privateEndpointConnections; + } + + /** + * Set the list of private endpoint connections that are set up for this resource. + * + * @param privateEndpointConnections the privateEndpointConnections value to set + * @return the ServicesProperties object itself. + */ + public ServicesProperties withPrivateEndpointConnections(List privateEndpointConnections) { + this.privateEndpointConnections = privateEndpointConnections; + return this; + } + + /** + * Get control permission for data plane traffic coming from public networks while private endpoint is enabled. Possible values include: 'Enabled', 'Disabled'. + * + * @return the publicNetworkAccess value + */ + public PublicNetworkAccess publicNetworkAccess() { + return this.publicNetworkAccess; + } + + /** + * Set control permission for data plane traffic coming from public networks while private endpoint is enabled. Possible values include: 'Enabled', 'Disabled'. + * + * @param publicNetworkAccess the publicNetworkAccess value to set + * @return the ServicesProperties object itself. + */ + public ServicesProperties withPublicNetworkAccess(PublicNetworkAccess publicNetworkAccess) { + this.publicNetworkAccess = publicNetworkAccess; + return this; + } + +} diff --git a/sdk/healthcareapis/mgmt-v2020_03_30/src/main/java/com/microsoft/azure/management/healthcareapis/v2020_03_30/ServicesResource.java b/sdk/healthcareapis/mgmt-v2020_03_30/src/main/java/com/microsoft/azure/management/healthcareapis/v2020_03_30/ServicesResource.java new file mode 100644 index 0000000000000..ac7cf66cab4e2 --- /dev/null +++ b/sdk/healthcareapis/mgmt-v2020_03_30/src/main/java/com/microsoft/azure/management/healthcareapis/v2020_03_30/ServicesResource.java @@ -0,0 +1,99 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.healthcareapis.v2020_03_30; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.azure.Resource; + +/** + * The common properties of a service. + */ +public class ServicesResource extends Resource { + /** + * The kind of the service. Possible values include: 'fhir', 'fhir-Stu3', + * 'fhir-R4'. + */ + @JsonProperty(value = "kind", required = true) + private Kind kind; + + /** + * An etag associated with the resource, used for optimistic concurrency + * when editing it. + */ + @JsonProperty(value = "etag") + private String etag; + + /** + * Setting indicating whether the service has a managed identity associated + * with it. + */ + @JsonProperty(value = "identity") + private ServicesResourceIdentity identity; + + /** + * Get the kind of the service. Possible values include: 'fhir', 'fhir-Stu3', 'fhir-R4'. + * + * @return the kind value + */ + public Kind kind() { + return this.kind; + } + + /** + * Set the kind of the service. Possible values include: 'fhir', 'fhir-Stu3', 'fhir-R4'. + * + * @param kind the kind value to set + * @return the ServicesResource object itself. + */ + public ServicesResource withKind(Kind kind) { + this.kind = kind; + return this; + } + + /** + * Get an etag associated with the resource, used for optimistic concurrency when editing it. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + + /** + * Set an etag associated with the resource, used for optimistic concurrency when editing it. + * + * @param etag the etag value to set + * @return the ServicesResource object itself. + */ + public ServicesResource withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Get setting indicating whether the service has a managed identity associated with it. + * + * @return the identity value + */ + public ServicesResourceIdentity identity() { + return this.identity; + } + + /** + * Set setting indicating whether the service has a managed identity associated with it. + * + * @param identity the identity value to set + * @return the ServicesResource object itself. + */ + public ServicesResource withIdentity(ServicesResourceIdentity identity) { + this.identity = identity; + return this; + } + +} diff --git a/sdk/healthcareapis/mgmt-v2020_03_30/src/main/java/com/microsoft/azure/management/healthcareapis/v2020_03_30/ServicesResourceIdentity.java b/sdk/healthcareapis/mgmt-v2020_03_30/src/main/java/com/microsoft/azure/management/healthcareapis/v2020_03_30/ServicesResourceIdentity.java new file mode 100644 index 0000000000000..24ce3766dc5ce --- /dev/null +++ b/sdk/healthcareapis/mgmt-v2020_03_30/src/main/java/com/microsoft/azure/management/healthcareapis/v2020_03_30/ServicesResourceIdentity.java @@ -0,0 +1,75 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.healthcareapis.v2020_03_30; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Setting indicating whether the service has a managed identity associated + * with it. + */ +public class ServicesResourceIdentity { + /** + * The principal ID of the resource identity. + */ + @JsonProperty(value = "principalId", access = JsonProperty.Access.WRITE_ONLY) + private String principalId; + + /** + * The tenant ID of the resource. + */ + @JsonProperty(value = "tenantId", access = JsonProperty.Access.WRITE_ONLY) + private String tenantId; + + /** + * Type of identity being specified, currently SystemAssigned and None are + * allowed. Possible values include: 'SystemAssigned', 'None'. + */ + @JsonProperty(value = "type") + private ManagedServiceIdentityType type; + + /** + * Get the principal ID of the resource identity. + * + * @return the principalId value + */ + public String principalId() { + return this.principalId; + } + + /** + * Get the tenant ID of the resource. + * + * @return the tenantId value + */ + public String tenantId() { + return this.tenantId; + } + + /** + * Get type of identity being specified, currently SystemAssigned and None are allowed. Possible values include: 'SystemAssigned', 'None'. + * + * @return the type value + */ + public ManagedServiceIdentityType type() { + return this.type; + } + + /** + * Set type of identity being specified, currently SystemAssigned and None are allowed. Possible values include: 'SystemAssigned', 'None'. + * + * @param type the type value to set + * @return the ServicesResourceIdentity object itself. + */ + public ServicesResourceIdentity withType(ManagedServiceIdentityType type) { + this.type = type; + return this; + } + +} diff --git a/sdk/healthcareapis/mgmt-v2020_03_30/src/main/java/com/microsoft/azure/management/healthcareapis/v2020_03_30/implementation/ErrorDetailsInner.java b/sdk/healthcareapis/mgmt-v2020_03_30/src/main/java/com/microsoft/azure/management/healthcareapis/v2020_03_30/implementation/ErrorDetailsInner.java new file mode 100644 index 0000000000000..b1a8afb92e714 --- /dev/null +++ b/sdk/healthcareapis/mgmt-v2020_03_30/src/main/java/com/microsoft/azure/management/healthcareapis/v2020_03_30/implementation/ErrorDetailsInner.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.healthcareapis.v2020_03_30.implementation; + +import com.microsoft.azure.management.healthcareapis.v2020_03_30.ErrorDetailsInternal; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Error details. + */ +public class ErrorDetailsInner { + /** + * Object containing error details. + */ + @JsonProperty(value = "error") + private ErrorDetailsInternal error; + + /** + * Get object containing error details. + * + * @return the error value + */ + public ErrorDetailsInternal error() { + return this.error; + } + + /** + * Set object containing error details. + * + * @param error the error value to set + * @return the ErrorDetailsInner object itself. + */ + public ErrorDetailsInner withError(ErrorDetailsInternal error) { + this.error = error; + return this; + } + +} diff --git a/sdk/healthcareapis/mgmt-v2020_03_30/src/main/java/com/microsoft/azure/management/healthcareapis/v2020_03_30/implementation/ErrorDetailsInnerException.java b/sdk/healthcareapis/mgmt-v2020_03_30/src/main/java/com/microsoft/azure/management/healthcareapis/v2020_03_30/implementation/ErrorDetailsInnerException.java new file mode 100644 index 0000000000000..e0bf8a540bd6d --- /dev/null +++ b/sdk/healthcareapis/mgmt-v2020_03_30/src/main/java/com/microsoft/azure/management/healthcareapis/v2020_03_30/implementation/ErrorDetailsInnerException.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.healthcareapis.v2020_03_30.implementation; + +import com.microsoft.rest.RestException; +import okhttp3.ResponseBody; +import retrofit2.Response; + +/** + * Exception thrown for an invalid response with ErrorDetailsInner information. + */ +public class ErrorDetailsInnerException extends RestException { + /** + * Initializes a new instance of the ErrorDetailsInnerException class. + * + * @param message the exception message or the response content if a message is not available + * @param response the HTTP response + */ + public ErrorDetailsInnerException(final String message, final Response response) { + super(message, response); + } + + /** + * Initializes a new instance of the ErrorDetailsInnerException class. + * + * @param message the exception message or the response content if a message is not available + * @param response the HTTP response + * @param body the deserialized response body + */ + public ErrorDetailsInnerException(final String message, final Response response, final ErrorDetailsInner body) { + super(message, response, body); + } + + @Override + public ErrorDetailsInner body() { + return (ErrorDetailsInner) super.body(); + } +} diff --git a/sdk/healthcareapis/mgmt-v2020_03_30/src/main/java/com/microsoft/azure/management/healthcareapis/v2020_03_30/implementation/HealthcareApisManagementClientImpl.java b/sdk/healthcareapis/mgmt-v2020_03_30/src/main/java/com/microsoft/azure/management/healthcareapis/v2020_03_30/implementation/HealthcareApisManagementClientImpl.java new file mode 100644 index 0000000000000..437659a47f993 --- /dev/null +++ b/sdk/healthcareapis/mgmt-v2020_03_30/src/main/java/com/microsoft/azure/management/healthcareapis/v2020_03_30/implementation/HealthcareApisManagementClientImpl.java @@ -0,0 +1,252 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.healthcareapis.v2020_03_30.implementation; + +import com.microsoft.azure.AzureClient; +import com.microsoft.azure.AzureServiceClient; +import com.microsoft.rest.credentials.ServiceClientCredentials; +import com.microsoft.rest.RestClient; + +/** + * Initializes a new instance of the HealthcareApisManagementClientImpl class. + */ +public class HealthcareApisManagementClientImpl extends AzureServiceClient { + /** the {@link AzureClient} used for long running operations. */ + private AzureClient azureClient; + + /** + * Gets the {@link AzureClient} used for long running operations. + * @return the azure client; + */ + public AzureClient getAzureClient() { + return this.azureClient; + } + + /** The subscription identifier. */ + private String subscriptionId; + + /** + * Gets The subscription identifier. + * + * @return the subscriptionId value. + */ + public String subscriptionId() { + return this.subscriptionId; + } + + /** + * Sets The subscription identifier. + * + * @param subscriptionId the subscriptionId value. + * @return the service client itself + */ + public HealthcareApisManagementClientImpl withSubscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; + return this; + } + + /** Client Api Version. */ + private String apiVersion; + + /** + * Gets Client Api Version. + * + * @return the apiVersion value. + */ + public String apiVersion() { + return this.apiVersion; + } + + /** The preferred language for the response. */ + private String acceptLanguage; + + /** + * Gets The preferred language for the response. + * + * @return the acceptLanguage value. + */ + public String acceptLanguage() { + return this.acceptLanguage; + } + + /** + * Sets The preferred language for the response. + * + * @param acceptLanguage the acceptLanguage value. + * @return the service client itself + */ + public HealthcareApisManagementClientImpl withAcceptLanguage(String acceptLanguage) { + this.acceptLanguage = acceptLanguage; + return this; + } + + /** The retry timeout in seconds for Long Running Operations. Default value is 30. */ + private int longRunningOperationRetryTimeout; + + /** + * Gets The retry timeout in seconds for Long Running Operations. Default value is 30. + * + * @return the longRunningOperationRetryTimeout value. + */ + public int longRunningOperationRetryTimeout() { + return this.longRunningOperationRetryTimeout; + } + + /** + * Sets The retry timeout in seconds for Long Running Operations. Default value is 30. + * + * @param longRunningOperationRetryTimeout the longRunningOperationRetryTimeout value. + * @return the service client itself + */ + public HealthcareApisManagementClientImpl withLongRunningOperationRetryTimeout(int longRunningOperationRetryTimeout) { + this.longRunningOperationRetryTimeout = longRunningOperationRetryTimeout; + return this; + } + + /** 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. */ + private boolean generateClientRequestId; + + /** + * Gets 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. + * + * @return the generateClientRequestId value. + */ + public boolean generateClientRequestId() { + return this.generateClientRequestId; + } + + /** + * Sets 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. + * + * @param generateClientRequestId the generateClientRequestId value. + * @return the service client itself + */ + public HealthcareApisManagementClientImpl withGenerateClientRequestId(boolean generateClientRequestId) { + this.generateClientRequestId = generateClientRequestId; + return this; + } + + /** + * The ServicesInner object to access its operations. + */ + private ServicesInner services; + + /** + * Gets the ServicesInner object to access its operations. + * @return the ServicesInner object. + */ + public ServicesInner services() { + return this.services; + } + + /** + * The OperationsInner object to access its operations. + */ + private OperationsInner operations; + + /** + * Gets the OperationsInner object to access its operations. + * @return the OperationsInner object. + */ + public OperationsInner operations() { + return this.operations; + } + + /** + * The OperationResultsInner object to access its operations. + */ + private OperationResultsInner operationResults; + + /** + * Gets the OperationResultsInner object to access its operations. + * @return the OperationResultsInner object. + */ + public OperationResultsInner operationResults() { + return this.operationResults; + } + + /** + * The PrivateEndpointConnectionsInner object to access its operations. + */ + private PrivateEndpointConnectionsInner privateEndpointConnections; + + /** + * Gets the PrivateEndpointConnectionsInner object to access its operations. + * @return the PrivateEndpointConnectionsInner object. + */ + public PrivateEndpointConnectionsInner privateEndpointConnections() { + return this.privateEndpointConnections; + } + + /** + * The PrivateLinkResourcesInner object to access its operations. + */ + private PrivateLinkResourcesInner privateLinkResources; + + /** + * Gets the PrivateLinkResourcesInner object to access its operations. + * @return the PrivateLinkResourcesInner object. + */ + public PrivateLinkResourcesInner privateLinkResources() { + return this.privateLinkResources; + } + + /** + * Initializes an instance of HealthcareApisManagementClient client. + * + * @param credentials the management credentials for Azure + */ + public HealthcareApisManagementClientImpl(ServiceClientCredentials credentials) { + this("https://management.azure.com", credentials); + } + + /** + * Initializes an instance of HealthcareApisManagementClient client. + * + * @param baseUrl the base URL of the host + * @param credentials the management credentials for Azure + */ + public HealthcareApisManagementClientImpl(String baseUrl, ServiceClientCredentials credentials) { + super(baseUrl, credentials); + initialize(); + } + + /** + * Initializes an instance of HealthcareApisManagementClient client. + * + * @param restClient the REST client to connect to Azure. + */ + public HealthcareApisManagementClientImpl(RestClient restClient) { + super(restClient); + initialize(); + } + + protected void initialize() { + this.apiVersion = "2020-03-30"; + this.acceptLanguage = "en-US"; + this.longRunningOperationRetryTimeout = 30; + this.generateClientRequestId = true; + this.services = new ServicesInner(restClient().retrofit(), this); + this.operations = new OperationsInner(restClient().retrofit(), this); + this.operationResults = new OperationResultsInner(restClient().retrofit(), this); + this.privateEndpointConnections = new PrivateEndpointConnectionsInner(restClient().retrofit(), this); + this.privateLinkResources = new PrivateLinkResourcesInner(restClient().retrofit(), this); + this.azureClient = new AzureClient(this); + } + + /** + * Gets the User-Agent header for the client. + * + * @return the user agent string. + */ + @Override + public String userAgent() { + return String.format("%s (%s, %s, auto-generated)", super.userAgent(), "HealthcareApisManagementClient", "2020-03-30"); + } +} diff --git a/sdk/healthcareapis/mgmt-v2020_03_30/src/main/java/com/microsoft/azure/management/healthcareapis/v2020_03_30/implementation/HealthcareApisManager.java b/sdk/healthcareapis/mgmt-v2020_03_30/src/main/java/com/microsoft/azure/management/healthcareapis/v2020_03_30/implementation/HealthcareApisManager.java new file mode 100644 index 0000000000000..8aa9146eaa8d8 --- /dev/null +++ b/sdk/healthcareapis/mgmt-v2020_03_30/src/main/java/com/microsoft/azure/management/healthcareapis/v2020_03_30/implementation/HealthcareApisManager.java @@ -0,0 +1,147 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.healthcareapis.v2020_03_30.implementation; + +import com.microsoft.azure.AzureEnvironment; +import com.microsoft.azure.AzureResponseBuilder; +import com.microsoft.azure.credentials.AzureTokenCredentials; +import com.microsoft.azure.management.apigeneration.Beta; +import com.microsoft.azure.management.apigeneration.Beta.SinceVersion; +import com.microsoft.azure.arm.resources.AzureConfigurable; +import com.microsoft.azure.serializer.AzureJacksonAdapter; +import com.microsoft.rest.RestClient; +import com.microsoft.azure.management.healthcareapis.v2020_03_30.Services; +import com.microsoft.azure.management.healthcareapis.v2020_03_30.Operations; +import com.microsoft.azure.management.healthcareapis.v2020_03_30.OperationResults; +import com.microsoft.azure.management.healthcareapis.v2020_03_30.PrivateEndpointConnections; +import com.microsoft.azure.management.healthcareapis.v2020_03_30.PrivateLinkResources; +import com.microsoft.azure.arm.resources.implementation.AzureConfigurableCoreImpl; +import com.microsoft.azure.arm.resources.implementation.ManagerCore; + +/** + * Entry point to Azure HealthcareApis resource management. + */ +public final class HealthcareApisManager extends ManagerCore { + private Services services; + private Operations operations; + private OperationResults operationResults; + private PrivateEndpointConnections privateEndpointConnections; + private PrivateLinkResources privateLinkResources; + /** + * Get a Configurable instance that can be used to create HealthcareApisManager with optional configuration. + * + * @return the instance allowing configurations + */ + public static Configurable configure() { + return new HealthcareApisManager.ConfigurableImpl(); + } + /** + * Creates an instance of HealthcareApisManager that exposes HealthcareApis resource management API entry points. + * + * @param credentials the credentials to use + * @param subscriptionId the subscription UUID + * @return the HealthcareApisManager + */ + public static HealthcareApisManager authenticate(AzureTokenCredentials credentials, String subscriptionId) { + return new HealthcareApisManager(new RestClient.Builder() + .withBaseUrl(credentials.environment(), AzureEnvironment.Endpoint.RESOURCE_MANAGER) + .withCredentials(credentials) + .withSerializerAdapter(new AzureJacksonAdapter()) + .withResponseBuilderFactory(new AzureResponseBuilder.Factory()) + .build(), subscriptionId); + } + /** + * Creates an instance of HealthcareApisManager that exposes HealthcareApis resource management API entry points. + * + * @param restClient the RestClient to be used for API calls. + * @param subscriptionId the subscription UUID + * @return the HealthcareApisManager + */ + public static HealthcareApisManager authenticate(RestClient restClient, String subscriptionId) { + return new HealthcareApisManager(restClient, subscriptionId); + } + /** + * The interface allowing configurations to be set. + */ + public interface Configurable extends AzureConfigurable { + /** + * Creates an instance of HealthcareApisManager that exposes HealthcareApis management API entry points. + * + * @param credentials the credentials to use + * @param subscriptionId the subscription UUID + * @return the interface exposing HealthcareApis management API entry points that work across subscriptions + */ + HealthcareApisManager authenticate(AzureTokenCredentials credentials, String subscriptionId); + } + + /** + * @return Entry point to manage Services. + */ + public Services services() { + if (this.services == null) { + this.services = new ServicesImpl(this); + } + return this.services; + } + + /** + * @return Entry point to manage Operations. + */ + public Operations operations() { + if (this.operations == null) { + this.operations = new OperationsImpl(this); + } + return this.operations; + } + + /** + * @return Entry point to manage OperationResults. + */ + public OperationResults operationResults() { + if (this.operationResults == null) { + this.operationResults = new OperationResultsImpl(this); + } + return this.operationResults; + } + + /** + * @return Entry point to manage PrivateEndpointConnections. + */ + public PrivateEndpointConnections privateEndpointConnections() { + if (this.privateEndpointConnections == null) { + this.privateEndpointConnections = new PrivateEndpointConnectionsImpl(this); + } + return this.privateEndpointConnections; + } + + /** + * @return Entry point to manage PrivateLinkResources. + */ + public PrivateLinkResources privateLinkResources() { + if (this.privateLinkResources == null) { + this.privateLinkResources = new PrivateLinkResourcesImpl(this); + } + return this.privateLinkResources; + } + + /** + * The implementation for Configurable interface. + */ + private static final class ConfigurableImpl extends AzureConfigurableCoreImpl implements Configurable { + public HealthcareApisManager authenticate(AzureTokenCredentials credentials, String subscriptionId) { + return HealthcareApisManager.authenticate(buildRestClient(credentials), subscriptionId); + } + } + private HealthcareApisManager(RestClient restClient, String subscriptionId) { + super( + restClient, + subscriptionId, + new HealthcareApisManagementClientImpl(restClient).withSubscriptionId(subscriptionId)); + } +} diff --git a/sdk/healthcareapis/mgmt-v2020_03_30/src/main/java/com/microsoft/azure/management/healthcareapis/v2020_03_30/implementation/IdParsingUtils.java b/sdk/healthcareapis/mgmt-v2020_03_30/src/main/java/com/microsoft/azure/management/healthcareapis/v2020_03_30/implementation/IdParsingUtils.java new file mode 100644 index 0000000000000..fa5c586474038 --- /dev/null +++ b/sdk/healthcareapis/mgmt-v2020_03_30/src/main/java/com/microsoft/azure/management/healthcareapis/v2020_03_30/implementation/IdParsingUtils.java @@ -0,0 +1,57 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.healthcareapis.v2020_03_30.implementation; +import java.util.Arrays; +import java.util.Iterator; + +class IdParsingUtils { + public static String getValueFromIdByName(String id, String name) { + if (id == null) { + return null; + } + Iterable iterable = Arrays.asList(id.split("/")); + Iterator itr = iterable.iterator(); + while (itr.hasNext()) { + String part = itr.next(); + if (part != null && part.trim() != "") { + if (part.equalsIgnoreCase(name)) { + if (itr.hasNext()) { + return itr.next(); + } else { + return null; + } + } + } + } + return null; + } + + public static String getValueFromIdByPosition(String id, int pos) { + if (id == null) { + return null; + } + Iterable iterable = Arrays.asList(id.split("/")); + Iterator itr = iterable.iterator(); + int index = 0; + while (itr.hasNext()) { + String part = itr.next(); + if (part != null && part.trim() != "") { + if (index == pos) { + if (itr.hasNext()) { + return itr.next(); + } else { + return null; + } + } + } + index++; + } + return null; + } +} diff --git a/sdk/healthcareapis/mgmt-v2020_03_30/src/main/java/com/microsoft/azure/management/healthcareapis/v2020_03_30/implementation/OperationImpl.java b/sdk/healthcareapis/mgmt-v2020_03_30/src/main/java/com/microsoft/azure/management/healthcareapis/v2020_03_30/implementation/OperationImpl.java new file mode 100644 index 0000000000000..d25ebe45fd576 --- /dev/null +++ b/sdk/healthcareapis/mgmt-v2020_03_30/src/main/java/com/microsoft/azure/management/healthcareapis/v2020_03_30/implementation/OperationImpl.java @@ -0,0 +1,42 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.healthcareapis.v2020_03_30.implementation; + +import com.microsoft.azure.management.healthcareapis.v2020_03_30.Operation; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.healthcareapis.v2020_03_30.OperationDisplay; + +class OperationImpl extends WrapperImpl implements Operation { + private final HealthcareApisManager manager; + OperationImpl(OperationInner inner, HealthcareApisManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public HealthcareApisManager manager() { + return this.manager; + } + + @Override + public OperationDisplay display() { + return this.inner().display(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public String origin() { + return this.inner().origin(); + } + +} diff --git a/sdk/healthcareapis/mgmt-v2020_03_30/src/main/java/com/microsoft/azure/management/healthcareapis/v2020_03_30/implementation/OperationInner.java b/sdk/healthcareapis/mgmt-v2020_03_30/src/main/java/com/microsoft/azure/management/healthcareapis/v2020_03_30/implementation/OperationInner.java new file mode 100644 index 0000000000000..b5cf0818e1564 --- /dev/null +++ b/sdk/healthcareapis/mgmt-v2020_03_30/src/main/java/com/microsoft/azure/management/healthcareapis/v2020_03_30/implementation/OperationInner.java @@ -0,0 +1,74 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.healthcareapis.v2020_03_30.implementation; + +import com.microsoft.azure.management.healthcareapis.v2020_03_30.OperationDisplay; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Service REST API operation. + */ +public class OperationInner { + /** + * Operation name: {provider}/{resource}/{read | write | action | delete}. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /** + * Default value is 'user,system'. + */ + @JsonProperty(value = "origin", access = JsonProperty.Access.WRITE_ONLY) + private String origin; + + /** + * The information displayed about the operation. + */ + @JsonProperty(value = "display") + private OperationDisplay display; + + /** + * Get operation name: {provider}/{resource}/{read | write | action | delete}. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Get default value is 'user,system'. + * + * @return the origin value + */ + public String origin() { + return this.origin; + } + + /** + * Get the information displayed about the operation. + * + * @return the display value + */ + public OperationDisplay display() { + return this.display; + } + + /** + * Set the information displayed about the operation. + * + * @param display the display value to set + * @return the OperationInner object itself. + */ + public OperationInner withDisplay(OperationDisplay display) { + this.display = display; + return this; + } + +} diff --git a/sdk/healthcareapis/mgmt-v2020_03_30/src/main/java/com/microsoft/azure/management/healthcareapis/v2020_03_30/implementation/OperationResultsDescriptionInner.java b/sdk/healthcareapis/mgmt-v2020_03_30/src/main/java/com/microsoft/azure/management/healthcareapis/v2020_03_30/implementation/OperationResultsDescriptionInner.java new file mode 100644 index 0000000000000..bee685a40997b --- /dev/null +++ b/sdk/healthcareapis/mgmt-v2020_03_30/src/main/java/com/microsoft/azure/management/healthcareapis/v2020_03_30/implementation/OperationResultsDescriptionInner.java @@ -0,0 +1,105 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.healthcareapis.v2020_03_30.implementation; + +import com.microsoft.azure.management.healthcareapis.v2020_03_30.OperationResultStatus; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The properties indicating the operation result of an operation on a service. + */ +public class OperationResultsDescriptionInner { + /** + * The ID of the operation returned. + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /** + * The name of the operation result. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /** + * The status of the operation being performed. Possible values include: + * 'Canceled', 'Succeeded', 'Failed', 'Requested', 'Running'. + */ + @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY) + private OperationResultStatus status; + + /** + * The time that the operation was started. + */ + @JsonProperty(value = "startTime", access = JsonProperty.Access.WRITE_ONLY) + private String startTime; + + /** + * Additional properties of the operation result. + */ + @JsonProperty(value = "properties") + private Object properties; + + /** + * Get the ID of the operation returned. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Get the name of the operation result. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Get the status of the operation being performed. Possible values include: 'Canceled', 'Succeeded', 'Failed', 'Requested', 'Running'. + * + * @return the status value + */ + public OperationResultStatus status() { + return this.status; + } + + /** + * Get the time that the operation was started. + * + * @return the startTime value + */ + public String startTime() { + return this.startTime; + } + + /** + * Get additional properties of the operation result. + * + * @return the properties value + */ + public Object properties() { + return this.properties; + } + + /** + * Set additional properties of the operation result. + * + * @param properties the properties value to set + * @return the OperationResultsDescriptionInner object itself. + */ + public OperationResultsDescriptionInner withProperties(Object properties) { + this.properties = properties; + return this; + } + +} diff --git a/sdk/healthcareapis/mgmt-v2020_03_30/src/main/java/com/microsoft/azure/management/healthcareapis/v2020_03_30/implementation/OperationResultsImpl.java b/sdk/healthcareapis/mgmt-v2020_03_30/src/main/java/com/microsoft/azure/management/healthcareapis/v2020_03_30/implementation/OperationResultsImpl.java new file mode 100644 index 0000000000000..5437cbbc36344 --- /dev/null +++ b/sdk/healthcareapis/mgmt-v2020_03_30/src/main/java/com/microsoft/azure/management/healthcareapis/v2020_03_30/implementation/OperationResultsImpl.java @@ -0,0 +1,35 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * abc + */ + +package com.microsoft.azure.management.healthcareapis.v2020_03_30.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.healthcareapis.v2020_03_30.OperationResults; +import rx.functions.Func1; +import rx.Observable; + +class OperationResultsImpl extends WrapperImpl implements OperationResults { + private final HealthcareApisManager manager; + + OperationResultsImpl(HealthcareApisManager manager) { + super(manager.inner().operationResults()); + this.manager = manager; + } + + public HealthcareApisManager manager() { + return this.manager; + } + + @Override + public Observable getAsync(String locationName, String operationResultId) { + OperationResultsInner client = this.inner(); + return client.getAsync(locationName, operationResultId) + ;} + +} diff --git a/sdk/healthcareapis/mgmt-v2020_03_30/src/main/java/com/microsoft/azure/management/healthcareapis/v2020_03_30/implementation/OperationResultsInner.java b/sdk/healthcareapis/mgmt-v2020_03_30/src/main/java/com/microsoft/azure/management/healthcareapis/v2020_03_30/implementation/OperationResultsInner.java new file mode 100644 index 0000000000000..a611fb257b8e0 --- /dev/null +++ b/sdk/healthcareapis/mgmt-v2020_03_30/src/main/java/com/microsoft/azure/management/healthcareapis/v2020_03_30/implementation/OperationResultsInner.java @@ -0,0 +1,146 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.healthcareapis.v2020_03_30.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Path; +import retrofit2.http.Query; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in OperationResults. + */ +public class OperationResultsInner { + /** The Retrofit service to perform REST calls. */ + private OperationResultsService service; + /** The service client containing this operation class. */ + private HealthcareApisManagementClientImpl client; + + /** + * Initializes an instance of OperationResultsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public OperationResultsInner(Retrofit retrofit, HealthcareApisManagementClientImpl client) { + this.service = retrofit.create(OperationResultsService.class); + this.client = client; + } + + /** + * The interface defining all the services for OperationResults to be + * used by Retrofit to perform actually REST calls. + */ + interface OperationResultsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.healthcareapis.v2020_03_30.OperationResults get" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.HealthcareApis/locations/{locationName}/operationresults/{operationResultId}") + Observable> get(@Path("subscriptionId") String subscriptionId, @Path("locationName") String locationName, @Path("operationResultId") String operationResultId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Get the operation result for a long running operation. + * + * @param locationName The location of the operation. + * @param operationResultId The ID of the operation result to get. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorDetailsInnerException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Object object if successful. + */ + public Object get(String locationName, String operationResultId) { + return getWithServiceResponseAsync(locationName, operationResultId).toBlocking().single().body(); + } + + /** + * Get the operation result for a long running operation. + * + * @param locationName The location of the operation. + * @param operationResultId The ID of the operation result to get. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String locationName, String operationResultId, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(locationName, operationResultId), serviceCallback); + } + + /** + * Get the operation result for a long running operation. + * + * @param locationName The location of the operation. + * @param operationResultId The ID of the operation result to get. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Object object + */ + public Observable getAsync(String locationName, String operationResultId) { + return getWithServiceResponseAsync(locationName, operationResultId).map(new Func1, Object>() { + @Override + public Object call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get the operation result for a long running operation. + * + * @param locationName The location of the operation. + * @param operationResultId The ID of the operation result to get. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Object object + */ + public Observable> getWithServiceResponseAsync(String locationName, String operationResultId) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (locationName == null) { + throw new IllegalArgumentException("Parameter locationName is required and cannot be null."); + } + if (operationResultId == null) { + throw new IllegalArgumentException("Parameter operationResultId is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.get(this.client.subscriptionId(), locationName, operationResultId, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws ErrorDetailsInnerException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(404, new TypeToken() { }.getType()) + .registerError(ErrorDetailsInnerException.class) + .build(response); + } + +} diff --git a/sdk/healthcareapis/mgmt-v2020_03_30/src/main/java/com/microsoft/azure/management/healthcareapis/v2020_03_30/implementation/OperationsImpl.java b/sdk/healthcareapis/mgmt-v2020_03_30/src/main/java/com/microsoft/azure/management/healthcareapis/v2020_03_30/implementation/OperationsImpl.java new file mode 100644 index 0000000000000..75ce413495f11 --- /dev/null +++ b/sdk/healthcareapis/mgmt-v2020_03_30/src/main/java/com/microsoft/azure/management/healthcareapis/v2020_03_30/implementation/OperationsImpl.java @@ -0,0 +1,49 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * abc + */ + +package com.microsoft.azure.management.healthcareapis.v2020_03_30.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.healthcareapis.v2020_03_30.Operations; +import rx.functions.Func1; +import rx.Observable; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.healthcareapis.v2020_03_30.Operation; + +class OperationsImpl extends WrapperImpl implements Operations { + private final HealthcareApisManager manager; + + OperationsImpl(HealthcareApisManager manager) { + super(manager.inner().operations()); + this.manager = manager; + } + + public HealthcareApisManager manager() { + return this.manager; + } + + @Override + public Observable listAsync() { + OperationsInner client = this.inner(); + return client.listAsync() + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public Operation call(OperationInner inner) { + return new OperationImpl(inner, manager()); + } + }); + } + +} diff --git a/sdk/healthcareapis/mgmt-v2020_03_30/src/main/java/com/microsoft/azure/management/healthcareapis/v2020_03_30/implementation/OperationsInner.java b/sdk/healthcareapis/mgmt-v2020_03_30/src/main/java/com/microsoft/azure/management/healthcareapis/v2020_03_30/implementation/OperationsInner.java new file mode 100644 index 0000000000000..25cbbededa40e --- /dev/null +++ b/sdk/healthcareapis/mgmt-v2020_03_30/src/main/java/com/microsoft/azure/management/healthcareapis/v2020_03_30/implementation/OperationsInner.java @@ -0,0 +1,282 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.healthcareapis.v2020_03_30.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Operations. + */ +public class OperationsInner { + /** The Retrofit service to perform REST calls. */ + private OperationsService service; + /** The service client containing this operation class. */ + private HealthcareApisManagementClientImpl client; + + /** + * Initializes an instance of OperationsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public OperationsInner(Retrofit retrofit, HealthcareApisManagementClientImpl client) { + this.service = retrofit.create(OperationsService.class); + this.client = client; + } + + /** + * The interface defining all the services for Operations to be + * used by Retrofit to perform actually REST calls. + */ + interface OperationsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.healthcareapis.v2020_03_30.Operations list" }) + @GET("providers/Microsoft.HealthcareApis/operations") + Observable> list(@Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.healthcareapis.v2020_03_30.Operations listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Lists all of the available Healthcare service REST API operations. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorDetailsInnerException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<OperationInner> object if successful. + */ + public PagedList list() { + ServiceResponse> response = listSinglePageAsync().toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all of the available Healthcare service REST API operations. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all of the available Healthcare service REST API operations. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<OperationInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all of the available Healthcare service REST API operations. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<OperationInner> object + */ + public Observable>> listWithServiceResponseAsync() { + return listSinglePageAsync() + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all of the available Healthcare service REST API operations. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<OperationInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync() { + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.list(this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws ErrorDetailsInnerException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorDetailsInnerException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorDetailsInnerException.class) + .build(response); + } + + /** + * Lists all of the available Healthcare service REST API operations. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorDetailsInnerException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<OperationInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all of the available Healthcare service REST API operations. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all of the available Healthcare service REST API operations. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<OperationInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all of the available Healthcare service REST API operations. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<OperationInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all of the available Healthcare service REST API operations. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<OperationInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws ErrorDetailsInnerException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorDetailsInnerException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorDetailsInnerException.class) + .build(response); + } + +} diff --git a/sdk/healthcareapis/mgmt-v2020_03_30/src/main/java/com/microsoft/azure/management/healthcareapis/v2020_03_30/implementation/PageImpl.java b/sdk/healthcareapis/mgmt-v2020_03_30/src/main/java/com/microsoft/azure/management/healthcareapis/v2020_03_30/implementation/PageImpl.java new file mode 100644 index 0000000000000..6c32e3bee48d5 --- /dev/null +++ b/sdk/healthcareapis/mgmt-v2020_03_30/src/main/java/com/microsoft/azure/management/healthcareapis/v2020_03_30/implementation/PageImpl.java @@ -0,0 +1,75 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.healthcareapis.v2020_03_30.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.azure.Page; +import java.util.List; + +/** + * An instance of this class defines a page of Azure resources and a link to + * get the next page of resources, if any. + * + * @param type of Azure resource + */ +public class PageImpl implements Page { + /** + * The link to the next page. + */ + @JsonProperty("nextLink") + private String nextPageLink; + + /** + * The list of items. + */ + @JsonProperty("value") + private List items; + + /** + * Gets the link to the next page. + * + * @return the link to the next page. + */ + @Override + public String nextPageLink() { + return this.nextPageLink; + } + + /** + * Gets the list of items. + * + * @return the list of items in {@link List}. + */ + @Override + public List items() { + return items; + } + + /** + * Sets the link to the next page. + * + * @param nextPageLink the link to the next page. + * @return this Page object itself. + */ + public PageImpl setNextPageLink(String nextPageLink) { + this.nextPageLink = nextPageLink; + return this; + } + + /** + * Sets the list of items. + * + * @param items the list of items in {@link List}. + * @return this Page object itself. + */ + public PageImpl setItems(List items) { + this.items = items; + return this; + } +} diff --git a/sdk/healthcareapis/mgmt-v2020_03_30/src/main/java/com/microsoft/azure/management/healthcareapis/v2020_03_30/implementation/PageImpl1.java b/sdk/healthcareapis/mgmt-v2020_03_30/src/main/java/com/microsoft/azure/management/healthcareapis/v2020_03_30/implementation/PageImpl1.java new file mode 100644 index 0000000000000..523f2eddf0330 --- /dev/null +++ b/sdk/healthcareapis/mgmt-v2020_03_30/src/main/java/com/microsoft/azure/management/healthcareapis/v2020_03_30/implementation/PageImpl1.java @@ -0,0 +1,75 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.healthcareapis.v2020_03_30.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.azure.Page; +import java.util.List; + +/** + * An instance of this class defines a page of Azure resources and a link to + * get the next page of resources, if any. + * + * @param type of Azure resource + */ +public class PageImpl1 implements Page { + /** + * The link to the next page. + */ + @JsonProperty("") + private String nextPageLink; + + /** + * The list of items. + */ + @JsonProperty("value") + private List items; + + /** + * Gets the link to the next page. + * + * @return the link to the next page. + */ + @Override + public String nextPageLink() { + return this.nextPageLink; + } + + /** + * Gets the list of items. + * + * @return the list of items in {@link List}. + */ + @Override + public List items() { + return items; + } + + /** + * Sets the link to the next page. + * + * @param nextPageLink the link to the next page. + * @return this Page object itself. + */ + public PageImpl1 setNextPageLink(String nextPageLink) { + this.nextPageLink = nextPageLink; + return this; + } + + /** + * Sets the list of items. + * + * @param items the list of items in {@link List}. + * @return this Page object itself. + */ + public PageImpl1 setItems(List items) { + this.items = items; + return this; + } +} diff --git a/sdk/healthcareapis/mgmt-v2020_03_30/src/main/java/com/microsoft/azure/management/healthcareapis/v2020_03_30/implementation/PrivateEndpointConnectionImpl.java b/sdk/healthcareapis/mgmt-v2020_03_30/src/main/java/com/microsoft/azure/management/healthcareapis/v2020_03_30/implementation/PrivateEndpointConnectionImpl.java new file mode 100644 index 0000000000000..0071245be1c4e --- /dev/null +++ b/sdk/healthcareapis/mgmt-v2020_03_30/src/main/java/com/microsoft/azure/management/healthcareapis/v2020_03_30/implementation/PrivateEndpointConnectionImpl.java @@ -0,0 +1,130 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.healthcareapis.v2020_03_30.implementation; + +import com.microsoft.azure.management.healthcareapis.v2020_03_30.PrivateEndpointConnection; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import com.microsoft.azure.management.healthcareapis.v2020_03_30.PrivateEndpoint; +import com.microsoft.azure.management.healthcareapis.v2020_03_30.PrivateLinkServiceConnectionState; +import com.microsoft.azure.management.healthcareapis.v2020_03_30.PrivateEndpointConnectionProvisioningState; + +class PrivateEndpointConnectionImpl extends CreatableUpdatableImpl implements PrivateEndpointConnection, PrivateEndpointConnection.Definition, PrivateEndpointConnection.Update { + private final HealthcareApisManager manager; + private String resourceGroupName; + private String resourceName; + private String privateEndpointConnectionName; + + PrivateEndpointConnectionImpl(String name, HealthcareApisManager manager) { + super(name, new PrivateEndpointConnectionInner()); + this.manager = manager; + // Set resource name + this.privateEndpointConnectionName = name; + // + } + + PrivateEndpointConnectionImpl(PrivateEndpointConnectionInner inner, HealthcareApisManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.privateEndpointConnectionName = inner.name(); + // set resource ancestor and positional variables + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.resourceName = IdParsingUtils.getValueFromIdByName(inner.id(), "services"); + this.privateEndpointConnectionName = IdParsingUtils.getValueFromIdByName(inner.id(), "privateEndpointConnections"); + // + } + + @Override + public HealthcareApisManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + PrivateEndpointConnectionsInner client = this.manager().inner().privateEndpointConnections(); + return client.createOrUpdateAsync(this.resourceGroupName, this.resourceName, this.privateEndpointConnectionName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + PrivateEndpointConnectionsInner client = this.manager().inner().privateEndpointConnections(); + return client.createOrUpdateAsync(this.resourceGroupName, this.resourceName, this.privateEndpointConnectionName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + PrivateEndpointConnectionsInner client = this.manager().inner().privateEndpointConnections(); + return client.getAsync(this.resourceGroupName, this.resourceName, this.privateEndpointConnectionName); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public PrivateEndpoint privateEndpoint() { + return this.inner().privateEndpoint(); + } + + @Override + public PrivateLinkServiceConnectionState privateLinkServiceConnectionState() { + return this.inner().privateLinkServiceConnectionState(); + } + + @Override + public PrivateEndpointConnectionProvisioningState provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public String type() { + return this.inner().type(); + } + + @Override + public PrivateEndpointConnectionImpl withExistingService(String resourceGroupName, String resourceName) { + this.resourceGroupName = resourceGroupName; + this.resourceName = resourceName; + return this; + } + + @Override + public PrivateEndpointConnectionImpl withPrivateLinkServiceConnectionState(PrivateLinkServiceConnectionState privateLinkServiceConnectionState) { + this.inner().withPrivateLinkServiceConnectionState(privateLinkServiceConnectionState); + return this; + } + + @Override + public PrivateEndpointConnectionImpl withPrivateEndpoint(PrivateEndpoint privateEndpoint) { + this.inner().withPrivateEndpoint(privateEndpoint); + return this; + } + + @Override + public PrivateEndpointConnectionImpl withProvisioningState(PrivateEndpointConnectionProvisioningState provisioningState) { + this.inner().withProvisioningState(provisioningState); + return this; + } + +} diff --git a/sdk/healthcareapis/mgmt-v2020_03_30/src/main/java/com/microsoft/azure/management/healthcareapis/v2020_03_30/implementation/PrivateEndpointConnectionInner.java b/sdk/healthcareapis/mgmt-v2020_03_30/src/main/java/com/microsoft/azure/management/healthcareapis/v2020_03_30/implementation/PrivateEndpointConnectionInner.java new file mode 100644 index 0000000000000..d9332df719ad4 --- /dev/null +++ b/sdk/healthcareapis/mgmt-v2020_03_30/src/main/java/com/microsoft/azure/management/healthcareapis/v2020_03_30/implementation/PrivateEndpointConnectionInner.java @@ -0,0 +1,103 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.healthcareapis.v2020_03_30.implementation; + +import com.microsoft.azure.management.healthcareapis.v2020_03_30.PrivateEndpoint; +import com.microsoft.azure.management.healthcareapis.v2020_03_30.PrivateLinkServiceConnectionState; +import com.microsoft.azure.management.healthcareapis.v2020_03_30.PrivateEndpointConnectionProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.ProxyResource; + +/** + * The Private Endpoint Connection resource. + */ +@JsonFlatten +public class PrivateEndpointConnectionInner extends ProxyResource { + /** + * The resource of private end point. + */ + @JsonProperty(value = "properties.privateEndpoint") + private PrivateEndpoint privateEndpoint; + + /** + * A collection of information about the state of the connection between + * service consumer and provider. + */ + @JsonProperty(value = "properties.privateLinkServiceConnectionState", required = true) + private PrivateLinkServiceConnectionState privateLinkServiceConnectionState; + + /** + * The provisioning state of the private endpoint connection resource. + * Possible values include: 'Succeeded', 'Creating', 'Deleting', 'Failed'. + */ + @JsonProperty(value = "properties.provisioningState") + private PrivateEndpointConnectionProvisioningState provisioningState; + + /** + * Get the resource of private end point. + * + * @return the privateEndpoint value + */ + public PrivateEndpoint privateEndpoint() { + return this.privateEndpoint; + } + + /** + * Set the resource of private end point. + * + * @param privateEndpoint the privateEndpoint value to set + * @return the PrivateEndpointConnectionInner object itself. + */ + public PrivateEndpointConnectionInner withPrivateEndpoint(PrivateEndpoint privateEndpoint) { + this.privateEndpoint = privateEndpoint; + return this; + } + + /** + * Get a collection of information about the state of the connection between service consumer and provider. + * + * @return the privateLinkServiceConnectionState value + */ + public PrivateLinkServiceConnectionState privateLinkServiceConnectionState() { + return this.privateLinkServiceConnectionState; + } + + /** + * Set a collection of information about the state of the connection between service consumer and provider. + * + * @param privateLinkServiceConnectionState the privateLinkServiceConnectionState value to set + * @return the PrivateEndpointConnectionInner object itself. + */ + public PrivateEndpointConnectionInner withPrivateLinkServiceConnectionState(PrivateLinkServiceConnectionState privateLinkServiceConnectionState) { + this.privateLinkServiceConnectionState = privateLinkServiceConnectionState; + return this; + } + + /** + * Get the provisioning state of the private endpoint connection resource. Possible values include: 'Succeeded', 'Creating', 'Deleting', 'Failed'. + * + * @return the provisioningState value + */ + public PrivateEndpointConnectionProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Set the provisioning state of the private endpoint connection resource. Possible values include: 'Succeeded', 'Creating', 'Deleting', 'Failed'. + * + * @param provisioningState the provisioningState value to set + * @return the PrivateEndpointConnectionInner object itself. + */ + public PrivateEndpointConnectionInner withProvisioningState(PrivateEndpointConnectionProvisioningState provisioningState) { + this.provisioningState = provisioningState; + return this; + } + +} diff --git a/sdk/healthcareapis/mgmt-v2020_03_30/src/main/java/com/microsoft/azure/management/healthcareapis/v2020_03_30/implementation/PrivateEndpointConnectionsImpl.java b/sdk/healthcareapis/mgmt-v2020_03_30/src/main/java/com/microsoft/azure/management/healthcareapis/v2020_03_30/implementation/PrivateEndpointConnectionsImpl.java new file mode 100644 index 0000000000000..53223f0110089 --- /dev/null +++ b/sdk/healthcareapis/mgmt-v2020_03_30/src/main/java/com/microsoft/azure/management/healthcareapis/v2020_03_30/implementation/PrivateEndpointConnectionsImpl.java @@ -0,0 +1,85 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * + */ + +package com.microsoft.azure.management.healthcareapis.v2020_03_30.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.healthcareapis.v2020_03_30.PrivateEndpointConnections; +import rx.Completable; +import rx.Observable; +import rx.functions.Func1; +import java.util.List; +import com.microsoft.azure.management.healthcareapis.v2020_03_30.PrivateEndpointConnection; + +class PrivateEndpointConnectionsImpl extends WrapperImpl implements PrivateEndpointConnections { + private final HealthcareApisManager manager; + + PrivateEndpointConnectionsImpl(HealthcareApisManager manager) { + super(manager.inner().privateEndpointConnections()); + this.manager = manager; + } + + public HealthcareApisManager manager() { + return this.manager; + } + + @Override + public PrivateEndpointConnectionImpl define(String name) { + return wrapModel(name); + } + + private PrivateEndpointConnectionImpl wrapModel(PrivateEndpointConnectionInner inner) { + return new PrivateEndpointConnectionImpl(inner, manager()); + } + + private PrivateEndpointConnectionImpl wrapModel(String name) { + return new PrivateEndpointConnectionImpl(name, this.manager()); + } + + @Override + public Observable listByServiceAsync(String resourceGroupName, String resourceName) { + PrivateEndpointConnectionsInner client = this.inner(); + return client.listByServiceAsync(resourceGroupName, resourceName) + .flatMap(new Func1, Observable>() { + @Override + public Observable call(List innerList) { + return Observable.from(innerList); + } + }) + .map(new Func1() { + @Override + public PrivateEndpointConnection call(PrivateEndpointConnectionInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Observable getAsync(String resourceGroupName, String resourceName, String privateEndpointConnectionName) { + PrivateEndpointConnectionsInner client = this.inner(); + return client.getAsync(resourceGroupName, resourceName, privateEndpointConnectionName) + .flatMap(new Func1>() { + @Override + public Observable call(PrivateEndpointConnectionInner inner) { + if (inner == null) { + return Observable.empty(); + } else { + return Observable.just((PrivateEndpointConnection)wrapModel(inner)); + } + } + }); + } + + @Override + public Completable deleteAsync(String resourceGroupName, String resourceName, String privateEndpointConnectionName) { + PrivateEndpointConnectionsInner client = this.inner(); + return client.deleteAsync(resourceGroupName, resourceName, privateEndpointConnectionName).toCompletable(); + } + +} diff --git a/sdk/healthcareapis/mgmt-v2020_03_30/src/main/java/com/microsoft/azure/management/healthcareapis/v2020_03_30/implementation/PrivateEndpointConnectionsInner.java b/sdk/healthcareapis/mgmt-v2020_03_30/src/main/java/com/microsoft/azure/management/healthcareapis/v2020_03_30/implementation/PrivateEndpointConnectionsInner.java new file mode 100644 index 0000000000000..77b00f22f1b0e --- /dev/null +++ b/sdk/healthcareapis/mgmt-v2020_03_30/src/main/java/com/microsoft/azure/management/healthcareapis/v2020_03_30/implementation/PrivateEndpointConnectionsInner.java @@ -0,0 +1,622 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.healthcareapis.v2020_03_30.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.Path; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in PrivateEndpointConnections. + */ +public class PrivateEndpointConnectionsInner { + /** The Retrofit service to perform REST calls. */ + private PrivateEndpointConnectionsService service; + /** The service client containing this operation class. */ + private HealthcareApisManagementClientImpl client; + + /** + * Initializes an instance of PrivateEndpointConnectionsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public PrivateEndpointConnectionsInner(Retrofit retrofit, HealthcareApisManagementClientImpl client) { + this.service = retrofit.create(PrivateEndpointConnectionsService.class); + this.client = client; + } + + /** + * The interface defining all the services for PrivateEndpointConnections to be + * used by Retrofit to perform actually REST calls. + */ + interface PrivateEndpointConnectionsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.healthcareapis.v2020_03_30.PrivateEndpointConnections listByService" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/services/{resourceName}/privateEndpointConnections") + Observable> listByService(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("resourceName") String resourceName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.healthcareapis.v2020_03_30.PrivateEndpointConnections get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/services/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}") + Observable> get(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("resourceName") String resourceName, @Path("privateEndpointConnectionName") String privateEndpointConnectionName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.healthcareapis.v2020_03_30.PrivateEndpointConnections createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/services/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}") + Observable> createOrUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("resourceName") String resourceName, @Path("privateEndpointConnectionName") String privateEndpointConnectionName, @Query("api-version") String apiVersion, @Body PrivateEndpointConnectionInner properties, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.healthcareapis.v2020_03_30.PrivateEndpointConnections beginCreateOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/services/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}") + Observable> beginCreateOrUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("resourceName") String resourceName, @Path("privateEndpointConnectionName") String privateEndpointConnectionName, @Query("api-version") String apiVersion, @Body PrivateEndpointConnectionInner properties, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.healthcareapis.v2020_03_30.PrivateEndpointConnections delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/services/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("resourceName") String resourceName, @Path("privateEndpointConnectionName") String privateEndpointConnectionName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.healthcareapis.v2020_03_30.PrivateEndpointConnections beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/services/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("resourceName") String resourceName, @Path("privateEndpointConnectionName") String privateEndpointConnectionName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Lists all private endpoint connections for a service. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param resourceName The name of the service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorDetailsInnerException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the List<PrivateEndpointConnectionInner> object if successful. + */ + public List listByService(String resourceGroupName, String resourceName) { + return listByServiceWithServiceResponseAsync(resourceGroupName, resourceName).toBlocking().single().body(); + } + + /** + * Lists all private endpoint connections for a service. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param resourceName The name of the service instance. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByServiceAsync(String resourceGroupName, String resourceName, final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(listByServiceWithServiceResponseAsync(resourceGroupName, resourceName), serviceCallback); + } + + /** + * Lists all private endpoint connections for a service. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param resourceName The name of the service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<PrivateEndpointConnectionInner> object + */ + public Observable> listByServiceAsync(String resourceGroupName, String resourceName) { + return listByServiceWithServiceResponseAsync(resourceGroupName, resourceName).map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all private endpoint connections for a service. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param resourceName The name of the service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<PrivateEndpointConnectionInner> object + */ + public Observable>> listByServiceWithServiceResponseAsync(String resourceGroupName, String resourceName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (resourceName == null) { + throw new IllegalArgumentException("Parameter resourceName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.listByService(this.client.subscriptionId(), resourceGroupName, resourceName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByServiceDelegate(response); + List items = null; + if (result.body() != null) { + items = result.body().items(); + } + ServiceResponse> clientResponse = new ServiceResponse>(items, result.response()); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByServiceDelegate(Response response) throws ErrorDetailsInnerException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorDetailsInnerException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorDetailsInnerException.class) + .build(response); + } + + /** + * Gets the specified private endpoint connection associated with the service. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param resourceName The name of the service instance. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure resource + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorDetailsInnerException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PrivateEndpointConnectionInner object if successful. + */ + public PrivateEndpointConnectionInner get(String resourceGroupName, String resourceName, String privateEndpointConnectionName) { + return getWithServiceResponseAsync(resourceGroupName, resourceName, privateEndpointConnectionName).toBlocking().single().body(); + } + + /** + * Gets the specified private endpoint connection associated with the service. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param resourceName The name of the service instance. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure resource + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String resourceGroupName, String resourceName, String privateEndpointConnectionName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, resourceName, privateEndpointConnectionName), serviceCallback); + } + + /** + * Gets the specified private endpoint connection associated with the service. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param resourceName The name of the service instance. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure resource + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PrivateEndpointConnectionInner object + */ + public Observable getAsync(String resourceGroupName, String resourceName, String privateEndpointConnectionName) { + return getWithServiceResponseAsync(resourceGroupName, resourceName, privateEndpointConnectionName).map(new Func1, PrivateEndpointConnectionInner>() { + @Override + public PrivateEndpointConnectionInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the specified private endpoint connection associated with the service. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param resourceName The name of the service instance. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure resource + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PrivateEndpointConnectionInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String resourceName, String privateEndpointConnectionName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (resourceName == null) { + throw new IllegalArgumentException("Parameter resourceName is required and cannot be null."); + } + if (privateEndpointConnectionName == null) { + throw new IllegalArgumentException("Parameter privateEndpointConnectionName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.get(this.client.subscriptionId(), resourceGroupName, resourceName, privateEndpointConnectionName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws ErrorDetailsInnerException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorDetailsInnerException.class) + .build(response); + } + + /** + * Update the state of the specified private endpoint connection associated with the service. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param resourceName The name of the service instance. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure resource + * @param properties The private endpoint connection properties. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorDetailsInnerException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PrivateEndpointConnectionInner object if successful. + */ + public PrivateEndpointConnectionInner createOrUpdate(String resourceGroupName, String resourceName, String privateEndpointConnectionName, PrivateEndpointConnectionInner properties) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, resourceName, privateEndpointConnectionName, properties).toBlocking().last().body(); + } + + /** + * Update the state of the specified private endpoint connection associated with the service. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param resourceName The name of the service instance. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure resource + * @param properties The private endpoint connection properties. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String resourceGroupName, String resourceName, String privateEndpointConnectionName, PrivateEndpointConnectionInner properties, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, resourceName, privateEndpointConnectionName, properties), serviceCallback); + } + + /** + * Update the state of the specified private endpoint connection associated with the service. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param resourceName The name of the service instance. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure resource + * @param properties The private endpoint connection properties. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createOrUpdateAsync(String resourceGroupName, String resourceName, String privateEndpointConnectionName, PrivateEndpointConnectionInner properties) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, resourceName, privateEndpointConnectionName, properties).map(new Func1, PrivateEndpointConnectionInner>() { + @Override + public PrivateEndpointConnectionInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Update the state of the specified private endpoint connection associated with the service. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param resourceName The name of the service instance. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure resource + * @param properties The private endpoint connection properties. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String resourceName, String privateEndpointConnectionName, PrivateEndpointConnectionInner properties) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (resourceName == null) { + throw new IllegalArgumentException("Parameter resourceName is required and cannot be null."); + } + if (privateEndpointConnectionName == null) { + throw new IllegalArgumentException("Parameter privateEndpointConnectionName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (properties == null) { + throw new IllegalArgumentException("Parameter properties is required and cannot be null."); + } + Validator.validate(properties); + Observable> observable = service.createOrUpdate(this.client.subscriptionId(), resourceGroupName, resourceName, privateEndpointConnectionName, this.client.apiVersion(), properties, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Update the state of the specified private endpoint connection associated with the service. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param resourceName The name of the service instance. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure resource + * @param properties The private endpoint connection properties. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorDetailsInnerException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PrivateEndpointConnectionInner object if successful. + */ + public PrivateEndpointConnectionInner beginCreateOrUpdate(String resourceGroupName, String resourceName, String privateEndpointConnectionName, PrivateEndpointConnectionInner properties) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, resourceName, privateEndpointConnectionName, properties).toBlocking().single().body(); + } + + /** + * Update the state of the specified private endpoint connection associated with the service. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param resourceName The name of the service instance. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure resource + * @param properties The private endpoint connection properties. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginCreateOrUpdateAsync(String resourceGroupName, String resourceName, String privateEndpointConnectionName, PrivateEndpointConnectionInner properties, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, resourceName, privateEndpointConnectionName, properties), serviceCallback); + } + + /** + * Update the state of the specified private endpoint connection associated with the service. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param resourceName The name of the service instance. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure resource + * @param properties The private endpoint connection properties. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PrivateEndpointConnectionInner object + */ + public Observable beginCreateOrUpdateAsync(String resourceGroupName, String resourceName, String privateEndpointConnectionName, PrivateEndpointConnectionInner properties) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, resourceName, privateEndpointConnectionName, properties).map(new Func1, PrivateEndpointConnectionInner>() { + @Override + public PrivateEndpointConnectionInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Update the state of the specified private endpoint connection associated with the service. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param resourceName The name of the service instance. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure resource + * @param properties The private endpoint connection properties. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PrivateEndpointConnectionInner object + */ + public Observable> beginCreateOrUpdateWithServiceResponseAsync(String resourceGroupName, String resourceName, String privateEndpointConnectionName, PrivateEndpointConnectionInner properties) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (resourceName == null) { + throw new IllegalArgumentException("Parameter resourceName is required and cannot be null."); + } + if (privateEndpointConnectionName == null) { + throw new IllegalArgumentException("Parameter privateEndpointConnectionName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (properties == null) { + throw new IllegalArgumentException("Parameter properties is required and cannot be null."); + } + Validator.validate(properties); + return service.beginCreateOrUpdate(this.client.subscriptionId(), resourceGroupName, resourceName, privateEndpointConnectionName, this.client.apiVersion(), properties, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateOrUpdateDelegate(Response response) throws ErrorDetailsInnerException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorDetailsInnerException.class) + .build(response); + } + + /** + * Deletes a private endpoint connection. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param resourceName The name of the service instance. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure resource + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorDetailsInnerException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String resourceName, String privateEndpointConnectionName) { + deleteWithServiceResponseAsync(resourceGroupName, resourceName, privateEndpointConnectionName).toBlocking().last().body(); + } + + /** + * Deletes a private endpoint connection. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param resourceName The name of the service instance. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure resource + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String resourceName, String privateEndpointConnectionName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, resourceName, privateEndpointConnectionName), serviceCallback); + } + + /** + * Deletes a private endpoint connection. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param resourceName The name of the service instance. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure resource + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String resourceName, String privateEndpointConnectionName) { + return deleteWithServiceResponseAsync(resourceGroupName, resourceName, privateEndpointConnectionName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes a private endpoint connection. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param resourceName The name of the service instance. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure resource + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String resourceName, String privateEndpointConnectionName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (resourceName == null) { + throw new IllegalArgumentException("Parameter resourceName is required and cannot be null."); + } + if (privateEndpointConnectionName == null) { + throw new IllegalArgumentException("Parameter privateEndpointConnectionName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Observable> observable = service.delete(this.client.subscriptionId(), resourceGroupName, resourceName, privateEndpointConnectionName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Deletes a private endpoint connection. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param resourceName The name of the service instance. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure resource + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorDetailsInnerException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDelete(String resourceGroupName, String resourceName, String privateEndpointConnectionName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, resourceName, privateEndpointConnectionName).toBlocking().single().body(); + } + + /** + * Deletes a private endpoint connection. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param resourceName The name of the service instance. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure resource + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteAsync(String resourceGroupName, String resourceName, String privateEndpointConnectionName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, resourceName, privateEndpointConnectionName), serviceCallback); + } + + /** + * Deletes a private endpoint connection. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param resourceName The name of the service instance. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure resource + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String resourceName, String privateEndpointConnectionName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, resourceName, privateEndpointConnectionName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes a private endpoint connection. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param resourceName The name of the service instance. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure resource + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String resourceName, String privateEndpointConnectionName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (resourceName == null) { + throw new IllegalArgumentException("Parameter resourceName is required and cannot be null."); + } + if (privateEndpointConnectionName == null) { + throw new IllegalArgumentException("Parameter privateEndpointConnectionName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.beginDelete(this.client.subscriptionId(), resourceGroupName, resourceName, privateEndpointConnectionName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteDelegate(Response response) throws ErrorDetailsInnerException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(ErrorDetailsInnerException.class) + .build(response); + } + +} diff --git a/sdk/healthcareapis/mgmt-v2020_03_30/src/main/java/com/microsoft/azure/management/healthcareapis/v2020_03_30/implementation/PrivateLinkResourceImpl.java b/sdk/healthcareapis/mgmt-v2020_03_30/src/main/java/com/microsoft/azure/management/healthcareapis/v2020_03_30/implementation/PrivateLinkResourceImpl.java new file mode 100644 index 0000000000000..26045c7888228 --- /dev/null +++ b/sdk/healthcareapis/mgmt-v2020_03_30/src/main/java/com/microsoft/azure/management/healthcareapis/v2020_03_30/implementation/PrivateLinkResourceImpl.java @@ -0,0 +1,74 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.healthcareapis.v2020_03_30.implementation; + +import com.microsoft.azure.management.healthcareapis.v2020_03_30.PrivateLinkResource; +import com.microsoft.azure.arm.model.implementation.IndexableRefreshableWrapperImpl; +import rx.Observable; +import java.util.List; + +class PrivateLinkResourceImpl extends IndexableRefreshableWrapperImpl implements PrivateLinkResource { + private final HealthcareApisManager manager; + private String resourceGroupName; + private String resourceName; + private String groupName; + + PrivateLinkResourceImpl(PrivateLinkResourceInner inner, HealthcareApisManager manager) { + super(null, inner); + this.manager = manager; + // set resource ancestor and positional variables + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.resourceName = IdParsingUtils.getValueFromIdByName(inner.id(), "services"); + this.groupName = IdParsingUtils.getValueFromIdByName(inner.id(), "privateLinkResources"); + } + + @Override + public HealthcareApisManager manager() { + return this.manager; + } + + @Override + protected Observable getInnerAsync() { + PrivateLinkResourcesInner client = this.manager().inner().privateLinkResources(); + return client.getAsync(this.resourceGroupName, this.resourceName, this.groupName); + } + + + + @Override + public String groupId() { + return this.inner().groupId(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public List requiredMembers() { + return this.inner().requiredMembers(); + } + + @Override + public List requiredZoneNames() { + return this.inner().requiredZoneNames(); + } + + @Override + public String type() { + return this.inner().type(); + } + +} diff --git a/sdk/healthcareapis/mgmt-v2020_03_30/src/main/java/com/microsoft/azure/management/healthcareapis/v2020_03_30/implementation/PrivateLinkResourceInner.java b/sdk/healthcareapis/mgmt-v2020_03_30/src/main/java/com/microsoft/azure/management/healthcareapis/v2020_03_30/implementation/PrivateLinkResourceInner.java new file mode 100644 index 0000000000000..acde911629478 --- /dev/null +++ b/sdk/healthcareapis/mgmt-v2020_03_30/src/main/java/com/microsoft/azure/management/healthcareapis/v2020_03_30/implementation/PrivateLinkResourceInner.java @@ -0,0 +1,77 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.healthcareapis.v2020_03_30.implementation; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.ProxyResource; + +/** + * A private link resource. + */ +@JsonFlatten +public class PrivateLinkResourceInner extends ProxyResource { + /** + * The private link resource group id. + */ + @JsonProperty(value = "properties.groupId", access = JsonProperty.Access.WRITE_ONLY) + private String groupId; + + /** + * The private link resource required member names. + */ + @JsonProperty(value = "properties.requiredMembers", access = JsonProperty.Access.WRITE_ONLY) + private List requiredMembers; + + /** + * The private link resource Private link DNS zone name. + */ + @JsonProperty(value = "properties.requiredZoneNames") + private List requiredZoneNames; + + /** + * Get the private link resource group id. + * + * @return the groupId value + */ + public String groupId() { + return this.groupId; + } + + /** + * Get the private link resource required member names. + * + * @return the requiredMembers value + */ + public List requiredMembers() { + return this.requiredMembers; + } + + /** + * Get the private link resource Private link DNS zone name. + * + * @return the requiredZoneNames value + */ + public List requiredZoneNames() { + return this.requiredZoneNames; + } + + /** + * Set the private link resource Private link DNS zone name. + * + * @param requiredZoneNames the requiredZoneNames value to set + * @return the PrivateLinkResourceInner object itself. + */ + public PrivateLinkResourceInner withRequiredZoneNames(List requiredZoneNames) { + this.requiredZoneNames = requiredZoneNames; + return this; + } + +} diff --git a/sdk/healthcareapis/mgmt-v2020_03_30/src/main/java/com/microsoft/azure/management/healthcareapis/v2020_03_30/implementation/PrivateLinkResourceListResultImpl.java b/sdk/healthcareapis/mgmt-v2020_03_30/src/main/java/com/microsoft/azure/management/healthcareapis/v2020_03_30/implementation/PrivateLinkResourceListResultImpl.java new file mode 100644 index 0000000000000..53b2c0dc18beb --- /dev/null +++ b/sdk/healthcareapis/mgmt-v2020_03_30/src/main/java/com/microsoft/azure/management/healthcareapis/v2020_03_30/implementation/PrivateLinkResourceListResultImpl.java @@ -0,0 +1,32 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.healthcareapis.v2020_03_30.implementation; + +import com.microsoft.azure.management.healthcareapis.v2020_03_30.PrivateLinkResourceListResult; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import java.util.List; + +class PrivateLinkResourceListResultImpl extends WrapperImpl implements PrivateLinkResourceListResult { + private final HealthcareApisManager manager; + PrivateLinkResourceListResultImpl(PrivateLinkResourceListResultInner inner, HealthcareApisManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public HealthcareApisManager manager() { + return this.manager; + } + + @Override + public List value() { + return this.inner().value(); + } + +} diff --git a/sdk/healthcareapis/mgmt-v2020_03_30/src/main/java/com/microsoft/azure/management/healthcareapis/v2020_03_30/implementation/PrivateLinkResourceListResultInner.java b/sdk/healthcareapis/mgmt-v2020_03_30/src/main/java/com/microsoft/azure/management/healthcareapis/v2020_03_30/implementation/PrivateLinkResourceListResultInner.java new file mode 100644 index 0000000000000..a7a8c6d56a91b --- /dev/null +++ b/sdk/healthcareapis/mgmt-v2020_03_30/src/main/java/com/microsoft/azure/management/healthcareapis/v2020_03_30/implementation/PrivateLinkResourceListResultInner.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.healthcareapis.v2020_03_30.implementation; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * A list of private link resources. + */ +public class PrivateLinkResourceListResultInner { + /** + * Array of private link resources. + */ + @JsonProperty(value = "value") + private List value; + + /** + * Get array of private link resources. + * + * @return the value value + */ + public List value() { + return this.value; + } + + /** + * Set array of private link resources. + * + * @param value the value value to set + * @return the PrivateLinkResourceListResultInner object itself. + */ + public PrivateLinkResourceListResultInner withValue(List value) { + this.value = value; + return this; + } + +} diff --git a/sdk/healthcareapis/mgmt-v2020_03_30/src/main/java/com/microsoft/azure/management/healthcareapis/v2020_03_30/implementation/PrivateLinkResourcesImpl.java b/sdk/healthcareapis/mgmt-v2020_03_30/src/main/java/com/microsoft/azure/management/healthcareapis/v2020_03_30/implementation/PrivateLinkResourcesImpl.java new file mode 100644 index 0000000000000..998151e5d8e89 --- /dev/null +++ b/sdk/healthcareapis/mgmt-v2020_03_30/src/main/java/com/microsoft/azure/management/healthcareapis/v2020_03_30/implementation/PrivateLinkResourcesImpl.java @@ -0,0 +1,63 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * + */ + +package com.microsoft.azure.management.healthcareapis.v2020_03_30.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.healthcareapis.v2020_03_30.PrivateLinkResources; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.management.healthcareapis.v2020_03_30.PrivateLinkResourceListResult; +import com.microsoft.azure.management.healthcareapis.v2020_03_30.PrivateLinkResource; + +class PrivateLinkResourcesImpl extends WrapperImpl implements PrivateLinkResources { + private final HealthcareApisManager manager; + + PrivateLinkResourcesImpl(HealthcareApisManager manager) { + super(manager.inner().privateLinkResources()); + this.manager = manager; + } + + public HealthcareApisManager manager() { + return this.manager; + } + + private PrivateLinkResourceImpl wrapModel(PrivateLinkResourceInner inner) { + return new PrivateLinkResourceImpl(inner, manager()); + } + + @Override + public Observable listByServiceAsync(String resourceGroupName, String resourceName) { + PrivateLinkResourcesInner client = this.inner(); + return client.listByServiceAsync(resourceGroupName, resourceName) + .map(new Func1() { + @Override + public PrivateLinkResourceListResult call(PrivateLinkResourceListResultInner inner) { + return new PrivateLinkResourceListResultImpl(inner, manager()); + } + }); + } + + @Override + public Observable getAsync(String resourceGroupName, String resourceName, String groupName) { + PrivateLinkResourcesInner client = this.inner(); + return client.getAsync(resourceGroupName, resourceName, groupName) + .flatMap(new Func1>() { + @Override + public Observable call(PrivateLinkResourceInner inner) { + if (inner == null) { + return Observable.empty(); + } else { + return Observable.just((PrivateLinkResource)wrapModel(inner)); + } + } + }); + } + +} diff --git a/sdk/healthcareapis/mgmt-v2020_03_30/src/main/java/com/microsoft/azure/management/healthcareapis/v2020_03_30/implementation/PrivateLinkResourcesInner.java b/sdk/healthcareapis/mgmt-v2020_03_30/src/main/java/com/microsoft/azure/management/healthcareapis/v2020_03_30/implementation/PrivateLinkResourcesInner.java new file mode 100644 index 0000000000000..5a3f8cee8ed29 --- /dev/null +++ b/sdk/healthcareapis/mgmt-v2020_03_30/src/main/java/com/microsoft/azure/management/healthcareapis/v2020_03_30/implementation/PrivateLinkResourcesInner.java @@ -0,0 +1,242 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.healthcareapis.v2020_03_30.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Path; +import retrofit2.http.Query; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in PrivateLinkResources. + */ +public class PrivateLinkResourcesInner { + /** The Retrofit service to perform REST calls. */ + private PrivateLinkResourcesService service; + /** The service client containing this operation class. */ + private HealthcareApisManagementClientImpl client; + + /** + * Initializes an instance of PrivateLinkResourcesInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public PrivateLinkResourcesInner(Retrofit retrofit, HealthcareApisManagementClientImpl client) { + this.service = retrofit.create(PrivateLinkResourcesService.class); + this.client = client; + } + + /** + * The interface defining all the services for PrivateLinkResources to be + * used by Retrofit to perform actually REST calls. + */ + interface PrivateLinkResourcesService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.healthcareapis.v2020_03_30.PrivateLinkResources listByService" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/services/{resourceName}/privateLinkResources") + Observable> listByService(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("resourceName") String resourceName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.healthcareapis.v2020_03_30.PrivateLinkResources get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/services/{resourceName}/privateLinkResources/{groupName}") + Observable> get(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("resourceName") String resourceName, @Path("groupName") String groupName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Gets the private link resources that need to be created for a service. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param resourceName The name of the service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorDetailsInnerException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PrivateLinkResourceListResultInner object if successful. + */ + public PrivateLinkResourceListResultInner listByService(String resourceGroupName, String resourceName) { + return listByServiceWithServiceResponseAsync(resourceGroupName, resourceName).toBlocking().single().body(); + } + + /** + * Gets the private link resources that need to be created for a service. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param resourceName The name of the service instance. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture listByServiceAsync(String resourceGroupName, String resourceName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(listByServiceWithServiceResponseAsync(resourceGroupName, resourceName), serviceCallback); + } + + /** + * Gets the private link resources that need to be created for a service. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param resourceName The name of the service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PrivateLinkResourceListResultInner object + */ + public Observable listByServiceAsync(String resourceGroupName, String resourceName) { + return listByServiceWithServiceResponseAsync(resourceGroupName, resourceName).map(new Func1, PrivateLinkResourceListResultInner>() { + @Override + public PrivateLinkResourceListResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the private link resources that need to be created for a service. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param resourceName The name of the service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PrivateLinkResourceListResultInner object + */ + public Observable> listByServiceWithServiceResponseAsync(String resourceGroupName, String resourceName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (resourceName == null) { + throw new IllegalArgumentException("Parameter resourceName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.listByService(this.client.subscriptionId(), resourceGroupName, resourceName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = listByServiceDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse listByServiceDelegate(Response response) throws ErrorDetailsInnerException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorDetailsInnerException.class) + .build(response); + } + + /** + * Gets a private link resource that need to be created for a service. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param resourceName The name of the service instance. + * @param groupName The name of the private link resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorDetailsInnerException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PrivateLinkResourceInner object if successful. + */ + public PrivateLinkResourceInner get(String resourceGroupName, String resourceName, String groupName) { + return getWithServiceResponseAsync(resourceGroupName, resourceName, groupName).toBlocking().single().body(); + } + + /** + * Gets a private link resource that need to be created for a service. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param resourceName The name of the service instance. + * @param groupName The name of the private link resource group. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String resourceGroupName, String resourceName, String groupName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, resourceName, groupName), serviceCallback); + } + + /** + * Gets a private link resource that need to be created for a service. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param resourceName The name of the service instance. + * @param groupName The name of the private link resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PrivateLinkResourceInner object + */ + public Observable getAsync(String resourceGroupName, String resourceName, String groupName) { + return getWithServiceResponseAsync(resourceGroupName, resourceName, groupName).map(new Func1, PrivateLinkResourceInner>() { + @Override + public PrivateLinkResourceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets a private link resource that need to be created for a service. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param resourceName The name of the service instance. + * @param groupName The name of the private link resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PrivateLinkResourceInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String resourceName, String groupName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (resourceName == null) { + throw new IllegalArgumentException("Parameter resourceName is required and cannot be null."); + } + if (groupName == null) { + throw new IllegalArgumentException("Parameter groupName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.get(this.client.subscriptionId(), resourceGroupName, resourceName, groupName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws ErrorDetailsInnerException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorDetailsInnerException.class) + .build(response); + } + +} diff --git a/sdk/healthcareapis/mgmt-v2020_03_30/src/main/java/com/microsoft/azure/management/healthcareapis/v2020_03_30/implementation/ServicesDescriptionImpl.java b/sdk/healthcareapis/mgmt-v2020_03_30/src/main/java/com/microsoft/azure/management/healthcareapis/v2020_03_30/implementation/ServicesDescriptionImpl.java new file mode 100644 index 0000000000000..5f7f5fc70c73a --- /dev/null +++ b/sdk/healthcareapis/mgmt-v2020_03_30/src/main/java/com/microsoft/azure/management/healthcareapis/v2020_03_30/implementation/ServicesDescriptionImpl.java @@ -0,0 +1,121 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.healthcareapis.v2020_03_30.implementation; + +import com.microsoft.azure.arm.resources.models.implementation.GroupableResourceCoreImpl; +import com.microsoft.azure.management.healthcareapis.v2020_03_30.ServicesDescription; +import rx.Observable; +import com.microsoft.azure.management.healthcareapis.v2020_03_30.ServicesPatchDescription; +import com.microsoft.azure.management.healthcareapis.v2020_03_30.Kind; +import com.microsoft.azure.management.healthcareapis.v2020_03_30.ServicesResourceIdentity; +import com.microsoft.azure.management.healthcareapis.v2020_03_30.ServicesProperties; +import com.microsoft.azure.management.healthcareapis.v2020_03_30.PublicNetworkAccess; +import rx.functions.Func1; + +class ServicesDescriptionImpl extends GroupableResourceCoreImpl implements ServicesDescription, ServicesDescription.Definition, ServicesDescription.Update { + private ServicesPatchDescription updateParameter; + ServicesDescriptionImpl(String name, ServicesDescriptionInner inner, HealthcareApisManager manager) { + super(name, inner, manager); + this.updateParameter = new ServicesPatchDescription(); + } + + @Override + public Observable createResourceAsync() { + ServicesInner client = this.manager().inner().services(); + return client.createOrUpdateAsync(this.resourceGroupName(), this.name(), this.inner()) + .map(new Func1() { + @Override + public ServicesDescriptionInner call(ServicesDescriptionInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + ServicesInner client = this.manager().inner().services(); + return client.updateAsync(this.resourceGroupName(), this.name(), this.updateParameter) + .map(new Func1() { + @Override + public ServicesDescriptionInner call(ServicesDescriptionInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + ServicesInner client = this.manager().inner().services(); + return client.getByResourceGroupAsync(this.resourceGroupName(), this.name()); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + private void resetCreateUpdateParameters() { + this.updateParameter = new ServicesPatchDescription(); + } + + @Override + public String etag() { + return this.inner().etag(); + } + + @Override + public ServicesResourceIdentity identity() { + return this.inner().identity(); + } + + @Override + public Kind kind() { + return this.inner().kind(); + } + + @Override + public ServicesProperties properties() { + return this.inner().properties(); + } + + @Override + public ServicesDescriptionImpl withKind(Kind kind) { + this.inner().withKind(kind); + return this; + } + + @Override + public ServicesDescriptionImpl withEtag(String etag) { + this.inner().withEtag(etag); + return this; + } + + @Override + public ServicesDescriptionImpl withIdentity(ServicesResourceIdentity identity) { + this.inner().withIdentity(identity); + return this; + } + + @Override + public ServicesDescriptionImpl withProperties(ServicesProperties properties) { + this.inner().withProperties(properties); + return this; + } + + @Override + public ServicesDescriptionImpl withPublicNetworkAccess(PublicNetworkAccess publicNetworkAccess) { + this.updateParameter.withPublicNetworkAccess(publicNetworkAccess); + return this; + } + +} diff --git a/sdk/healthcareapis/mgmt-v2020_03_30/src/main/java/com/microsoft/azure/management/healthcareapis/v2020_03_30/implementation/ServicesDescriptionInner.java b/sdk/healthcareapis/mgmt-v2020_03_30/src/main/java/com/microsoft/azure/management/healthcareapis/v2020_03_30/implementation/ServicesDescriptionInner.java new file mode 100644 index 0000000000000..86ef433beb97f --- /dev/null +++ b/sdk/healthcareapis/mgmt-v2020_03_30/src/main/java/com/microsoft/azure/management/healthcareapis/v2020_03_30/implementation/ServicesDescriptionInner.java @@ -0,0 +1,45 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.healthcareapis.v2020_03_30.implementation; + +import com.microsoft.azure.management.healthcareapis.v2020_03_30.ServicesProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.azure.management.healthcareapis.v2020_03_30.ServicesResource; + +/** + * The description of the service. + */ +public class ServicesDescriptionInner extends ServicesResource { + /** + * The common properties of a service. + */ + @JsonProperty(value = "properties") + private ServicesProperties properties; + + /** + * Get the common properties of a service. + * + * @return the properties value + */ + public ServicesProperties properties() { + return this.properties; + } + + /** + * Set the common properties of a service. + * + * @param properties the properties value to set + * @return the ServicesDescriptionInner object itself. + */ + public ServicesDescriptionInner withProperties(ServicesProperties properties) { + this.properties = properties; + return this; + } + +} diff --git a/sdk/healthcareapis/mgmt-v2020_03_30/src/main/java/com/microsoft/azure/management/healthcareapis/v2020_03_30/implementation/ServicesImpl.java b/sdk/healthcareapis/mgmt-v2020_03_30/src/main/java/com/microsoft/azure/management/healthcareapis/v2020_03_30/implementation/ServicesImpl.java new file mode 100644 index 0000000000000..4235f70760ef0 --- /dev/null +++ b/sdk/healthcareapis/mgmt-v2020_03_30/src/main/java/com/microsoft/azure/management/healthcareapis/v2020_03_30/implementation/ServicesImpl.java @@ -0,0 +1,152 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * def + */ + +package com.microsoft.azure.management.healthcareapis.v2020_03_30.implementation; + +import com.microsoft.azure.arm.resources.collection.implementation.GroupableResourcesCoreImpl; +import com.microsoft.azure.management.healthcareapis.v2020_03_30.Services; +import com.microsoft.azure.management.healthcareapis.v2020_03_30.ServicesDescription; +import rx.Observable; +import rx.Completable; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import com.microsoft.azure.arm.resources.ResourceUtilsCore; +import com.microsoft.azure.arm.utils.RXMapper; +import rx.functions.Func1; +import com.microsoft.azure.PagedList; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.healthcareapis.v2020_03_30.ServicesNameAvailabilityInfo; +import com.microsoft.azure.management.healthcareapis.v2020_03_30.CheckNameAvailabilityParameters; + +class ServicesImpl extends GroupableResourcesCoreImpl implements Services { + protected ServicesImpl(HealthcareApisManager manager) { + super(manager.inner().services(), manager); + } + + @Override + protected Observable getInnerAsync(String resourceGroupName, String name) { + ServicesInner client = this.inner(); + return client.getByResourceGroupAsync(resourceGroupName, name); + } + + @Override + protected Completable deleteInnerAsync(String resourceGroupName, String name) { + ServicesInner client = this.inner(); + return client.deleteAsync(resourceGroupName, name).toCompletable(); + } + + @Override + public Observable deleteByIdsAsync(Collection ids) { + if (ids == null || ids.isEmpty()) { + return Observable.empty(); + } + Collection> observables = new ArrayList<>(); + for (String id : ids) { + final String resourceGroupName = ResourceUtilsCore.groupFromResourceId(id); + final String name = ResourceUtilsCore.nameFromResourceId(id); + Observable o = RXMapper.map(this.inner().deleteAsync(resourceGroupName, name), id); + observables.add(o); + } + return Observable.mergeDelayError(observables); + } + + @Override + public Observable deleteByIdsAsync(String...ids) { + return this.deleteByIdsAsync(new ArrayList(Arrays.asList(ids))); + } + + @Override + public void deleteByIds(Collection ids) { + if (ids != null && !ids.isEmpty()) { + this.deleteByIdsAsync(ids).toBlocking().last(); + } + } + + @Override + public void deleteByIds(String...ids) { + this.deleteByIds(new ArrayList(Arrays.asList(ids))); + } + + @Override + public PagedList listByResourceGroup(String resourceGroupName) { + ServicesInner client = this.inner(); + return this.wrapList(client.listByResourceGroup(resourceGroupName)); + } + + @Override + public Observable listByResourceGroupAsync(String resourceGroupName) { + ServicesInner client = this.inner(); + return client.listByResourceGroupAsync(resourceGroupName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public ServicesDescription call(ServicesDescriptionInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public PagedList list() { + ServicesInner client = this.inner(); + return this.wrapList(client.list()); + } + + @Override + public Observable listAsync() { + ServicesInner client = this.inner(); + return client.listAsync() + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public ServicesDescription call(ServicesDescriptionInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public ServicesDescriptionImpl define(String name) { + return wrapModel(name); + } + + @Override + public Observable checkNameAvailabilityAsync(CheckNameAvailabilityParameters checkNameAvailabilityInputs) { + ServicesInner client = this.inner(); + return client.checkNameAvailabilityAsync(checkNameAvailabilityInputs) + .map(new Func1() { + @Override + public ServicesNameAvailabilityInfo call(ServicesNameAvailabilityInfoInner inner) { + return new ServicesNameAvailabilityInfoImpl(inner, manager()); + } + }); + } + + @Override + protected ServicesDescriptionImpl wrapModel(ServicesDescriptionInner inner) { + return new ServicesDescriptionImpl(inner.name(), inner, manager()); + } + + @Override + protected ServicesDescriptionImpl wrapModel(String name) { + return new ServicesDescriptionImpl(name, new ServicesDescriptionInner(), this.manager()); + } + +} diff --git a/sdk/healthcareapis/mgmt-v2020_03_30/src/main/java/com/microsoft/azure/management/healthcareapis/v2020_03_30/implementation/ServicesInner.java b/sdk/healthcareapis/mgmt-v2020_03_30/src/main/java/com/microsoft/azure/management/healthcareapis/v2020_03_30/implementation/ServicesInner.java new file mode 100644 index 0000000000000..88580467f4fa6 --- /dev/null +++ b/sdk/healthcareapis/mgmt-v2020_03_30/src/main/java/com/microsoft/azure/management/healthcareapis/v2020_03_30/implementation/ServicesInner.java @@ -0,0 +1,1227 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.healthcareapis.v2020_03_30.implementation; + +import com.microsoft.azure.arm.collection.InnerSupportsGet; +import com.microsoft.azure.arm.collection.InnerSupportsDelete; +import com.microsoft.azure.arm.collection.InnerSupportsListing; +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.healthcareapis.v2020_03_30.CheckNameAvailabilityParameters; +import com.microsoft.azure.management.healthcareapis.v2020_03_30.ServicesPatchDescription; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.PATCH; +import retrofit2.http.Path; +import retrofit2.http.POST; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Services. + */ +public class ServicesInner implements InnerSupportsGet, InnerSupportsDelete, InnerSupportsListing { + /** The Retrofit service to perform REST calls. */ + private ServicesService service; + /** The service client containing this operation class. */ + private HealthcareApisManagementClientImpl client; + + /** + * Initializes an instance of ServicesInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public ServicesInner(Retrofit retrofit, HealthcareApisManagementClientImpl client) { + this.service = retrofit.create(ServicesService.class); + this.client = client; + } + + /** + * The interface defining all the services for Services to be + * used by Retrofit to perform actually REST calls. + */ + interface ServicesService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.healthcareapis.v2020_03_30.Services getByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/services/{resourceName}") + Observable> getByResourceGroup(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("resourceName") String resourceName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.healthcareapis.v2020_03_30.Services createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/services/{resourceName}") + Observable> createOrUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("resourceName") String resourceName, @Query("api-version") String apiVersion, @Body ServicesDescriptionInner serviceDescription, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.healthcareapis.v2020_03_30.Services beginCreateOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/services/{resourceName}") + Observable> beginCreateOrUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("resourceName") String resourceName, @Query("api-version") String apiVersion, @Body ServicesDescriptionInner serviceDescription, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.healthcareapis.v2020_03_30.Services update" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/services/{resourceName}") + Observable> update(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("resourceName") String resourceName, @Query("api-version") String apiVersion, @Body ServicesPatchDescription servicePatchDescription, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.healthcareapis.v2020_03_30.Services beginUpdate" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/services/{resourceName}") + Observable> beginUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("resourceName") String resourceName, @Query("api-version") String apiVersion, @Body ServicesPatchDescription servicePatchDescription, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.healthcareapis.v2020_03_30.Services delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/services/{resourceName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("resourceName") String resourceName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.healthcareapis.v2020_03_30.Services beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/services/{resourceName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("resourceName") String resourceName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.healthcareapis.v2020_03_30.Services list" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.HealthcareApis/services") + Observable> list(@Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.healthcareapis.v2020_03_30.Services listByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/services") + Observable> listByResourceGroup(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.healthcareapis.v2020_03_30.Services checkNameAvailability" }) + @POST("subscriptions/{subscriptionId}/providers/Microsoft.HealthcareApis/checkNameAvailability") + Observable> checkNameAvailability(@Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Body CheckNameAvailabilityParameters checkNameAvailabilityInputs, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.healthcareapis.v2020_03_30.Services listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.healthcareapis.v2020_03_30.Services listByResourceGroupNext" }) + @GET + Observable> listByResourceGroupNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Get the metadata of a service instance. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param resourceName The name of the service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorDetailsInnerException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ServicesDescriptionInner object if successful. + */ + public ServicesDescriptionInner getByResourceGroup(String resourceGroupName, String resourceName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, resourceName).toBlocking().single().body(); + } + + /** + * Get the metadata of a service instance. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param resourceName The name of the service instance. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getByResourceGroupAsync(String resourceGroupName, String resourceName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getByResourceGroupWithServiceResponseAsync(resourceGroupName, resourceName), serviceCallback); + } + + /** + * Get the metadata of a service instance. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param resourceName The name of the service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ServicesDescriptionInner object + */ + public Observable getByResourceGroupAsync(String resourceGroupName, String resourceName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, resourceName).map(new Func1, ServicesDescriptionInner>() { + @Override + public ServicesDescriptionInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get the metadata of a service instance. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param resourceName The name of the service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ServicesDescriptionInner object + */ + public Observable> getByResourceGroupWithServiceResponseAsync(String resourceGroupName, String resourceName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (resourceName == null) { + throw new IllegalArgumentException("Parameter resourceName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.getByResourceGroup(this.client.subscriptionId(), resourceGroupName, resourceName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getByResourceGroupDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getByResourceGroupDelegate(Response response) throws ErrorDetailsInnerException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorDetailsInnerException.class) + .build(response); + } + + /** + * Create or update the metadata of a service instance. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param resourceName The name of the service instance. + * @param serviceDescription The service instance metadata. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorDetailsInnerException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ServicesDescriptionInner object if successful. + */ + public ServicesDescriptionInner createOrUpdate(String resourceGroupName, String resourceName, ServicesDescriptionInner serviceDescription) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, resourceName, serviceDescription).toBlocking().last().body(); + } + + /** + * Create or update the metadata of a service instance. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param resourceName The name of the service instance. + * @param serviceDescription The service instance metadata. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String resourceGroupName, String resourceName, ServicesDescriptionInner serviceDescription, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, resourceName, serviceDescription), serviceCallback); + } + + /** + * Create or update the metadata of a service instance. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param resourceName The name of the service instance. + * @param serviceDescription The service instance metadata. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createOrUpdateAsync(String resourceGroupName, String resourceName, ServicesDescriptionInner serviceDescription) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, resourceName, serviceDescription).map(new Func1, ServicesDescriptionInner>() { + @Override + public ServicesDescriptionInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create or update the metadata of a service instance. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param resourceName The name of the service instance. + * @param serviceDescription The service instance metadata. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String resourceName, ServicesDescriptionInner serviceDescription) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (resourceName == null) { + throw new IllegalArgumentException("Parameter resourceName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (serviceDescription == null) { + throw new IllegalArgumentException("Parameter serviceDescription is required and cannot be null."); + } + Validator.validate(serviceDescription); + Observable> observable = service.createOrUpdate(this.client.subscriptionId(), resourceGroupName, resourceName, this.client.apiVersion(), serviceDescription, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Create or update the metadata of a service instance. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param resourceName The name of the service instance. + * @param serviceDescription The service instance metadata. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorDetailsInnerException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ServicesDescriptionInner object if successful. + */ + public ServicesDescriptionInner beginCreateOrUpdate(String resourceGroupName, String resourceName, ServicesDescriptionInner serviceDescription) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, resourceName, serviceDescription).toBlocking().single().body(); + } + + /** + * Create or update the metadata of a service instance. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param resourceName The name of the service instance. + * @param serviceDescription The service instance metadata. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginCreateOrUpdateAsync(String resourceGroupName, String resourceName, ServicesDescriptionInner serviceDescription, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, resourceName, serviceDescription), serviceCallback); + } + + /** + * Create or update the metadata of a service instance. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param resourceName The name of the service instance. + * @param serviceDescription The service instance metadata. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ServicesDescriptionInner object + */ + public Observable beginCreateOrUpdateAsync(String resourceGroupName, String resourceName, ServicesDescriptionInner serviceDescription) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, resourceName, serviceDescription).map(new Func1, ServicesDescriptionInner>() { + @Override + public ServicesDescriptionInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create or update the metadata of a service instance. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param resourceName The name of the service instance. + * @param serviceDescription The service instance metadata. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ServicesDescriptionInner object + */ + public Observable> beginCreateOrUpdateWithServiceResponseAsync(String resourceGroupName, String resourceName, ServicesDescriptionInner serviceDescription) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (resourceName == null) { + throw new IllegalArgumentException("Parameter resourceName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (serviceDescription == null) { + throw new IllegalArgumentException("Parameter serviceDescription is required and cannot be null."); + } + Validator.validate(serviceDescription); + return service.beginCreateOrUpdate(this.client.subscriptionId(), resourceGroupName, resourceName, this.client.apiVersion(), serviceDescription, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateOrUpdateDelegate(Response response) throws ErrorDetailsInnerException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(ErrorDetailsInnerException.class) + .build(response); + } + + /** + * Update the metadata of a service instance. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param resourceName The name of the service instance. + * @param servicePatchDescription The service instance metadata and security metadata. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorDetailsInnerException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ServicesDescriptionInner object if successful. + */ + public ServicesDescriptionInner update(String resourceGroupName, String resourceName, ServicesPatchDescription servicePatchDescription) { + return updateWithServiceResponseAsync(resourceGroupName, resourceName, servicePatchDescription).toBlocking().last().body(); + } + + /** + * Update the metadata of a service instance. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param resourceName The name of the service instance. + * @param servicePatchDescription The service instance metadata and security metadata. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateAsync(String resourceGroupName, String resourceName, ServicesPatchDescription servicePatchDescription, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, resourceName, servicePatchDescription), serviceCallback); + } + + /** + * Update the metadata of a service instance. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param resourceName The name of the service instance. + * @param servicePatchDescription The service instance metadata and security metadata. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable updateAsync(String resourceGroupName, String resourceName, ServicesPatchDescription servicePatchDescription) { + return updateWithServiceResponseAsync(resourceGroupName, resourceName, servicePatchDescription).map(new Func1, ServicesDescriptionInner>() { + @Override + public ServicesDescriptionInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Update the metadata of a service instance. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param resourceName The name of the service instance. + * @param servicePatchDescription The service instance metadata and security metadata. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> updateWithServiceResponseAsync(String resourceGroupName, String resourceName, ServicesPatchDescription servicePatchDescription) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (resourceName == null) { + throw new IllegalArgumentException("Parameter resourceName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (servicePatchDescription == null) { + throw new IllegalArgumentException("Parameter servicePatchDescription is required and cannot be null."); + } + Validator.validate(servicePatchDescription); + Observable> observable = service.update(this.client.subscriptionId(), resourceGroupName, resourceName, this.client.apiVersion(), servicePatchDescription, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Update the metadata of a service instance. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param resourceName The name of the service instance. + * @param servicePatchDescription The service instance metadata and security metadata. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorDetailsInnerException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ServicesDescriptionInner object if successful. + */ + public ServicesDescriptionInner beginUpdate(String resourceGroupName, String resourceName, ServicesPatchDescription servicePatchDescription) { + return beginUpdateWithServiceResponseAsync(resourceGroupName, resourceName, servicePatchDescription).toBlocking().single().body(); + } + + /** + * Update the metadata of a service instance. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param resourceName The name of the service instance. + * @param servicePatchDescription The service instance metadata and security metadata. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginUpdateAsync(String resourceGroupName, String resourceName, ServicesPatchDescription servicePatchDescription, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateWithServiceResponseAsync(resourceGroupName, resourceName, servicePatchDescription), serviceCallback); + } + + /** + * Update the metadata of a service instance. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param resourceName The name of the service instance. + * @param servicePatchDescription The service instance metadata and security metadata. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ServicesDescriptionInner object + */ + public Observable beginUpdateAsync(String resourceGroupName, String resourceName, ServicesPatchDescription servicePatchDescription) { + return beginUpdateWithServiceResponseAsync(resourceGroupName, resourceName, servicePatchDescription).map(new Func1, ServicesDescriptionInner>() { + @Override + public ServicesDescriptionInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Update the metadata of a service instance. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param resourceName The name of the service instance. + * @param servicePatchDescription The service instance metadata and security metadata. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ServicesDescriptionInner object + */ + public Observable> beginUpdateWithServiceResponseAsync(String resourceGroupName, String resourceName, ServicesPatchDescription servicePatchDescription) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (resourceName == null) { + throw new IllegalArgumentException("Parameter resourceName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (servicePatchDescription == null) { + throw new IllegalArgumentException("Parameter servicePatchDescription is required and cannot be null."); + } + Validator.validate(servicePatchDescription); + return service.beginUpdate(this.client.subscriptionId(), resourceGroupName, resourceName, this.client.apiVersion(), servicePatchDescription, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginUpdateDelegate(Response response) throws ErrorDetailsInnerException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorDetailsInnerException.class) + .build(response); + } + + /** + * Delete a service instance. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param resourceName The name of the service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorDetailsInnerException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String resourceName) { + deleteWithServiceResponseAsync(resourceGroupName, resourceName).toBlocking().last().body(); + } + + /** + * Delete a service instance. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param resourceName The name of the service instance. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String resourceName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, resourceName), serviceCallback); + } + + /** + * Delete a service instance. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param resourceName The name of the service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String resourceName) { + return deleteWithServiceResponseAsync(resourceGroupName, resourceName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Delete a service instance. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param resourceName The name of the service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String resourceName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (resourceName == null) { + throw new IllegalArgumentException("Parameter resourceName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Observable> observable = service.delete(this.client.subscriptionId(), resourceGroupName, resourceName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Delete a service instance. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param resourceName The name of the service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorDetailsInnerException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDelete(String resourceGroupName, String resourceName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, resourceName).toBlocking().single().body(); + } + + /** + * Delete a service instance. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param resourceName The name of the service instance. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteAsync(String resourceGroupName, String resourceName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, resourceName), serviceCallback); + } + + /** + * Delete a service instance. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param resourceName The name of the service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String resourceName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, resourceName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Delete a service instance. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param resourceName The name of the service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String resourceName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (resourceName == null) { + throw new IllegalArgumentException("Parameter resourceName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.beginDelete(this.client.subscriptionId(), resourceGroupName, resourceName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteDelegate(Response response) throws ErrorDetailsInnerException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(ErrorDetailsInnerException.class) + .build(response); + } + + /** + * Get all the service instances in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorDetailsInnerException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ServicesDescriptionInner> object if successful. + */ + public PagedList list() { + ServiceResponse> response = listSinglePageAsync().toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Get all the service instances in a subscription. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Get all the service instances in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ServicesDescriptionInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Get all the service instances in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ServicesDescriptionInner> object + */ + public Observable>> listWithServiceResponseAsync() { + return listSinglePageAsync() + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Get all the service instances in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ServicesDescriptionInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync() { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.list(this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws ErrorDetailsInnerException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorDetailsInnerException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorDetailsInnerException.class) + .build(response); + } + + /** + * Get all the service instances in a resource group. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorDetailsInnerException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ServicesDescriptionInner> object if successful. + */ + public PagedList listByResourceGroup(final String resourceGroupName) { + ServiceResponse> response = listByResourceGroupSinglePageAsync(resourceGroupName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Get all the service instances in a resource group. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupAsync(final String resourceGroupName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupSinglePageAsync(resourceGroupName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Get all the service instances in a resource group. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ServicesDescriptionInner> object + */ + public Observable> listByResourceGroupAsync(final String resourceGroupName) { + return listByResourceGroupWithServiceResponseAsync(resourceGroupName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Get all the service instances in a resource group. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ServicesDescriptionInner> object + */ + public Observable>> listByResourceGroupWithServiceResponseAsync(final String resourceGroupName) { + return listByResourceGroupSinglePageAsync(resourceGroupName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Get all the service instances in a resource group. + * + ServiceResponse> * @param resourceGroupName The name of the resource group that contains the service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ServicesDescriptionInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupSinglePageAsync(final String resourceGroupName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.listByResourceGroup(this.client.subscriptionId(), resourceGroupName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupDelegate(Response response) throws ErrorDetailsInnerException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorDetailsInnerException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorDetailsInnerException.class) + .build(response); + } + + /** + * Check if a service instance name is available. + * + * @param checkNameAvailabilityInputs Set the name parameter in the CheckNameAvailabilityParameters structure to the name of the service instance to check. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorDetailsInnerException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ServicesNameAvailabilityInfoInner object if successful. + */ + public ServicesNameAvailabilityInfoInner checkNameAvailability(CheckNameAvailabilityParameters checkNameAvailabilityInputs) { + return checkNameAvailabilityWithServiceResponseAsync(checkNameAvailabilityInputs).toBlocking().single().body(); + } + + /** + * Check if a service instance name is available. + * + * @param checkNameAvailabilityInputs Set the name parameter in the CheckNameAvailabilityParameters structure to the name of the service instance to check. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture checkNameAvailabilityAsync(CheckNameAvailabilityParameters checkNameAvailabilityInputs, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(checkNameAvailabilityWithServiceResponseAsync(checkNameAvailabilityInputs), serviceCallback); + } + + /** + * Check if a service instance name is available. + * + * @param checkNameAvailabilityInputs Set the name parameter in the CheckNameAvailabilityParameters structure to the name of the service instance to check. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ServicesNameAvailabilityInfoInner object + */ + public Observable checkNameAvailabilityAsync(CheckNameAvailabilityParameters checkNameAvailabilityInputs) { + return checkNameAvailabilityWithServiceResponseAsync(checkNameAvailabilityInputs).map(new Func1, ServicesNameAvailabilityInfoInner>() { + @Override + public ServicesNameAvailabilityInfoInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Check if a service instance name is available. + * + * @param checkNameAvailabilityInputs Set the name parameter in the CheckNameAvailabilityParameters structure to the name of the service instance to check. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ServicesNameAvailabilityInfoInner object + */ + public Observable> checkNameAvailabilityWithServiceResponseAsync(CheckNameAvailabilityParameters checkNameAvailabilityInputs) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (checkNameAvailabilityInputs == null) { + throw new IllegalArgumentException("Parameter checkNameAvailabilityInputs is required and cannot be null."); + } + Validator.validate(checkNameAvailabilityInputs); + return service.checkNameAvailability(this.client.subscriptionId(), this.client.apiVersion(), checkNameAvailabilityInputs, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = checkNameAvailabilityDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse checkNameAvailabilityDelegate(Response response) throws ErrorDetailsInnerException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorDetailsInnerException.class) + .build(response); + } + + /** + * Get all the service instances in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorDetailsInnerException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ServicesDescriptionInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Get all the service instances in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Get all the service instances in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ServicesDescriptionInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Get all the service instances in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ServicesDescriptionInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Get all the service instances in a subscription. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ServicesDescriptionInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws ErrorDetailsInnerException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorDetailsInnerException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorDetailsInnerException.class) + .build(response); + } + + /** + * Get all the service instances in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorDetailsInnerException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ServicesDescriptionInner> object if successful. + */ + public PagedList listByResourceGroupNext(final String nextPageLink) { + ServiceResponse> response = listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Get all the service instances in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Get all the service instances in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ServicesDescriptionInner> object + */ + public Observable> listByResourceGroupNextAsync(final String nextPageLink) { + return listByResourceGroupNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Get all the service instances in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ServicesDescriptionInner> object + */ + public Observable>> listByResourceGroupNextWithServiceResponseAsync(final String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Get all the service instances in a resource group. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ServicesDescriptionInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listByResourceGroupNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupNextDelegate(Response response) throws ErrorDetailsInnerException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorDetailsInnerException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorDetailsInnerException.class) + .build(response); + } + +} diff --git a/sdk/healthcareapis/mgmt-v2020_03_30/src/main/java/com/microsoft/azure/management/healthcareapis/v2020_03_30/implementation/ServicesNameAvailabilityInfoImpl.java b/sdk/healthcareapis/mgmt-v2020_03_30/src/main/java/com/microsoft/azure/management/healthcareapis/v2020_03_30/implementation/ServicesNameAvailabilityInfoImpl.java new file mode 100644 index 0000000000000..f5a2828d1abae --- /dev/null +++ b/sdk/healthcareapis/mgmt-v2020_03_30/src/main/java/com/microsoft/azure/management/healthcareapis/v2020_03_30/implementation/ServicesNameAvailabilityInfoImpl.java @@ -0,0 +1,42 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.healthcareapis.v2020_03_30.implementation; + +import com.microsoft.azure.management.healthcareapis.v2020_03_30.ServicesNameAvailabilityInfo; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.healthcareapis.v2020_03_30.ServiceNameUnavailabilityReason; + +class ServicesNameAvailabilityInfoImpl extends WrapperImpl implements ServicesNameAvailabilityInfo { + private final HealthcareApisManager manager; + ServicesNameAvailabilityInfoImpl(ServicesNameAvailabilityInfoInner inner, HealthcareApisManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public HealthcareApisManager manager() { + return this.manager; + } + + @Override + public String message() { + return this.inner().message(); + } + + @Override + public Boolean nameAvailable() { + return this.inner().nameAvailable(); + } + + @Override + public ServiceNameUnavailabilityReason reason() { + return this.inner().reason(); + } + +} diff --git a/sdk/healthcareapis/mgmt-v2020_03_30/src/main/java/com/microsoft/azure/management/healthcareapis/v2020_03_30/implementation/ServicesNameAvailabilityInfoInner.java b/sdk/healthcareapis/mgmt-v2020_03_30/src/main/java/com/microsoft/azure/management/healthcareapis/v2020_03_30/implementation/ServicesNameAvailabilityInfoInner.java new file mode 100644 index 0000000000000..3df0cd8ff4f22 --- /dev/null +++ b/sdk/healthcareapis/mgmt-v2020_03_30/src/main/java/com/microsoft/azure/management/healthcareapis/v2020_03_30/implementation/ServicesNameAvailabilityInfoInner.java @@ -0,0 +1,75 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.healthcareapis.v2020_03_30.implementation; + +import com.microsoft.azure.management.healthcareapis.v2020_03_30.ServiceNameUnavailabilityReason; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The properties indicating whether a given service name is available. + */ +public class ServicesNameAvailabilityInfoInner { + /** + * The value which indicates whether the provided name is available. + */ + @JsonProperty(value = "nameAvailable", access = JsonProperty.Access.WRITE_ONLY) + private Boolean nameAvailable; + + /** + * The reason for unavailability. Possible values include: 'Invalid', + * 'AlreadyExists'. + */ + @JsonProperty(value = "reason", access = JsonProperty.Access.WRITE_ONLY) + private ServiceNameUnavailabilityReason reason; + + /** + * The detailed reason message. + */ + @JsonProperty(value = "message") + private String message; + + /** + * Get the value which indicates whether the provided name is available. + * + * @return the nameAvailable value + */ + public Boolean nameAvailable() { + return this.nameAvailable; + } + + /** + * Get the reason for unavailability. Possible values include: 'Invalid', 'AlreadyExists'. + * + * @return the reason value + */ + public ServiceNameUnavailabilityReason reason() { + return this.reason; + } + + /** + * Get the detailed reason message. + * + * @return the message value + */ + public String message() { + return this.message; + } + + /** + * Set the detailed reason message. + * + * @param message the message value to set + * @return the ServicesNameAvailabilityInfoInner object itself. + */ + public ServicesNameAvailabilityInfoInner withMessage(String message) { + this.message = message; + return this; + } + +} diff --git a/sdk/healthcareapis/mgmt-v2020_03_30/src/main/java/com/microsoft/azure/management/healthcareapis/v2020_03_30/implementation/package-info.java b/sdk/healthcareapis/mgmt-v2020_03_30/src/main/java/com/microsoft/azure/management/healthcareapis/v2020_03_30/implementation/package-info.java new file mode 100644 index 0000000000000..fcdc3de3f310d --- /dev/null +++ b/sdk/healthcareapis/mgmt-v2020_03_30/src/main/java/com/microsoft/azure/management/healthcareapis/v2020_03_30/implementation/package-info.java @@ -0,0 +1,11 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** + * This package contains the implementation classes for HealthcareApisManagementClient. + * Azure Healthcare APIs Client. + */ +package com.microsoft.azure.management.healthcareapis.v2020_03_30.implementation; diff --git a/sdk/healthcareapis/mgmt-v2020_03_30/src/main/java/com/microsoft/azure/management/healthcareapis/v2020_03_30/package-info.java b/sdk/healthcareapis/mgmt-v2020_03_30/src/main/java/com/microsoft/azure/management/healthcareapis/v2020_03_30/package-info.java new file mode 100644 index 0000000000000..6e333e298fd07 --- /dev/null +++ b/sdk/healthcareapis/mgmt-v2020_03_30/src/main/java/com/microsoft/azure/management/healthcareapis/v2020_03_30/package-info.java @@ -0,0 +1,11 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** + * This package contains the classes for HealthcareApisManagementClient. + * Azure Healthcare APIs Client. + */ +package com.microsoft.azure.management.healthcareapis.v2020_03_30; diff --git a/sdk/healthcareapis/pom.mgmt.xml b/sdk/healthcareapis/pom.mgmt.xml index 5018a0c032bcf..5c765fbbada1a 100644 --- a/sdk/healthcareapis/pom.mgmt.xml +++ b/sdk/healthcareapis/pom.mgmt.xml @@ -10,5 +10,6 @@ 1.0.0 mgmt-v2020_03_15 + mgmt-v2020_03_30