diff --git a/healthcareapis/resource-manager/v2019-09-16/pom.xml b/healthcareapis/resource-manager/v2019-09-16/pom.xml new file mode 100644 index 0000000000000..4aff0d9bd0574 --- /dev/null +++ b/healthcareapis/resource-manager/v2019-09-16/pom.xml @@ -0,0 +1,133 @@ + + + 4.0.0 + com.microsoft.azure.healthcareapis.v2019-09-16 + + com.microsoft.azure + azure-arm-parent + 0.0.3-beta + ../../../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 + + + + + + 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/healthcareapis/resource-manager/v2019-09-16/src/main/java/com/microsoft/azure/management/healthcareapis/v2019-09-16/CheckNameAvailabilityParameters.java b/healthcareapis/resource-manager/v2019-09-16/src/main/java/com/microsoft/azure/management/healthcareapis/v2019-09-16/CheckNameAvailabilityParameters.java new file mode 100644 index 0000000000000..9f8033556ee04 --- /dev/null +++ b/healthcareapis/resource-manager/v2019-09-16/src/main/java/com/microsoft/azure/management/healthcareapis/v2019-09-16/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.v2019-09-16; + +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/healthcareapis/resource-manager/v2019-09-16/src/main/java/com/microsoft/azure/management/healthcareapis/v2019-09-16/ErrorDetailsInternal.java b/healthcareapis/resource-manager/v2019-09-16/src/main/java/com/microsoft/azure/management/healthcareapis/v2019-09-16/ErrorDetailsInternal.java new file mode 100644 index 0000000000000..10daa589c03d6 --- /dev/null +++ b/healthcareapis/resource-manager/v2019-09-16/src/main/java/com/microsoft/azure/management/healthcareapis/v2019-09-16/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.v2019-09-16; + +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/healthcareapis/resource-manager/v2019-09-16/src/main/java/com/microsoft/azure/management/healthcareapis/v2019-09-16/Kind.java b/healthcareapis/resource-manager/v2019-09-16/src/main/java/com/microsoft/azure/management/healthcareapis/v2019-09-16/Kind.java new file mode 100644 index 0000000000000..e82634a2009ef --- /dev/null +++ b/healthcareapis/resource-manager/v2019-09-16/src/main/java/com/microsoft/azure/management/healthcareapis/v2019-09-16/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.v2019-09-16; + +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/healthcareapis/resource-manager/v2019-09-16/src/main/java/com/microsoft/azure/management/healthcareapis/v2019-09-16/Operation.java b/healthcareapis/resource-manager/v2019-09-16/src/main/java/com/microsoft/azure/management/healthcareapis/v2019-09-16/Operation.java new file mode 100644 index 0000000000000..66a156fe347b2 --- /dev/null +++ b/healthcareapis/resource-manager/v2019-09-16/src/main/java/com/microsoft/azure/management/healthcareapis/v2019-09-16/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.v2019-09-16; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.healthcareapis.v2019-09-16.implementation.HealthcareApisManager; +import com.microsoft.azure.management.healthcareapis.v2019-09-16.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/healthcareapis/resource-manager/v2019-09-16/src/main/java/com/microsoft/azure/management/healthcareapis/v2019-09-16/OperationDisplay.java b/healthcareapis/resource-manager/v2019-09-16/src/main/java/com/microsoft/azure/management/healthcareapis/v2019-09-16/OperationDisplay.java new file mode 100644 index 0000000000000..1eb6c1e806950 --- /dev/null +++ b/healthcareapis/resource-manager/v2019-09-16/src/main/java/com/microsoft/azure/management/healthcareapis/v2019-09-16/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.v2019-09-16; + +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/healthcareapis/resource-manager/v2019-09-16/src/main/java/com/microsoft/azure/management/healthcareapis/v2019-09-16/OperationResultStatus.java b/healthcareapis/resource-manager/v2019-09-16/src/main/java/com/microsoft/azure/management/healthcareapis/v2019-09-16/OperationResultStatus.java new file mode 100644 index 0000000000000..db44f0d2b796e --- /dev/null +++ b/healthcareapis/resource-manager/v2019-09-16/src/main/java/com/microsoft/azure/management/healthcareapis/v2019-09-16/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.v2019-09-16; + +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/healthcareapis/resource-manager/v2019-09-16/src/main/java/com/microsoft/azure/management/healthcareapis/v2019-09-16/OperationResults.java b/healthcareapis/resource-manager/v2019-09-16/src/main/java/com/microsoft/azure/management/healthcareapis/v2019-09-16/OperationResults.java new file mode 100644 index 0000000000000..a7fa269c7f880 --- /dev/null +++ b/healthcareapis/resource-manager/v2019-09-16/src/main/java/com/microsoft/azure/management/healthcareapis/v2019-09-16/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.v2019-09-16; + +import rx.Observable; +import com.microsoft.azure.management.healthcareapis.v2019-09-16.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/healthcareapis/resource-manager/v2019-09-16/src/main/java/com/microsoft/azure/management/healthcareapis/v2019-09-16/Operations.java b/healthcareapis/resource-manager/v2019-09-16/src/main/java/com/microsoft/azure/management/healthcareapis/v2019-09-16/Operations.java new file mode 100644 index 0000000000000..d27dd87367e1d --- /dev/null +++ b/healthcareapis/resource-manager/v2019-09-16/src/main/java/com/microsoft/azure/management/healthcareapis/v2019-09-16/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.v2019-09-16; + +import rx.Observable; +import com.microsoft.azure.management.healthcareapis.v2019-09-16.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/healthcareapis/resource-manager/v2019-09-16/src/main/java/com/microsoft/azure/management/healthcareapis/v2019-09-16/ProvisioningState.java b/healthcareapis/resource-manager/v2019-09-16/src/main/java/com/microsoft/azure/management/healthcareapis/v2019-09-16/ProvisioningState.java new file mode 100644 index 0000000000000..ee6670473bda8 --- /dev/null +++ b/healthcareapis/resource-manager/v2019-09-16/src/main/java/com/microsoft/azure/management/healthcareapis/v2019-09-16/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.v2019-09-16; + +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/healthcareapis/resource-manager/v2019-09-16/src/main/java/com/microsoft/azure/management/healthcareapis/v2019-09-16/ServiceAccessPolicyEntry.java b/healthcareapis/resource-manager/v2019-09-16/src/main/java/com/microsoft/azure/management/healthcareapis/v2019-09-16/ServiceAccessPolicyEntry.java new file mode 100644 index 0000000000000..5b52e5f58b8d5 --- /dev/null +++ b/healthcareapis/resource-manager/v2019-09-16/src/main/java/com/microsoft/azure/management/healthcareapis/v2019-09-16/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.v2019-09-16; + +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/healthcareapis/resource-manager/v2019-09-16/src/main/java/com/microsoft/azure/management/healthcareapis/v2019-09-16/ServiceAuthenticationConfigurationInfo.java b/healthcareapis/resource-manager/v2019-09-16/src/main/java/com/microsoft/azure/management/healthcareapis/v2019-09-16/ServiceAuthenticationConfigurationInfo.java new file mode 100644 index 0000000000000..31a381c6028fc --- /dev/null +++ b/healthcareapis/resource-manager/v2019-09-16/src/main/java/com/microsoft/azure/management/healthcareapis/v2019-09-16/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.v2019-09-16; + +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/healthcareapis/resource-manager/v2019-09-16/src/main/java/com/microsoft/azure/management/healthcareapis/v2019-09-16/ServiceCorsConfigurationInfo.java b/healthcareapis/resource-manager/v2019-09-16/src/main/java/com/microsoft/azure/management/healthcareapis/v2019-09-16/ServiceCorsConfigurationInfo.java new file mode 100644 index 0000000000000..85543789880e5 --- /dev/null +++ b/healthcareapis/resource-manager/v2019-09-16/src/main/java/com/microsoft/azure/management/healthcareapis/v2019-09-16/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.v2019-09-16; + +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/healthcareapis/resource-manager/v2019-09-16/src/main/java/com/microsoft/azure/management/healthcareapis/v2019-09-16/ServiceCosmosDbConfigurationInfo.java b/healthcareapis/resource-manager/v2019-09-16/src/main/java/com/microsoft/azure/management/healthcareapis/v2019-09-16/ServiceCosmosDbConfigurationInfo.java new file mode 100644 index 0000000000000..30b19e626c61d --- /dev/null +++ b/healthcareapis/resource-manager/v2019-09-16/src/main/java/com/microsoft/azure/management/healthcareapis/v2019-09-16/ServiceCosmosDbConfigurationInfo.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.v2019-09-16; + +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; + + /** + * 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; + } + +} diff --git a/healthcareapis/resource-manager/v2019-09-16/src/main/java/com/microsoft/azure/management/healthcareapis/v2019-09-16/ServiceNameUnavailabilityReason.java b/healthcareapis/resource-manager/v2019-09-16/src/main/java/com/microsoft/azure/management/healthcareapis/v2019-09-16/ServiceNameUnavailabilityReason.java new file mode 100644 index 0000000000000..323f7a7836ebb --- /dev/null +++ b/healthcareapis/resource-manager/v2019-09-16/src/main/java/com/microsoft/azure/management/healthcareapis/v2019-09-16/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.v2019-09-16; + +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/healthcareapis/resource-manager/v2019-09-16/src/main/java/com/microsoft/azure/management/healthcareapis/v2019-09-16/Services.java b/healthcareapis/resource-manager/v2019-09-16/src/main/java/com/microsoft/azure/management/healthcareapis/v2019-09-16/Services.java new file mode 100644 index 0000000000000..e0878b6c8590d --- /dev/null +++ b/healthcareapis/resource-manager/v2019-09-16/src/main/java/com/microsoft/azure/management/healthcareapis/v2019-09-16/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.v2019-09-16; + +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.v2019-09-16.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/healthcareapis/resource-manager/v2019-09-16/src/main/java/com/microsoft/azure/management/healthcareapis/v2019-09-16/ServicesDescription.java b/healthcareapis/resource-manager/v2019-09-16/src/main/java/com/microsoft/azure/management/healthcareapis/v2019-09-16/ServicesDescription.java new file mode 100644 index 0000000000000..bf6b69ba49771 --- /dev/null +++ b/healthcareapis/resource-manager/v2019-09-16/src/main/java/com/microsoft/azure/management/healthcareapis/v2019-09-16/ServicesDescription.java @@ -0,0 +1,143 @@ +/** + * 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.v2019-09-16; + +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.v2019-09-16.implementation.HealthcareApisManager; +import com.microsoft.azure.management.healthcareapis.v2019-09-16.implementation.ServicesDescriptionInner; + +/** + * Type representing ServicesDescription. + */ +public interface ServicesDescription extends HasInner, Resource, GroupableResourceCore, HasResourceGroup, Refreshable, Updatable, HasManager { + /** + * @return the etag value. + */ + String etag(); + + /** + * @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 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.WithProperties { + } + } + /** + * The template for a ServicesDescription update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, Resource.UpdateWithTags, UpdateStages.WithEtag, UpdateStages.WithProperties { + } + + /** + * Grouping of ServicesDescription update stages. + */ + interface UpdateStages { + /** + * The stage of the servicesdescription update 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 update stage + */ + Update withEtag(String etag); + } + + /** + * The stage of the servicesdescription update allowing to specify Properties. + */ + interface WithProperties { + /** + * Specifies properties. + * @param properties The common properties of a service + * @return the next update stage + */ + Update withProperties(ServicesProperties properties); + } + + } +} diff --git a/healthcareapis/resource-manager/v2019-09-16/src/main/java/com/microsoft/azure/management/healthcareapis/v2019-09-16/ServicesNameAvailabilityInfo.java b/healthcareapis/resource-manager/v2019-09-16/src/main/java/com/microsoft/azure/management/healthcareapis/v2019-09-16/ServicesNameAvailabilityInfo.java new file mode 100644 index 0000000000000..844b538afccb4 --- /dev/null +++ b/healthcareapis/resource-manager/v2019-09-16/src/main/java/com/microsoft/azure/management/healthcareapis/v2019-09-16/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.v2019-09-16; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.healthcareapis.v2019-09-16.implementation.HealthcareApisManager; +import com.microsoft.azure.management.healthcareapis.v2019-09-16.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/healthcareapis/resource-manager/v2019-09-16/src/main/java/com/microsoft/azure/management/healthcareapis/v2019-09-16/ServicesPatchDescription.java b/healthcareapis/resource-manager/v2019-09-16/src/main/java/com/microsoft/azure/management/healthcareapis/v2019-09-16/ServicesPatchDescription.java new file mode 100644 index 0000000000000..2df84fd48a230 --- /dev/null +++ b/healthcareapis/resource-manager/v2019-09-16/src/main/java/com/microsoft/azure/management/healthcareapis/v2019-09-16/ServicesPatchDescription.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.v2019-09-16; + +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The description of the service. + */ +public class ServicesPatchDescription { + /** + * Instance tags. + */ + @JsonProperty(value = "tags") + private Map tags; + + /** + * 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; + } + +} diff --git a/healthcareapis/resource-manager/v2019-09-16/src/main/java/com/microsoft/azure/management/healthcareapis/v2019-09-16/ServicesProperties.java b/healthcareapis/resource-manager/v2019-09-16/src/main/java/com/microsoft/azure/management/healthcareapis/v2019-09-16/ServicesProperties.java new file mode 100644 index 0000000000000..7898e98f6787d --- /dev/null +++ b/healthcareapis/resource-manager/v2019-09-16/src/main/java/com/microsoft/azure/management/healthcareapis/v2019-09-16/ServicesProperties.java @@ -0,0 +1,139 @@ +/** + * 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.v2019-09-16; + +import java.util.List; +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", required = true) + 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; + + /** + * 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; + } + +} diff --git a/healthcareapis/resource-manager/v2019-09-16/src/main/java/com/microsoft/azure/management/healthcareapis/v2019-09-16/implementation/ErrorDetailsInner.java b/healthcareapis/resource-manager/v2019-09-16/src/main/java/com/microsoft/azure/management/healthcareapis/v2019-09-16/implementation/ErrorDetailsInner.java new file mode 100644 index 0000000000000..c39b22279c1ad --- /dev/null +++ b/healthcareapis/resource-manager/v2019-09-16/src/main/java/com/microsoft/azure/management/healthcareapis/v2019-09-16/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.v2019-09-16.implementation; + +import com.microsoft.azure.management.healthcareapis.v2019-09-16.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/healthcareapis/resource-manager/v2019-09-16/src/main/java/com/microsoft/azure/management/healthcareapis/v2019-09-16/implementation/ErrorDetailsInnerException.java b/healthcareapis/resource-manager/v2019-09-16/src/main/java/com/microsoft/azure/management/healthcareapis/v2019-09-16/implementation/ErrorDetailsInnerException.java new file mode 100644 index 0000000000000..0c5cd45ed5291 --- /dev/null +++ b/healthcareapis/resource-manager/v2019-09-16/src/main/java/com/microsoft/azure/management/healthcareapis/v2019-09-16/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.v2019-09-16.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/healthcareapis/resource-manager/v2019-09-16/src/main/java/com/microsoft/azure/management/healthcareapis/v2019-09-16/implementation/HealthcareApisManagementClientImpl.java b/healthcareapis/resource-manager/v2019-09-16/src/main/java/com/microsoft/azure/management/healthcareapis/v2019-09-16/implementation/HealthcareApisManagementClientImpl.java new file mode 100644 index 0000000000000..330fdde75d37f --- /dev/null +++ b/healthcareapis/resource-manager/v2019-09-16/src/main/java/com/microsoft/azure/management/healthcareapis/v2019-09-16/implementation/HealthcareApisManagementClientImpl.java @@ -0,0 +1,224 @@ +/** + * 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.v2019-09-16.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; + } + + /** The version of the API. Possible values include: '2018-08-20-preview', '2019-09-16'. */ + private String apiVersion; + + /** + * Gets The version of the API. Possible values include: '2018-08-20-preview', '2019-09-16'. + * + * @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; + } + + /** + * 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 = 2019-09-16; + 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.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", "2019-09-16"); + } +} diff --git a/healthcareapis/resource-manager/v2019-09-16/src/main/java/com/microsoft/azure/management/healthcareapis/v2019-09-16/implementation/HealthcareApisManager.java b/healthcareapis/resource-manager/v2019-09-16/src/main/java/com/microsoft/azure/management/healthcareapis/v2019-09-16/implementation/HealthcareApisManager.java new file mode 100644 index 0000000000000..6772dd827ddeb --- /dev/null +++ b/healthcareapis/resource-manager/v2019-09-16/src/main/java/com/microsoft/azure/management/healthcareapis/v2019-09-16/implementation/HealthcareApisManager.java @@ -0,0 +1,123 @@ +/** + * 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.v2019-09-16.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.v2019-09-16.Services; +import com.microsoft.azure.management.healthcareapis.v2019-09-16.Operations; +import com.microsoft.azure.management.healthcareapis.v2019-09-16.OperationResults; +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; + /** + * 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; + } + + /** + * 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/healthcareapis/resource-manager/v2019-09-16/src/main/java/com/microsoft/azure/management/healthcareapis/v2019-09-16/implementation/IdParsingUtils.java b/healthcareapis/resource-manager/v2019-09-16/src/main/java/com/microsoft/azure/management/healthcareapis/v2019-09-16/implementation/IdParsingUtils.java new file mode 100644 index 0000000000000..8e5fe06506f84 --- /dev/null +++ b/healthcareapis/resource-manager/v2019-09-16/src/main/java/com/microsoft/azure/management/healthcareapis/v2019-09-16/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.v2019-09-16.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/healthcareapis/resource-manager/v2019-09-16/src/main/java/com/microsoft/azure/management/healthcareapis/v2019-09-16/implementation/OperationImpl.java b/healthcareapis/resource-manager/v2019-09-16/src/main/java/com/microsoft/azure/management/healthcareapis/v2019-09-16/implementation/OperationImpl.java new file mode 100644 index 0000000000000..5b859c7833e87 --- /dev/null +++ b/healthcareapis/resource-manager/v2019-09-16/src/main/java/com/microsoft/azure/management/healthcareapis/v2019-09-16/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.v2019-09-16.implementation; + +import com.microsoft.azure.management.healthcareapis.v2019-09-16.Operation; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.healthcareapis.v2019-09-16.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/healthcareapis/resource-manager/v2019-09-16/src/main/java/com/microsoft/azure/management/healthcareapis/v2019-09-16/implementation/OperationInner.java b/healthcareapis/resource-manager/v2019-09-16/src/main/java/com/microsoft/azure/management/healthcareapis/v2019-09-16/implementation/OperationInner.java new file mode 100644 index 0000000000000..5cad95a13b088 --- /dev/null +++ b/healthcareapis/resource-manager/v2019-09-16/src/main/java/com/microsoft/azure/management/healthcareapis/v2019-09-16/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.v2019-09-16.implementation; + +import com.microsoft.azure.management.healthcareapis.v2019-09-16.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/healthcareapis/resource-manager/v2019-09-16/src/main/java/com/microsoft/azure/management/healthcareapis/v2019-09-16/implementation/OperationResultsDescriptionInner.java b/healthcareapis/resource-manager/v2019-09-16/src/main/java/com/microsoft/azure/management/healthcareapis/v2019-09-16/implementation/OperationResultsDescriptionInner.java new file mode 100644 index 0000000000000..72537114b790a --- /dev/null +++ b/healthcareapis/resource-manager/v2019-09-16/src/main/java/com/microsoft/azure/management/healthcareapis/v2019-09-16/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.v2019-09-16.implementation; + +import com.microsoft.azure.management.healthcareapis.v2019-09-16.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/healthcareapis/resource-manager/v2019-09-16/src/main/java/com/microsoft/azure/management/healthcareapis/v2019-09-16/implementation/OperationResultsImpl.java b/healthcareapis/resource-manager/v2019-09-16/src/main/java/com/microsoft/azure/management/healthcareapis/v2019-09-16/implementation/OperationResultsImpl.java new file mode 100644 index 0000000000000..46cb67a6e81b2 --- /dev/null +++ b/healthcareapis/resource-manager/v2019-09-16/src/main/java/com/microsoft/azure/management/healthcareapis/v2019-09-16/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.v2019-09-16.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.healthcareapis.v2019-09-16.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/healthcareapis/resource-manager/v2019-09-16/src/main/java/com/microsoft/azure/management/healthcareapis/v2019-09-16/implementation/OperationResultsInner.java b/healthcareapis/resource-manager/v2019-09-16/src/main/java/com/microsoft/azure/management/healthcareapis/v2019-09-16/implementation/OperationResultsInner.java new file mode 100644 index 0000000000000..9896a46339314 --- /dev/null +++ b/healthcareapis/resource-manager/v2019-09-16/src/main/java/com/microsoft/azure/management/healthcareapis/v2019-09-16/implementation/OperationResultsInner.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.v2019-09-16.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.management.healthcareapis.v2019-09-16.ErrorDetailsInnerException; +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.v2019-09-16.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/healthcareapis/resource-manager/v2019-09-16/src/main/java/com/microsoft/azure/management/healthcareapis/v2019-09-16/implementation/OperationsImpl.java b/healthcareapis/resource-manager/v2019-09-16/src/main/java/com/microsoft/azure/management/healthcareapis/v2019-09-16/implementation/OperationsImpl.java new file mode 100644 index 0000000000000..e251e4659fe33 --- /dev/null +++ b/healthcareapis/resource-manager/v2019-09-16/src/main/java/com/microsoft/azure/management/healthcareapis/v2019-09-16/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.v2019-09-16.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.healthcareapis.v2019-09-16.Operations; +import rx.functions.Func1; +import rx.Observable; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.healthcareapis.v2019-09-16.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/healthcareapis/resource-manager/v2019-09-16/src/main/java/com/microsoft/azure/management/healthcareapis/v2019-09-16/implementation/OperationsInner.java b/healthcareapis/resource-manager/v2019-09-16/src/main/java/com/microsoft/azure/management/healthcareapis/v2019-09-16/implementation/OperationsInner.java new file mode 100644 index 0000000000000..5319aa0827835 --- /dev/null +++ b/healthcareapis/resource-manager/v2019-09-16/src/main/java/com/microsoft/azure/management/healthcareapis/v2019-09-16/implementation/OperationsInner.java @@ -0,0 +1,283 @@ +/** + * 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.v2019-09-16.implementation; + +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.v2019-09-16.ErrorDetailsInnerException; +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.v2019-09-16.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.v2019-09-16.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/healthcareapis/resource-manager/v2019-09-16/src/main/java/com/microsoft/azure/management/healthcareapis/v2019-09-16/implementation/PageImpl.java b/healthcareapis/resource-manager/v2019-09-16/src/main/java/com/microsoft/azure/management/healthcareapis/v2019-09-16/implementation/PageImpl.java new file mode 100644 index 0000000000000..70d4baf0a0660 --- /dev/null +++ b/healthcareapis/resource-manager/v2019-09-16/src/main/java/com/microsoft/azure/management/healthcareapis/v2019-09-16/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.v2019-09-16.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/healthcareapis/resource-manager/v2019-09-16/src/main/java/com/microsoft/azure/management/healthcareapis/v2019-09-16/implementation/ServicesDescriptionImpl.java b/healthcareapis/resource-manager/v2019-09-16/src/main/java/com/microsoft/azure/management/healthcareapis/v2019-09-16/implementation/ServicesDescriptionImpl.java new file mode 100644 index 0000000000000..434a3be818df3 --- /dev/null +++ b/healthcareapis/resource-manager/v2019-09-16/src/main/java/com/microsoft/azure/management/healthcareapis/v2019-09-16/implementation/ServicesDescriptionImpl.java @@ -0,0 +1,81 @@ +/** + * 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.v2019-09-16.implementation; + +import com.microsoft.azure.arm.resources.models.implementation.GroupableResourceCoreImpl; +import com.microsoft.azure.management.healthcareapis.v2019-09-16.ServicesDescription; +import rx.Observable; +import com.microsoft.azure.management.healthcareapis.v2019-09-16.Kind; +import com.microsoft.azure.management.healthcareapis.v2019-09-16.ServicesProperties; + +class ServicesDescriptionImpl extends GroupableResourceCoreImpl implements ServicesDescription, ServicesDescription.Definition, ServicesDescription.Update { + ServicesDescriptionImpl(String name, ServicesDescriptionInner inner, HealthcareApisManager manager) { + super(name, inner, manager); + } + + @Override + public Observable createResourceAsync() { + ServicesInner client = this.manager().inner().services(); + return client.createOrUpdateAsync(this.resourceGroupName(), this.name(), this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + ServicesInner client = this.manager().inner().services(); + return client.createOrUpdateAsync(this.resourceGroupName(), this.name(), this.inner()) + .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; + } + + + @Override + public String etag() { + return this.inner().etag(); + } + + @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 withProperties(ServicesProperties properties) { + this.inner().withProperties(properties); + return this; + } + +} diff --git a/healthcareapis/resource-manager/v2019-09-16/src/main/java/com/microsoft/azure/management/healthcareapis/v2019-09-16/implementation/ServicesDescriptionInner.java b/healthcareapis/resource-manager/v2019-09-16/src/main/java/com/microsoft/azure/management/healthcareapis/v2019-09-16/implementation/ServicesDescriptionInner.java new file mode 100644 index 0000000000000..af7d4aec4546d --- /dev/null +++ b/healthcareapis/resource-manager/v2019-09-16/src/main/java/com/microsoft/azure/management/healthcareapis/v2019-09-16/implementation/ServicesDescriptionInner.java @@ -0,0 +1,100 @@ +/** + * 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.v2019-09-16.implementation; + +import com.microsoft.azure.management.healthcareapis.v2019-09-16.ServicesProperties; +import com.microsoft.azure.management.healthcareapis.v2019-09-16.Kind; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.azure.Resource; + +/** + * The description of the service. + */ +public class ServicesDescriptionInner extends Resource { + /** + * The common properties of a service. + */ + @JsonProperty(value = "properties") + private ServicesProperties properties; + + /** + * 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; + + /** + * 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; + } + + /** + * 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 ServicesDescriptionInner object itself. + */ + public ServicesDescriptionInner 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 ServicesDescriptionInner object itself. + */ + public ServicesDescriptionInner withEtag(String etag) { + this.etag = etag; + return this; + } + +} diff --git a/healthcareapis/resource-manager/v2019-09-16/src/main/java/com/microsoft/azure/management/healthcareapis/v2019-09-16/implementation/ServicesImpl.java b/healthcareapis/resource-manager/v2019-09-16/src/main/java/com/microsoft/azure/management/healthcareapis/v2019-09-16/implementation/ServicesImpl.java new file mode 100644 index 0000000000000..86a64d703df79 --- /dev/null +++ b/healthcareapis/resource-manager/v2019-09-16/src/main/java/com/microsoft/azure/management/healthcareapis/v2019-09-16/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.v2019-09-16.implementation; + +import com.microsoft.azure.arm.resources.collection.implementation.GroupableResourcesCoreImpl; +import com.microsoft.azure.management.healthcareapis.v2019-09-16.Services; +import com.microsoft.azure.management.healthcareapis.v2019-09-16.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.v2019-09-16.ServicesNameAvailabilityInfo; +import com.microsoft.azure.management.healthcareapis.v2019-09-16.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/healthcareapis/resource-manager/v2019-09-16/src/main/java/com/microsoft/azure/management/healthcareapis/v2019-09-16/implementation/ServicesInner.java b/healthcareapis/resource-manager/v2019-09-16/src/main/java/com/microsoft/azure/management/healthcareapis/v2019-09-16/implementation/ServicesInner.java new file mode 100644 index 0000000000000..fdb5d3d5645cf --- /dev/null +++ b/healthcareapis/resource-manager/v2019-09-16/src/main/java/com/microsoft/azure/management/healthcareapis/v2019-09-16/implementation/ServicesInner.java @@ -0,0 +1,1380 @@ +/** + * 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.v2019-09-16.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.v2019-09-16.CheckNameAvailabilityParameters; +import com.microsoft.azure.management.healthcareapis.v2019-09-16.ErrorDetailsInnerException; +import com.microsoft.azure.management.healthcareapis.v2019-09-16.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 java.util.Map; +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.v2019-09-16.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.v2019-09-16.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.v2019-09-16.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.v2019-09-16.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, @Header("accept-language") String acceptLanguage, @Body ServicesPatchDescription servicePatchDescription, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.healthcareapis.v2019-09-16.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, @Header("accept-language") String acceptLanguage, @Body ServicesPatchDescription servicePatchDescription, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.healthcareapis.v2019-09-16.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.v2019-09-16.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.v2019-09-16.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.v2019-09-16.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.v2019-09-16.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.v2019-09-16.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.v2019-09-16.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. + * @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) { + return updateWithServiceResponseAsync(resourceGroupName, resourceName).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 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, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, resourceName), 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. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable updateAsync(String resourceGroupName, String resourceName) { + return updateWithServiceResponseAsync(resourceGroupName, resourceName).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. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> updateWithServiceResponseAsync(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."); + } + final Map tags = null; + ServicesPatchDescription servicePatchDescription = new ServicesPatchDescription(); + servicePatchDescription.withTags(null); + Observable> observable = service.update(this.client.subscriptionId(), resourceGroupName, resourceName, this.client.apiVersion(), this.client.acceptLanguage(), servicePatchDescription, 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 tags Instance tags + * @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, Map tags) { + return updateWithServiceResponseAsync(resourceGroupName, resourceName, tags).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 tags Instance tags + * @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, Map tags, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, resourceName, tags), 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 tags Instance tags + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable updateAsync(String resourceGroupName, String resourceName, Map tags) { + return updateWithServiceResponseAsync(resourceGroupName, resourceName, tags).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 tags Instance tags + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> updateWithServiceResponseAsync(String resourceGroupName, String resourceName, Map tags) { + 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."); + } + Validator.validate(tags); + ServicesPatchDescription servicePatchDescription = new ServicesPatchDescription(); + servicePatchDescription.withTags(tags); + Observable> observable = service.update(this.client.subscriptionId(), resourceGroupName, resourceName, this.client.apiVersion(), this.client.acceptLanguage(), servicePatchDescription, 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. + * @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) { + return beginUpdateWithServiceResponseAsync(resourceGroupName, resourceName).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 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, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateWithServiceResponseAsync(resourceGroupName, resourceName), 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. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ServicesDescriptionInner object + */ + public Observable beginUpdateAsync(String resourceGroupName, String resourceName) { + return beginUpdateWithServiceResponseAsync(resourceGroupName, resourceName).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. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ServicesDescriptionInner object + */ + public Observable> beginUpdateWithServiceResponseAsync(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."); + } + final Map tags = null; + ServicesPatchDescription servicePatchDescription = new ServicesPatchDescription(); + servicePatchDescription.withTags(null); + return service.beginUpdate(this.client.subscriptionId(), resourceGroupName, resourceName, this.client.apiVersion(), this.client.acceptLanguage(), servicePatchDescription, 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); + } + } + }); + } + + /** + * 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 tags Instance tags + * @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, Map tags) { + return beginUpdateWithServiceResponseAsync(resourceGroupName, resourceName, tags).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 tags Instance tags + * @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, Map tags, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateWithServiceResponseAsync(resourceGroupName, resourceName, tags), 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 tags Instance tags + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ServicesDescriptionInner object + */ + public Observable beginUpdateAsync(String resourceGroupName, String resourceName, Map tags) { + return beginUpdateWithServiceResponseAsync(resourceGroupName, resourceName, tags).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 tags Instance tags + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ServicesDescriptionInner object + */ + public Observable> beginUpdateWithServiceResponseAsync(String resourceGroupName, String resourceName, Map tags) { + 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."); + } + Validator.validate(tags); + ServicesPatchDescription servicePatchDescription = new ServicesPatchDescription(); + servicePatchDescription.withTags(tags); + return service.beginUpdate(this.client.subscriptionId(), resourceGroupName, resourceName, this.client.apiVersion(), this.client.acceptLanguage(), servicePatchDescription, 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/healthcareapis/resource-manager/v2019-09-16/src/main/java/com/microsoft/azure/management/healthcareapis/v2019-09-16/implementation/ServicesNameAvailabilityInfoImpl.java b/healthcareapis/resource-manager/v2019-09-16/src/main/java/com/microsoft/azure/management/healthcareapis/v2019-09-16/implementation/ServicesNameAvailabilityInfoImpl.java new file mode 100644 index 0000000000000..4c58b60a8b009 --- /dev/null +++ b/healthcareapis/resource-manager/v2019-09-16/src/main/java/com/microsoft/azure/management/healthcareapis/v2019-09-16/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.v2019-09-16.implementation; + +import com.microsoft.azure.management.healthcareapis.v2019-09-16.ServicesNameAvailabilityInfo; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.healthcareapis.v2019-09-16.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/healthcareapis/resource-manager/v2019-09-16/src/main/java/com/microsoft/azure/management/healthcareapis/v2019-09-16/implementation/ServicesNameAvailabilityInfoInner.java b/healthcareapis/resource-manager/v2019-09-16/src/main/java/com/microsoft/azure/management/healthcareapis/v2019-09-16/implementation/ServicesNameAvailabilityInfoInner.java new file mode 100644 index 0000000000000..8951a6985c8ed --- /dev/null +++ b/healthcareapis/resource-manager/v2019-09-16/src/main/java/com/microsoft/azure/management/healthcareapis/v2019-09-16/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.v2019-09-16.implementation; + +import com.microsoft.azure.management.healthcareapis.v2019-09-16.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/healthcareapis/resource-manager/v2019-09-16/src/main/java/com/microsoft/azure/management/healthcareapis/v2019-09-16/implementation/package-info.java b/healthcareapis/resource-manager/v2019-09-16/src/main/java/com/microsoft/azure/management/healthcareapis/v2019-09-16/implementation/package-info.java new file mode 100644 index 0000000000000..8bd1a7ff1dce9 --- /dev/null +++ b/healthcareapis/resource-manager/v2019-09-16/src/main/java/com/microsoft/azure/management/healthcareapis/v2019-09-16/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.v2019-09-16.implementation; diff --git a/healthcareapis/resource-manager/v2019-09-16/src/main/java/com/microsoft/azure/management/healthcareapis/v2019-09-16/package-info.java b/healthcareapis/resource-manager/v2019-09-16/src/main/java/com/microsoft/azure/management/healthcareapis/v2019-09-16/package-info.java new file mode 100644 index 0000000000000..4e0e9a6f2deed --- /dev/null +++ b/healthcareapis/resource-manager/v2019-09-16/src/main/java/com/microsoft/azure/management/healthcareapis/v2019-09-16/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.v2019-09-16;