diff --git a/api-specs.json b/api-specs.json index 2187614d8f1c..3cf2a840a50c 100644 --- a/api-specs.json +++ b/api-specs.json @@ -50,6 +50,10 @@ "source": "specification/eventgrid/data-plane/readme.md", "args": "--multiapi" }, + "hdinsight/resource-manager": { + "source": "specification/hdinsight/resource-manager/readme.md", + "args": "--multiapi --fluent" + }, "iotcentral/resource-manager": { "source": "specification/iotcentral/resource-manager/readme.md", "args": "--multiapi --fluent", @@ -72,6 +76,10 @@ "source": "specification/logic/resource-manager/readme.md", "args": "--multiapi --fluent" }, + "notificationhubs/resource-manager": { + "source": "specification/notificationhubs/resource-manager/readme.md", + "args": "--multiapi --fluent" + }, "mediaservices/resource-manager": { "source": "specification/mediaservices/resource-manager/readme.md", "args": "--multiapi --fluent" diff --git a/hdinsight/resource-manager/v2015_03_01_preview/pom.xml b/hdinsight/resource-manager/v2015_03_01_preview/pom.xml new file mode 100644 index 000000000000..d9fe0b16d822 --- /dev/null +++ b/hdinsight/resource-manager/v2015_03_01_preview/pom.xml @@ -0,0 +1,133 @@ + + + 4.0.0 + com.microsoft.azure.hdinsight.v2015_03_01_preview + + com.microsoft.azure + azure-arm-parent + 0.0.2-beta + ../../../pom.xml + + azure-mgmt-hdinsight + 1.0.0-beta + jar + Microsoft Azure SDK for HDInsight Management + This package contains Microsoft HDInsight 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/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/Application.java b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/Application.java new file mode 100644 index 000000000000..c90403770501 --- /dev/null +++ b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/Application.java @@ -0,0 +1,176 @@ +/** + * 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.hdinsight.v2015_03_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.hdinsight.v2015_03_01_preview.implementation.ApplicationInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.hdinsight.v2015_03_01_preview.implementation.HDInsightManager; +import java.util.Map; + +/** + * Type representing Application. + */ +public interface Application extends HasInner, Indexable, Refreshable, Updatable, HasManager { + /** + * @return the etag value. + */ + String etag(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the properties value. + */ + ApplicationProperties properties(); + + /** + * @return the tags value. + */ + Map tags(); + + /** + * @return the type value. + */ + String type(); + + /** + * The entirety of the Application definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithCluster, DefinitionStages.WithCreate { + } + + /** + * Grouping of Application definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a Application definition. + */ + interface Blank extends WithCluster { + } + + /** + * The stage of the application definition allowing to specify Cluster. + */ + interface WithCluster { + /** + * Specifies resourceGroupName, clusterName. + * @param resourceGroupName The name of the resource group + * @param clusterName The name of the cluster + * @return the next definition stage + */ + WithCreate withExistingCluster(String resourceGroupName, String clusterName); + } + + /** + * The stage of the application definition allowing to specify Etag. + */ + interface WithEtag { + /** + * Specifies etag. + * @param etag The ETag for the application + * @return the next definition stage + */ + WithCreate withEtag(String etag); + } + + /** + * The stage of the application definition allowing to specify Properties. + */ + interface WithProperties { + /** + * Specifies properties. + * @param properties The properties of the application + * @return the next definition stage + */ + WithCreate withProperties(ApplicationProperties properties); + } + + /** + * The stage of the application definition allowing to specify Tags. + */ + interface WithTags { + /** + * Specifies tags. + * @param tags The tags for the application + * @return the next definition stage + */ + WithCreate withTags(Map tags); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, DefinitionStages.WithEtag, DefinitionStages.WithProperties, DefinitionStages.WithTags { + } + } + /** + * The template for a Application update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, UpdateStages.WithEtag, UpdateStages.WithProperties, UpdateStages.WithTags { + } + + /** + * Grouping of Application update stages. + */ + interface UpdateStages { + /** + * The stage of the application update allowing to specify Etag. + */ + interface WithEtag { + /** + * Specifies etag. + * @param etag The ETag for the application + * @return the next update stage + */ + Update withEtag(String etag); + } + + /** + * The stage of the application update allowing to specify Properties. + */ + interface WithProperties { + /** + * Specifies properties. + * @param properties The properties of the application + * @return the next update stage + */ + Update withProperties(ApplicationProperties properties); + } + + /** + * The stage of the application update allowing to specify Tags. + */ + interface WithTags { + /** + * Specifies tags. + * @param tags The tags for the application + * @return the next update stage + */ + Update withTags(Map tags); + } + + } +} diff --git a/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/ApplicationGetEndpoint.java b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/ApplicationGetEndpoint.java new file mode 100644 index 000000000000..30aad4561990 --- /dev/null +++ b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/ApplicationGetEndpoint.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.hdinsight.v2015_03_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Gets the application SSH endpoint. + */ +public class ApplicationGetEndpoint { + /** + * The location of the endpoint. + */ + @JsonProperty(value = "location") + private String location; + + /** + * The destination port to connect to. + */ + @JsonProperty(value = "destinationPort") + private Integer destinationPort; + + /** + * The public port to connect to. + */ + @JsonProperty(value = "publicPort") + private Integer publicPort; + + /** + * Get the location of the endpoint. + * + * @return the location value + */ + public String location() { + return this.location; + } + + /** + * Set the location of the endpoint. + * + * @param location the location value to set + * @return the ApplicationGetEndpoint object itself. + */ + public ApplicationGetEndpoint withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get the destination port to connect to. + * + * @return the destinationPort value + */ + public Integer destinationPort() { + return this.destinationPort; + } + + /** + * Set the destination port to connect to. + * + * @param destinationPort the destinationPort value to set + * @return the ApplicationGetEndpoint object itself. + */ + public ApplicationGetEndpoint withDestinationPort(Integer destinationPort) { + this.destinationPort = destinationPort; + return this; + } + + /** + * Get the public port to connect to. + * + * @return the publicPort value + */ + public Integer publicPort() { + return this.publicPort; + } + + /** + * Set the public port to connect to. + * + * @param publicPort the publicPort value to set + * @return the ApplicationGetEndpoint object itself. + */ + public ApplicationGetEndpoint withPublicPort(Integer publicPort) { + this.publicPort = publicPort; + return this; + } + +} diff --git a/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/ApplicationGetHttpsEndpoint.java b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/ApplicationGetHttpsEndpoint.java new file mode 100644 index 000000000000..c93c78f1460d --- /dev/null +++ b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/ApplicationGetHttpsEndpoint.java @@ -0,0 +1,149 @@ +/** + * 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.hdinsight.v2015_03_01_preview; + +import java.util.Map; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Gets the application HTTP endpoints. + */ +public class ApplicationGetHttpsEndpoint { + /** + * Unmatched properties from the message are deserialized this collection. + */ + @JsonProperty(value = "") + private Map additionalProperties; + + /** + * The list of access modes for the application. + */ + @JsonProperty(value = "accessModes") + private List accessModes; + + /** + * The location of the endpoint. + */ + @JsonProperty(value = "location") + private String location; + + /** + * The destination port to connect to. + */ + @JsonProperty(value = "destinationPort") + private Integer destinationPort; + + /** + * The public port to connect to. + */ + @JsonProperty(value = "publicPort") + private Integer publicPort; + + /** + * Get unmatched properties from the message are deserialized this collection. + * + * @return the additionalProperties value + */ + public Map additionalProperties() { + return this.additionalProperties; + } + + /** + * Set unmatched properties from the message are deserialized this collection. + * + * @param additionalProperties the additionalProperties value to set + * @return the ApplicationGetHttpsEndpoint object itself. + */ + public ApplicationGetHttpsEndpoint withAdditionalProperties(Map additionalProperties) { + this.additionalProperties = additionalProperties; + return this; + } + + /** + * Get the list of access modes for the application. + * + * @return the accessModes value + */ + public List accessModes() { + return this.accessModes; + } + + /** + * Set the list of access modes for the application. + * + * @param accessModes the accessModes value to set + * @return the ApplicationGetHttpsEndpoint object itself. + */ + public ApplicationGetHttpsEndpoint withAccessModes(List accessModes) { + this.accessModes = accessModes; + return this; + } + + /** + * Get the location of the endpoint. + * + * @return the location value + */ + public String location() { + return this.location; + } + + /** + * Set the location of the endpoint. + * + * @param location the location value to set + * @return the ApplicationGetHttpsEndpoint object itself. + */ + public ApplicationGetHttpsEndpoint withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get the destination port to connect to. + * + * @return the destinationPort value + */ + public Integer destinationPort() { + return this.destinationPort; + } + + /** + * Set the destination port to connect to. + * + * @param destinationPort the destinationPort value to set + * @return the ApplicationGetHttpsEndpoint object itself. + */ + public ApplicationGetHttpsEndpoint withDestinationPort(Integer destinationPort) { + this.destinationPort = destinationPort; + return this; + } + + /** + * Get the public port to connect to. + * + * @return the publicPort value + */ + public Integer publicPort() { + return this.publicPort; + } + + /** + * Set the public port to connect to. + * + * @param publicPort the publicPort value to set + * @return the ApplicationGetHttpsEndpoint object itself. + */ + public ApplicationGetHttpsEndpoint withPublicPort(Integer publicPort) { + this.publicPort = publicPort; + return this; + } + +} diff --git a/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/ApplicationProperties.java b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/ApplicationProperties.java new file mode 100644 index 000000000000..4766b6dbe0f8 --- /dev/null +++ b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/ApplicationProperties.java @@ -0,0 +1,286 @@ +/** + * 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.hdinsight.v2015_03_01_preview; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The HDInsight cluster application GET response. + */ +public class ApplicationProperties { + /** + * The list of roles in the cluster. + */ + @JsonProperty(value = "computeProfile") + private ComputeProfile computeProfile; + + /** + * The list of install script actions. + */ + @JsonProperty(value = "installScriptActions") + private List installScriptActions; + + /** + * The list of uninstall script actions. + */ + @JsonProperty(value = "uninstallScriptActions") + private List uninstallScriptActions; + + /** + * The list of application HTTPS endpoints. + */ + @JsonProperty(value = "httpsEndpoints") + private List httpsEndpoints; + + /** + * The list of application SSH endpoints. + */ + @JsonProperty(value = "sshEndpoints") + private List sshEndpoints; + + /** + * The provisioning state of the application. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /** + * The application type. + */ + @JsonProperty(value = "applicationType") + private String applicationType; + + /** + * The application state. + */ + @JsonProperty(value = "applicationState", access = JsonProperty.Access.WRITE_ONLY) + private String applicationState; + + /** + * The list of errors. + */ + @JsonProperty(value = "errors") + private List errors; + + /** + * The application create date time. + */ + @JsonProperty(value = "createdDate", access = JsonProperty.Access.WRITE_ONLY) + private String createdDate; + + /** + * The marketplace identifier. + */ + @JsonProperty(value = "marketplaceIdentifier", access = JsonProperty.Access.WRITE_ONLY) + private String marketplaceIdentifier; + + /** + * The additional properties for application. + */ + @JsonProperty(value = "additionalProperties") + private String additionalProperties; + + /** + * Get the list of roles in the cluster. + * + * @return the computeProfile value + */ + public ComputeProfile computeProfile() { + return this.computeProfile; + } + + /** + * Set the list of roles in the cluster. + * + * @param computeProfile the computeProfile value to set + * @return the ApplicationProperties object itself. + */ + public ApplicationProperties withComputeProfile(ComputeProfile computeProfile) { + this.computeProfile = computeProfile; + return this; + } + + /** + * Get the list of install script actions. + * + * @return the installScriptActions value + */ + public List installScriptActions() { + return this.installScriptActions; + } + + /** + * Set the list of install script actions. + * + * @param installScriptActions the installScriptActions value to set + * @return the ApplicationProperties object itself. + */ + public ApplicationProperties withInstallScriptActions(List installScriptActions) { + this.installScriptActions = installScriptActions; + return this; + } + + /** + * Get the list of uninstall script actions. + * + * @return the uninstallScriptActions value + */ + public List uninstallScriptActions() { + return this.uninstallScriptActions; + } + + /** + * Set the list of uninstall script actions. + * + * @param uninstallScriptActions the uninstallScriptActions value to set + * @return the ApplicationProperties object itself. + */ + public ApplicationProperties withUninstallScriptActions(List uninstallScriptActions) { + this.uninstallScriptActions = uninstallScriptActions; + return this; + } + + /** + * Get the list of application HTTPS endpoints. + * + * @return the httpsEndpoints value + */ + public List httpsEndpoints() { + return this.httpsEndpoints; + } + + /** + * Set the list of application HTTPS endpoints. + * + * @param httpsEndpoints the httpsEndpoints value to set + * @return the ApplicationProperties object itself. + */ + public ApplicationProperties withHttpsEndpoints(List httpsEndpoints) { + this.httpsEndpoints = httpsEndpoints; + return this; + } + + /** + * Get the list of application SSH endpoints. + * + * @return the sshEndpoints value + */ + public List sshEndpoints() { + return this.sshEndpoints; + } + + /** + * Set the list of application SSH endpoints. + * + * @param sshEndpoints the sshEndpoints value to set + * @return the ApplicationProperties object itself. + */ + public ApplicationProperties withSshEndpoints(List sshEndpoints) { + this.sshEndpoints = sshEndpoints; + return this; + } + + /** + * Get the provisioning state of the application. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get the application type. + * + * @return the applicationType value + */ + public String applicationType() { + return this.applicationType; + } + + /** + * Set the application type. + * + * @param applicationType the applicationType value to set + * @return the ApplicationProperties object itself. + */ + public ApplicationProperties withApplicationType(String applicationType) { + this.applicationType = applicationType; + return this; + } + + /** + * Get the application state. + * + * @return the applicationState value + */ + public String applicationState() { + return this.applicationState; + } + + /** + * Get the list of errors. + * + * @return the errors value + */ + public List errors() { + return this.errors; + } + + /** + * Set the list of errors. + * + * @param errors the errors value to set + * @return the ApplicationProperties object itself. + */ + public ApplicationProperties withErrors(List errors) { + this.errors = errors; + return this; + } + + /** + * Get the application create date time. + * + * @return the createdDate value + */ + public String createdDate() { + return this.createdDate; + } + + /** + * Get the marketplace identifier. + * + * @return the marketplaceIdentifier value + */ + public String marketplaceIdentifier() { + return this.marketplaceIdentifier; + } + + /** + * Get the additional properties for application. + * + * @return the additionalProperties value + */ + public String additionalProperties() { + return this.additionalProperties; + } + + /** + * Set the additional properties for application. + * + * @param additionalProperties the additionalProperties value to set + * @return the ApplicationProperties object itself. + */ + public ApplicationProperties withAdditionalProperties(String additionalProperties) { + this.additionalProperties = additionalProperties; + return this; + } + +} diff --git a/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/Applications.java b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/Applications.java new file mode 100644 index 000000000000..cd4e43545737 --- /dev/null +++ b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/Applications.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.hdinsight.v2015_03_01_preview; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import rx.Completable; +import rx.Observable; +import com.microsoft.azure.management.hdinsight.v2015_03_01_preview.implementation.ApplicationsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing Applications. + */ +public interface Applications extends SupportsCreating, HasInner { + /** + * Lists properties of the specified application. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param applicationName The constant value for the application name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String clusterName, String applicationName); + + /** + * Lists all of the applications for the HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(final String resourceGroupName, final String clusterName); + + /** + * Deletes the specified application on the HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param applicationName The constant value for the application name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable deleteAsync(String resourceGroupName, String clusterName, String applicationName); + +} diff --git a/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/AsyncOperationState.java b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/AsyncOperationState.java new file mode 100644 index 000000000000..b4114684d7be --- /dev/null +++ b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/AsyncOperationState.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.hdinsight.v2015_03_01_preview; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for AsyncOperationState. + */ +public enum AsyncOperationState { + /** Enum value InProgress. */ + IN_PROGRESS("InProgress"), + + /** Enum value Succeeded. */ + SUCCEEDED("Succeeded"), + + /** Enum value Failed. */ + FAILED("Failed"); + + /** The actual serialized value for a AsyncOperationState instance. */ + private String value; + + AsyncOperationState(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a AsyncOperationState instance. + * + * @param value the serialized value to parse. + * @return the parsed AsyncOperationState object, or null if unable to parse. + */ + @JsonCreator + public static AsyncOperationState fromString(String value) { + AsyncOperationState[] items = AsyncOperationState.values(); + for (AsyncOperationState item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/CapabilitiesResult.java b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/CapabilitiesResult.java new file mode 100644 index 000000000000..30af6b8ba26f --- /dev/null +++ b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/CapabilitiesResult.java @@ -0,0 +1,52 @@ +/** + * 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.hdinsight.v2015_03_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.hdinsight.v2015_03_01_preview.implementation.HDInsightManager; +import com.microsoft.azure.management.hdinsight.v2015_03_01_preview.implementation.CapabilitiesResultInner; +import java.util.List; +import java.util.Map; + +/** + * Type representing CapabilitiesResult. + */ +public interface CapabilitiesResult extends HasInner, HasManager { + /** + * @return the features value. + */ + List features(); + + /** + * @return the quota value. + */ + QuotaCapability quota(); + + /** + * @return the regions value. + */ + Map regions(); + + /** + * @return the versions value. + */ + Map versions(); + + /** + * @return the vmSizeFilters value. + */ + List vmSizeFilters(); + + /** + * @return the vmSizes value. + */ + Map vmSizes(); + +} diff --git a/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/Cluster.java b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/Cluster.java new file mode 100644 index 000000000000..eb0d21be238e --- /dev/null +++ b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/Cluster.java @@ -0,0 +1,102 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2015_03_01_preview; + +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.hdinsight.v2015_03_01_preview.implementation.HDInsightManager; +import com.microsoft.azure.management.hdinsight.v2015_03_01_preview.implementation.ClusterInner; + +/** + * Type representing Cluster. + */ +public interface Cluster extends HasInner, Resource, GroupableResourceCore, HasResourceGroup, Refreshable, Updatable, HasManager { + /** + * @return the etag value. + */ + String etag(); + + /** + * @return the properties value. + */ + ClusterGetProperties properties(); + + /** + * The entirety of the Cluster definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithGroup, DefinitionStages.WithCreate { + } + + /** + * Grouping of Cluster definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a Cluster definition. + */ + interface Blank extends GroupableResourceCore.DefinitionWithRegion { + } + + /** + * The stage of the Cluster definition allowing to specify the resource group. + */ + interface WithGroup extends GroupableResourceCore.DefinitionStages.WithGroup { + } + + /** + * The stage of the cluster definition allowing to specify Properties. + */ + interface WithProperties { + /** + * Specifies properties. + * @param properties The cluster create parameters + * @return the next definition stage + */ + WithCreate withProperties(ClusterCreateProperties 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.WithProperties { + } + } + /** + * The template for a Cluster update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, Resource.UpdateWithTags, UpdateStages.WithProperties { + } + + /** + * Grouping of Cluster update stages. + */ + interface UpdateStages { + /** + * The stage of the cluster update allowing to specify Properties. + */ + interface WithProperties { + /** + * Specifies properties. + * @param properties The cluster create parameters + * @return the next update stage + */ + Update withProperties(ClusterCreateProperties properties); + } + + } +} diff --git a/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/ClusterCreateParametersExtended.java b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/ClusterCreateParametersExtended.java new file mode 100644 index 000000000000..2a0e78442d46 --- /dev/null +++ b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/ClusterCreateParametersExtended.java @@ -0,0 +1,96 @@ +/** + * 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.hdinsight.v2015_03_01_preview; + +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The CreateCluster request parameters. + */ +public class ClusterCreateParametersExtended { + /** + * The location of the cluster. + */ + @JsonProperty(value = "location") + private String location; + + /** + * The resource tags. + */ + @JsonProperty(value = "tags") + private Map tags; + + /** + * The cluster create parameters. + */ + @JsonProperty(value = "properties") + private ClusterCreateProperties properties; + + /** + * Get the location of the cluster. + * + * @return the location value + */ + public String location() { + return this.location; + } + + /** + * Set the location of the cluster. + * + * @param location the location value to set + * @return the ClusterCreateParametersExtended object itself. + */ + public ClusterCreateParametersExtended withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get the resource tags. + * + * @return the tags value + */ + public Map tags() { + return this.tags; + } + + /** + * Set the resource tags. + * + * @param tags the tags value to set + * @return the ClusterCreateParametersExtended object itself. + */ + public ClusterCreateParametersExtended withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Get the cluster create parameters. + * + * @return the properties value + */ + public ClusterCreateProperties properties() { + return this.properties; + } + + /** + * Set the cluster create parameters. + * + * @param properties the properties value to set + * @return the ClusterCreateParametersExtended object itself. + */ + public ClusterCreateParametersExtended withProperties(ClusterCreateProperties properties) { + this.properties = properties; + return this; + } + +} diff --git a/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/ClusterCreateProperties.java b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/ClusterCreateProperties.java new file mode 100644 index 000000000000..9ca2b6a9d2af --- /dev/null +++ b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/ClusterCreateProperties.java @@ -0,0 +1,200 @@ +/** + * 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.hdinsight.v2015_03_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The cluster create parameters. + */ +public class ClusterCreateProperties { + /** + * The version of the cluster. + */ + @JsonProperty(value = "clusterVersion") + private String clusterVersion; + + /** + * The type of operating system. Possible values include: 'Windows', + * 'Linux'. + */ + @JsonProperty(value = "osType") + private OSType osType; + + /** + * The cluster tier. Possible values include: 'Standard', 'Premium'. + */ + @JsonProperty(value = "tier") + private Tier tier; + + /** + * The cluster definition. + */ + @JsonProperty(value = "clusterDefinition") + private ClusterDefinition clusterDefinition; + + /** + * The security profile. + */ + @JsonProperty(value = "securityProfile") + private SecurityProfile securityProfile; + + /** + * The compute profile. + */ + @JsonProperty(value = "computeProfile") + private ComputeProfile computeProfile; + + /** + * The storage profile. + */ + @JsonProperty(value = "storageProfile") + private StorageProfile storageProfile; + + /** + * Get the version of the cluster. + * + * @return the clusterVersion value + */ + public String clusterVersion() { + return this.clusterVersion; + } + + /** + * Set the version of the cluster. + * + * @param clusterVersion the clusterVersion value to set + * @return the ClusterCreateProperties object itself. + */ + public ClusterCreateProperties withClusterVersion(String clusterVersion) { + this.clusterVersion = clusterVersion; + return this; + } + + /** + * Get the type of operating system. Possible values include: 'Windows', 'Linux'. + * + * @return the osType value + */ + public OSType osType() { + return this.osType; + } + + /** + * Set the type of operating system. Possible values include: 'Windows', 'Linux'. + * + * @param osType the osType value to set + * @return the ClusterCreateProperties object itself. + */ + public ClusterCreateProperties withOsType(OSType osType) { + this.osType = osType; + return this; + } + + /** + * Get the cluster tier. Possible values include: 'Standard', 'Premium'. + * + * @return the tier value + */ + public Tier tier() { + return this.tier; + } + + /** + * Set the cluster tier. Possible values include: 'Standard', 'Premium'. + * + * @param tier the tier value to set + * @return the ClusterCreateProperties object itself. + */ + public ClusterCreateProperties withTier(Tier tier) { + this.tier = tier; + return this; + } + + /** + * Get the cluster definition. + * + * @return the clusterDefinition value + */ + public ClusterDefinition clusterDefinition() { + return this.clusterDefinition; + } + + /** + * Set the cluster definition. + * + * @param clusterDefinition the clusterDefinition value to set + * @return the ClusterCreateProperties object itself. + */ + public ClusterCreateProperties withClusterDefinition(ClusterDefinition clusterDefinition) { + this.clusterDefinition = clusterDefinition; + return this; + } + + /** + * Get the security profile. + * + * @return the securityProfile value + */ + public SecurityProfile securityProfile() { + return this.securityProfile; + } + + /** + * Set the security profile. + * + * @param securityProfile the securityProfile value to set + * @return the ClusterCreateProperties object itself. + */ + public ClusterCreateProperties withSecurityProfile(SecurityProfile securityProfile) { + this.securityProfile = securityProfile; + return this; + } + + /** + * Get the compute profile. + * + * @return the computeProfile value + */ + public ComputeProfile computeProfile() { + return this.computeProfile; + } + + /** + * Set the compute profile. + * + * @param computeProfile the computeProfile value to set + * @return the ClusterCreateProperties object itself. + */ + public ClusterCreateProperties withComputeProfile(ComputeProfile computeProfile) { + this.computeProfile = computeProfile; + return this; + } + + /** + * Get the storage profile. + * + * @return the storageProfile value + */ + public StorageProfile storageProfile() { + return this.storageProfile; + } + + /** + * Set the storage profile. + * + * @param storageProfile the storageProfile value to set + * @return the ClusterCreateProperties object itself. + */ + public ClusterCreateProperties withStorageProfile(StorageProfile storageProfile) { + this.storageProfile = storageProfile; + return this; + } + +} diff --git a/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/ClusterDefinition.java b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/ClusterDefinition.java new file mode 100644 index 000000000000..33fff49e4d75 --- /dev/null +++ b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/ClusterDefinition.java @@ -0,0 +1,122 @@ +/** + * 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.hdinsight.v2015_03_01_preview; + +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The cluster definition. + */ +public class ClusterDefinition { + /** + * The link to the blueprint. + */ + @JsonProperty(value = "blueprint") + private String blueprint; + + /** + * The type of cluster. + */ + @JsonProperty(value = "kind") + private String kind; + + /** + * The versions of different services in the cluster. + */ + @JsonProperty(value = "componentVersion") + private Map componentVersion; + + /** + * The cluster configurations. + */ + @JsonProperty(value = "configurations") + private Object configurations; + + /** + * Get the link to the blueprint. + * + * @return the blueprint value + */ + public String blueprint() { + return this.blueprint; + } + + /** + * Set the link to the blueprint. + * + * @param blueprint the blueprint value to set + * @return the ClusterDefinition object itself. + */ + public ClusterDefinition withBlueprint(String blueprint) { + this.blueprint = blueprint; + return this; + } + + /** + * Get the type of cluster. + * + * @return the kind value + */ + public String kind() { + return this.kind; + } + + /** + * Set the type of cluster. + * + * @param kind the kind value to set + * @return the ClusterDefinition object itself. + */ + public ClusterDefinition withKind(String kind) { + this.kind = kind; + return this; + } + + /** + * Get the versions of different services in the cluster. + * + * @return the componentVersion value + */ + public Map componentVersion() { + return this.componentVersion; + } + + /** + * Set the versions of different services in the cluster. + * + * @param componentVersion the componentVersion value to set + * @return the ClusterDefinition object itself. + */ + public ClusterDefinition withComponentVersion(Map componentVersion) { + this.componentVersion = componentVersion; + return this; + } + + /** + * Get the cluster configurations. + * + * @return the configurations value + */ + public Object configurations() { + return this.configurations; + } + + /** + * Set the cluster configurations. + * + * @param configurations the configurations value to set + * @return the ClusterDefinition object itself. + */ + public ClusterDefinition withConfigurations(Object configurations) { + this.configurations = configurations; + return this; + } + +} diff --git a/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/ClusterGetProperties.java b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/ClusterGetProperties.java new file mode 100644 index 000000000000..0326f67f19d4 --- /dev/null +++ b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/ClusterGetProperties.java @@ -0,0 +1,333 @@ +/** + * 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.hdinsight.v2015_03_01_preview; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The properties of cluster. + */ +public class ClusterGetProperties { + /** + * The version of the cluster. + */ + @JsonProperty(value = "clusterVersion") + private String clusterVersion; + + /** + * The type of operating system. Possible values include: 'Windows', + * 'Linux'. + */ + @JsonProperty(value = "osType") + private OSType osType; + + /** + * The cluster tier. Possible values include: 'Standard', 'Premium'. + */ + @JsonProperty(value = "tier") + private Tier tier; + + /** + * The cluster definition. + */ + @JsonProperty(value = "clusterDefinition", required = true) + private ClusterDefinition clusterDefinition; + + /** + * The security profile. + */ + @JsonProperty(value = "securityProfile") + private SecurityProfile securityProfile; + + /** + * The compute profile. + */ + @JsonProperty(value = "computeProfile") + private ComputeProfile computeProfile; + + /** + * The provisioning state, which only appears in the response. Possible + * values include: 'InProgress', 'Failed', 'Succeeded', 'Canceled', + * 'Deleting'. + */ + @JsonProperty(value = "provisioningState") + private HDInsightClusterProvisioningState provisioningState; + + /** + * The date on which the cluster was created. + */ + @JsonProperty(value = "createdDate") + private String createdDate; + + /** + * The state of the cluster. + */ + @JsonProperty(value = "clusterState") + private String clusterState; + + /** + * The quota information. + */ + @JsonProperty(value = "quotaInfo") + private QuotaInfo quotaInfo; + + /** + * The list of errors. + */ + @JsonProperty(value = "errors") + private List errors; + + /** + * The list of connectivity endpoints. + */ + @JsonProperty(value = "connectivityEndpoints") + private List connectivityEndpoints; + + /** + * Get the version of the cluster. + * + * @return the clusterVersion value + */ + public String clusterVersion() { + return this.clusterVersion; + } + + /** + * Set the version of the cluster. + * + * @param clusterVersion the clusterVersion value to set + * @return the ClusterGetProperties object itself. + */ + public ClusterGetProperties withClusterVersion(String clusterVersion) { + this.clusterVersion = clusterVersion; + return this; + } + + /** + * Get the type of operating system. Possible values include: 'Windows', 'Linux'. + * + * @return the osType value + */ + public OSType osType() { + return this.osType; + } + + /** + * Set the type of operating system. Possible values include: 'Windows', 'Linux'. + * + * @param osType the osType value to set + * @return the ClusterGetProperties object itself. + */ + public ClusterGetProperties withOsType(OSType osType) { + this.osType = osType; + return this; + } + + /** + * Get the cluster tier. Possible values include: 'Standard', 'Premium'. + * + * @return the tier value + */ + public Tier tier() { + return this.tier; + } + + /** + * Set the cluster tier. Possible values include: 'Standard', 'Premium'. + * + * @param tier the tier value to set + * @return the ClusterGetProperties object itself. + */ + public ClusterGetProperties withTier(Tier tier) { + this.tier = tier; + return this; + } + + /** + * Get the cluster definition. + * + * @return the clusterDefinition value + */ + public ClusterDefinition clusterDefinition() { + return this.clusterDefinition; + } + + /** + * Set the cluster definition. + * + * @param clusterDefinition the clusterDefinition value to set + * @return the ClusterGetProperties object itself. + */ + public ClusterGetProperties withClusterDefinition(ClusterDefinition clusterDefinition) { + this.clusterDefinition = clusterDefinition; + return this; + } + + /** + * Get the security profile. + * + * @return the securityProfile value + */ + public SecurityProfile securityProfile() { + return this.securityProfile; + } + + /** + * Set the security profile. + * + * @param securityProfile the securityProfile value to set + * @return the ClusterGetProperties object itself. + */ + public ClusterGetProperties withSecurityProfile(SecurityProfile securityProfile) { + this.securityProfile = securityProfile; + return this; + } + + /** + * Get the compute profile. + * + * @return the computeProfile value + */ + public ComputeProfile computeProfile() { + return this.computeProfile; + } + + /** + * Set the compute profile. + * + * @param computeProfile the computeProfile value to set + * @return the ClusterGetProperties object itself. + */ + public ClusterGetProperties withComputeProfile(ComputeProfile computeProfile) { + this.computeProfile = computeProfile; + return this; + } + + /** + * Get the provisioning state, which only appears in the response. Possible values include: 'InProgress', 'Failed', 'Succeeded', 'Canceled', 'Deleting'. + * + * @return the provisioningState value + */ + public HDInsightClusterProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Set the provisioning state, which only appears in the response. Possible values include: 'InProgress', 'Failed', 'Succeeded', 'Canceled', 'Deleting'. + * + * @param provisioningState the provisioningState value to set + * @return the ClusterGetProperties object itself. + */ + public ClusterGetProperties withProvisioningState(HDInsightClusterProvisioningState provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * Get the date on which the cluster was created. + * + * @return the createdDate value + */ + public String createdDate() { + return this.createdDate; + } + + /** + * Set the date on which the cluster was created. + * + * @param createdDate the createdDate value to set + * @return the ClusterGetProperties object itself. + */ + public ClusterGetProperties withCreatedDate(String createdDate) { + this.createdDate = createdDate; + return this; + } + + /** + * Get the state of the cluster. + * + * @return the clusterState value + */ + public String clusterState() { + return this.clusterState; + } + + /** + * Set the state of the cluster. + * + * @param clusterState the clusterState value to set + * @return the ClusterGetProperties object itself. + */ + public ClusterGetProperties withClusterState(String clusterState) { + this.clusterState = clusterState; + return this; + } + + /** + * Get the quota information. + * + * @return the quotaInfo value + */ + public QuotaInfo quotaInfo() { + return this.quotaInfo; + } + + /** + * Set the quota information. + * + * @param quotaInfo the quotaInfo value to set + * @return the ClusterGetProperties object itself. + */ + public ClusterGetProperties withQuotaInfo(QuotaInfo quotaInfo) { + this.quotaInfo = quotaInfo; + return this; + } + + /** + * Get the list of errors. + * + * @return the errors value + */ + public List errors() { + return this.errors; + } + + /** + * Set the list of errors. + * + * @param errors the errors value to set + * @return the ClusterGetProperties object itself. + */ + public ClusterGetProperties withErrors(List errors) { + this.errors = errors; + return this; + } + + /** + * Get the list of connectivity endpoints. + * + * @return the connectivityEndpoints value + */ + public List connectivityEndpoints() { + return this.connectivityEndpoints; + } + + /** + * Set the list of connectivity endpoints. + * + * @param connectivityEndpoints the connectivityEndpoints value to set + * @return the ClusterGetProperties object itself. + */ + public ClusterGetProperties withConnectivityEndpoints(List connectivityEndpoints) { + this.connectivityEndpoints = connectivityEndpoints; + return this; + } + +} diff --git a/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/ClusterListPersistedScriptActionsResult.java b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/ClusterListPersistedScriptActionsResult.java new file mode 100644 index 000000000000..4771a38f1a69 --- /dev/null +++ b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/ClusterListPersistedScriptActionsResult.java @@ -0,0 +1,59 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2015_03_01_preview; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The ListPersistedScriptActions operation response. + */ +public class ClusterListPersistedScriptActionsResult { + /** + * The list of Persisted Script Actions. + */ + @JsonProperty(value = "value") + private List value; + + /** + * The link (url) to the next page of results. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get the list of Persisted Script Actions. + * + * @return the value value + */ + public List value() { + return this.value; + } + + /** + * Set the list of Persisted Script Actions. + * + * @param value the value value to set + * @return the ClusterListPersistedScriptActionsResult object itself. + */ + public ClusterListPersistedScriptActionsResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the link (url) to the next page of results. + * + * @return the nextLink value + */ + public String nextLink() { + return this.nextLink; + } + +} diff --git a/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/ClusterListRuntimeScriptActionDetailResult.java b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/ClusterListRuntimeScriptActionDetailResult.java new file mode 100644 index 000000000000..dddb68eb68a8 --- /dev/null +++ b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/ClusterListRuntimeScriptActionDetailResult.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. + */ + +package com.microsoft.azure.management.hdinsight.v2015_03_01_preview; + +import java.util.List; +import com.microsoft.azure.management.hdinsight.v2015_03_01_preview.implementation.RuntimeScriptActionDetailInner; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The list runtime script action detail response. + */ +public class ClusterListRuntimeScriptActionDetailResult { + /** + * The list of persisted script action details for the cluster. + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private List value; + + /** + * The link (url) to the next page of results. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get the list of persisted script action details for the cluster. + * + * @return the value value + */ + public List value() { + return this.value; + } + + /** + * Get the link (url) to the next page of results. + * + * @return the nextLink value + */ + public String nextLink() { + return this.nextLink; + } + +} diff --git a/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/ClusterMonitoringRequest.java b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/ClusterMonitoringRequest.java new file mode 100644 index 000000000000..ff83e029de9e --- /dev/null +++ b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/ClusterMonitoringRequest.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.hdinsight.v2015_03_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The Operations Management Suite (OMS) parameters. + */ +public class ClusterMonitoringRequest { + /** + * The Operations Management Suite (OMS) workspace ID. + */ + @JsonProperty(value = "workspaceId") + private String workspaceId; + + /** + * The Operations Management Suite (OMS) workspace key. + */ + @JsonProperty(value = "primaryKey") + private String primaryKey; + + /** + * Get the Operations Management Suite (OMS) workspace ID. + * + * @return the workspaceId value + */ + public String workspaceId() { + return this.workspaceId; + } + + /** + * Set the Operations Management Suite (OMS) workspace ID. + * + * @param workspaceId the workspaceId value to set + * @return the ClusterMonitoringRequest object itself. + */ + public ClusterMonitoringRequest withWorkspaceId(String workspaceId) { + this.workspaceId = workspaceId; + return this; + } + + /** + * Get the Operations Management Suite (OMS) workspace key. + * + * @return the primaryKey value + */ + public String primaryKey() { + return this.primaryKey; + } + + /** + * Set the Operations Management Suite (OMS) workspace key. + * + * @param primaryKey the primaryKey value to set + * @return the ClusterMonitoringRequest object itself. + */ + public ClusterMonitoringRequest withPrimaryKey(String primaryKey) { + this.primaryKey = primaryKey; + return this; + } + +} diff --git a/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/ClusterMonitoringResponse.java b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/ClusterMonitoringResponse.java new file mode 100644 index 000000000000..2c32a0b24c6f --- /dev/null +++ b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/ClusterMonitoringResponse.java @@ -0,0 +1,30 @@ +/** + * 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.hdinsight.v2015_03_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.hdinsight.v2015_03_01_preview.implementation.HDInsightManager; +import com.microsoft.azure.management.hdinsight.v2015_03_01_preview.implementation.ClusterMonitoringResponseInner; + +/** + * Type representing ClusterMonitoringResponse. + */ +public interface ClusterMonitoringResponse extends HasInner, HasManager { + /** + * @return the clusterMonitoringEnabled value. + */ + Boolean clusterMonitoringEnabled(); + + /** + * @return the workspaceId value. + */ + String workspaceId(); + +} diff --git a/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/ClusterPatchParameters.java b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/ClusterPatchParameters.java new file mode 100644 index 000000000000..0a0e38b05177 --- /dev/null +++ b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/ClusterPatchParameters.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.hdinsight.v2015_03_01_preview; + +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The PatchCluster request parameters. + */ +public class ClusterPatchParameters { + /** + * The resource tags. + */ + @JsonProperty(value = "tags") + private Map tags; + + /** + * Get the resource tags. + * + * @return the tags value + */ + public Map tags() { + return this.tags; + } + + /** + * Set the resource tags. + * + * @param tags the tags value to set + * @return the ClusterPatchParameters object itself. + */ + public ClusterPatchParameters withTags(Map tags) { + this.tags = tags; + return this; + } + +} diff --git a/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/ClusterResizeParameters.java b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/ClusterResizeParameters.java new file mode 100644 index 000000000000..19d32fc0983b --- /dev/null +++ b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/ClusterResizeParameters.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.hdinsight.v2015_03_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The Resize Cluster request parameters. + */ +public class ClusterResizeParameters { + /** + * The target instance count for the operation. + */ + @JsonProperty(value = "targetInstanceCount") + private Integer targetInstanceCount; + + /** + * Get the target instance count for the operation. + * + * @return the targetInstanceCount value + */ + public Integer targetInstanceCount() { + return this.targetInstanceCount; + } + + /** + * Set the target instance count for the operation. + * + * @param targetInstanceCount the targetInstanceCount value to set + * @return the ClusterResizeParameters object itself. + */ + public ClusterResizeParameters withTargetInstanceCount(Integer targetInstanceCount) { + this.targetInstanceCount = targetInstanceCount; + return this; + } + +} diff --git a/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/Clusters.java b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/Clusters.java new file mode 100644 index 000000000000..b7bf37ff2259 --- /dev/null +++ b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/Clusters.java @@ -0,0 +1,47 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2015_03_01_preview; + +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 rx.Completable; +import com.microsoft.azure.management.hdinsight.v2015_03_01_preview.implementation.ClustersInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing Clusters. + */ +public interface Clusters extends SupportsCreating, SupportsDeletingByResourceGroup, SupportsBatchDeletion, SupportsGettingByResourceGroup, SupportsListingByResourceGroup, SupportsListing, HasInner { + /** + * Executes script actions on the specified HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param parameters The parameters for executing script actions. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable executeScriptActionsAsync(String resourceGroupName, String clusterName, ExecuteScriptActionParameters parameters); + + /** + * Resizes the specified HDInsight cluster to the specified size. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable resizeAsync(String resourceGroupName, String clusterName); + +} diff --git a/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/ComputeProfile.java b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/ComputeProfile.java new file mode 100644 index 000000000000..3b49a2fa7da1 --- /dev/null +++ b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/ComputeProfile.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.hdinsight.v2015_03_01_preview; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Describes the compute profile. + */ +public class ComputeProfile { + /** + * The list of roles in the cluster. + */ + @JsonProperty(value = "roles") + private List roles; + + /** + * Get the list of roles in the cluster. + * + * @return the roles value + */ + public List roles() { + return this.roles; + } + + /** + * Set the list of roles in the cluster. + * + * @param roles the roles value to set + * @return the ComputeProfile object itself. + */ + public ComputeProfile withRoles(List roles) { + this.roles = roles; + return this; + } + +} diff --git a/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/Configurations.java b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/Configurations.java new file mode 100644 index 000000000000..73311cdf5fdf --- /dev/null +++ b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/Configurations.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.hdinsight.v2015_03_01_preview; + +import rx.Completable; +import rx.Observable; +import java.util.Map; +import com.microsoft.azure.management.hdinsight.v2015_03_01_preview.implementation.ConfigurationsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing Configurations. + */ +public interface Configurations extends HasInner { + /** + * Configures the HTTP settings on the specified cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param configurationName The name of the cluster configuration. + * @param parameters The cluster configurations. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable updateHTTPSettingsAsync(String resourceGroupName, String clusterName, String configurationName, Map parameters); + + /** + * The configuration object for the specified cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param configurationName The name of the cluster configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable> getAsync(String resourceGroupName, String clusterName, String configurationName); + +} diff --git a/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/ConnectivityEndpoint.java b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/ConnectivityEndpoint.java new file mode 100644 index 000000000000..027cef539a5f --- /dev/null +++ b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/ConnectivityEndpoint.java @@ -0,0 +1,121 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2015_03_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The connectivity properties. + */ +public class ConnectivityEndpoint { + /** + * The name of the endpoint. + */ + @JsonProperty(value = "name") + private String name; + + /** + * The protocol of the endpoint. + */ + @JsonProperty(value = "protocol") + private String protocol; + + /** + * The location of the endpoint. + */ + @JsonProperty(value = "location") + private String location; + + /** + * The port to connect to. + */ + @JsonProperty(value = "port") + private Integer port; + + /** + * Get the name of the endpoint. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name of the endpoint. + * + * @param name the name value to set + * @return the ConnectivityEndpoint object itself. + */ + public ConnectivityEndpoint withName(String name) { + this.name = name; + return this; + } + + /** + * Get the protocol of the endpoint. + * + * @return the protocol value + */ + public String protocol() { + return this.protocol; + } + + /** + * Set the protocol of the endpoint. + * + * @param protocol the protocol value to set + * @return the ConnectivityEndpoint object itself. + */ + public ConnectivityEndpoint withProtocol(String protocol) { + this.protocol = protocol; + return this; + } + + /** + * Get the location of the endpoint. + * + * @return the location value + */ + public String location() { + return this.location; + } + + /** + * Set the location of the endpoint. + * + * @param location the location value to set + * @return the ConnectivityEndpoint object itself. + */ + public ConnectivityEndpoint withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get the port to connect to. + * + * @return the port value + */ + public Integer port() { + return this.port; + } + + /** + * Set the port to connect to. + * + * @param port the port value to set + * @return the ConnectivityEndpoint object itself. + */ + public ConnectivityEndpoint withPort(Integer port) { + this.port = port; + return this; + } + +} diff --git a/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/DataDisksGroups.java b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/DataDisksGroups.java new file mode 100644 index 000000000000..31b64622a8a5 --- /dev/null +++ b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/DataDisksGroups.java @@ -0,0 +1,73 @@ +/** + * 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.hdinsight.v2015_03_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The data disks groups for the role. + */ +public class DataDisksGroups { + /** + * The number of disks per node. + */ + @JsonProperty(value = "disksPerNode") + private Integer disksPerNode; + + /** + * ReadOnly. The storage account type. Do not set this value. + */ + @JsonProperty(value = "storageAccountType", access = JsonProperty.Access.WRITE_ONLY) + private String storageAccountType; + + /** + * ReadOnly. The DiskSize in GB. Do not set this value. + */ + @JsonProperty(value = "diskSizeGB", access = JsonProperty.Access.WRITE_ONLY) + private Integer diskSizeGB; + + /** + * Get the number of disks per node. + * + * @return the disksPerNode value + */ + public Integer disksPerNode() { + return this.disksPerNode; + } + + /** + * Set the number of disks per node. + * + * @param disksPerNode the disksPerNode value to set + * @return the DataDisksGroups object itself. + */ + public DataDisksGroups withDisksPerNode(Integer disksPerNode) { + this.disksPerNode = disksPerNode; + return this; + } + + /** + * Get readOnly. The storage account type. Do not set this value. + * + * @return the storageAccountType value + */ + public String storageAccountType() { + return this.storageAccountType; + } + + /** + * Get readOnly. The DiskSize in GB. Do not set this value. + * + * @return the diskSizeGB value + */ + public Integer diskSizeGB() { + return this.diskSizeGB; + } + +} diff --git a/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/DirectoryType.java b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/DirectoryType.java new file mode 100644 index 000000000000..4fe9085467f5 --- /dev/null +++ b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/DirectoryType.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.hdinsight.v2015_03_01_preview; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for DirectoryType. + */ +public enum DirectoryType { + /** Enum value ActiveDirectory. */ + ACTIVE_DIRECTORY("ActiveDirectory"); + + /** The actual serialized value for a DirectoryType instance. */ + private String value; + + DirectoryType(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a DirectoryType instance. + * + * @param value the serialized value to parse. + * @return the parsed DirectoryType object, or null if unable to parse. + */ + @JsonCreator + public static DirectoryType fromString(String value) { + DirectoryType[] items = DirectoryType.values(); + for (DirectoryType item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/ErrorResponse.java b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/ErrorResponse.java new file mode 100644 index 000000000000..74b4ce7963de --- /dev/null +++ b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/ErrorResponse.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.hdinsight.v2015_03_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Describes the format of Error response. + */ +public class ErrorResponse { + /** + * Error code. + */ + @JsonProperty(value = "code") + private String code; + + /** + * Error message indicating why the operation failed. + */ + @JsonProperty(value = "message") + private String message; + + /** + * Get error code. + * + * @return the code value + */ + public String code() { + return this.code; + } + + /** + * Set error code. + * + * @param code the code value to set + * @return the ErrorResponse object itself. + */ + public ErrorResponse withCode(String code) { + this.code = code; + return this; + } + + /** + * Get error message indicating why the operation failed. + * + * @return the message value + */ + public String message() { + return this.message; + } + + /** + * Set error message indicating why the operation failed. + * + * @param message the message value to set + * @return the ErrorResponse object itself. + */ + public ErrorResponse withMessage(String message) { + this.message = message; + return this; + } + +} diff --git a/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/ErrorResponseException.java b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/ErrorResponseException.java new file mode 100644 index 000000000000..6df5999302d6 --- /dev/null +++ b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/ErrorResponseException.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.hdinsight.v2015_03_01_preview; + +import com.microsoft.rest.RestException; +import okhttp3.ResponseBody; +import retrofit2.Response; + +/** + * Exception thrown for an invalid response with ErrorResponse information. + */ +public class ErrorResponseException extends RestException { + /** + * Initializes a new instance of the ErrorResponseException class. + * + * @param message the exception message or the response content if a message is not available + * @param response the HTTP response + */ + public ErrorResponseException(final String message, final Response response) { + super(message, response); + } + + /** + * Initializes a new instance of the ErrorResponseException 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 ErrorResponseException(final String message, final Response response, final ErrorResponse body) { + super(message, response, body); + } + + @Override + public ErrorResponse body() { + return (ErrorResponse) super.body(); + } +} diff --git a/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/Errors.java b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/Errors.java new file mode 100644 index 000000000000..b24aeb115300 --- /dev/null +++ b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/Errors.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.hdinsight.v2015_03_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The error message associated with the cluster creation. + */ +public class Errors { + /** + * The error code. + */ + @JsonProperty(value = "code") + private String code; + + /** + * The error message. + */ + @JsonProperty(value = "message") + private String message; + + /** + * Get the error code. + * + * @return the code value + */ + public String code() { + return this.code; + } + + /** + * Set the error code. + * + * @param code the code value to set + * @return the Errors object itself. + */ + public Errors withCode(String code) { + this.code = code; + return this; + } + + /** + * Get the error message. + * + * @return the message value + */ + public String message() { + return this.message; + } + + /** + * Set the error message. + * + * @param message the message value to set + * @return the Errors object itself. + */ + public Errors withMessage(String message) { + this.message = message; + return this; + } + +} diff --git a/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/ExecuteScriptActionParameters.java b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/ExecuteScriptActionParameters.java new file mode 100644 index 000000000000..394d93dd00d6 --- /dev/null +++ b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/ExecuteScriptActionParameters.java @@ -0,0 +1,70 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2015_03_01_preview; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The parameters for the script actions to execute on a running cluster. + */ +public class ExecuteScriptActionParameters { + /** + * The list of run time script actions. + */ + @JsonProperty(value = "scriptActions") + private List scriptActions; + + /** + * Gets or sets if the scripts needs to be persisted. + */ + @JsonProperty(value = "persistOnSuccess", required = true) + private boolean persistOnSuccess; + + /** + * Get the list of run time script actions. + * + * @return the scriptActions value + */ + public List scriptActions() { + return this.scriptActions; + } + + /** + * Set the list of run time script actions. + * + * @param scriptActions the scriptActions value to set + * @return the ExecuteScriptActionParameters object itself. + */ + public ExecuteScriptActionParameters withScriptActions(List scriptActions) { + this.scriptActions = scriptActions; + return this; + } + + /** + * Get gets or sets if the scripts needs to be persisted. + * + * @return the persistOnSuccess value + */ + public boolean persistOnSuccess() { + return this.persistOnSuccess; + } + + /** + * Set gets or sets if the scripts needs to be persisted. + * + * @param persistOnSuccess the persistOnSuccess value to set + * @return the ExecuteScriptActionParameters object itself. + */ + public ExecuteScriptActionParameters withPersistOnSuccess(boolean persistOnSuccess) { + this.persistOnSuccess = persistOnSuccess; + return this; + } + +} diff --git a/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/Extension.java b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/Extension.java new file mode 100644 index 000000000000..a8bb1a04bc98 --- /dev/null +++ b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/Extension.java @@ -0,0 +1,30 @@ +/** + * 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.hdinsight.v2015_03_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.hdinsight.v2015_03_01_preview.implementation.ExtensionInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.hdinsight.v2015_03_01_preview.implementation.HDInsightManager; + +/** + * Type representing Extension. + */ +public interface Extension extends HasInner, HasManager { + /** + * @return the primaryKey value. + */ + String primaryKey(); + + /** + * @return the workspaceId value. + */ + String workspaceId(); + +} diff --git a/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/Extensions.java b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/Extensions.java new file mode 100644 index 000000000000..0c9a5754e779 --- /dev/null +++ b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/Extensions.java @@ -0,0 +1,86 @@ +/** + * 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.hdinsight.v2015_03_01_preview; + +import rx.Completable; +import rx.Observable; +import com.microsoft.azure.management.hdinsight.v2015_03_01_preview.implementation.ExtensionsInner; +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.hdinsight.v2015_03_01_preview.implementation.ExtensionInner; + +/** + * Type representing Extensions. + */ +public interface Extensions extends HasInner { + /** + * Gets the status of Operations Management Suite (OMS) on the HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getMonitoringStatusAsync(String resourceGroupName, String clusterName); + + /** + * Disables the Operations Management Suite (OMS) on the HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable disableMonitoringAsync(String resourceGroupName, String clusterName); + + /** + * Gets the extension properties for the specified HDInsight cluster extension. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param extensionName The name of the cluster extension. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String clusterName, String extensionName); + + /** + * Deletes the specified extension for HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param extensionName The name of the cluster extension. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable deleteAsync(String resourceGroupName, String clusterName, String extensionName); + + /** + * Enables the Operations Management Suite (OMS) on the HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param parameters The Operations Management Suite (OMS) workspace parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable enableMonitoringAsync(String resourceGroupName, String clusterName, ClusterMonitoringRequest parameters); + + /** + * Creates an HDInsight cluster extension. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param extensionName The name of the cluster extension. + * @param parameters The cluster extensions create request. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable createAsync(String resourceGroupName, String clusterName, String extensionName, ExtensionInner parameters); + +} diff --git a/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/HDInsightClusterProvisioningState.java b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/HDInsightClusterProvisioningState.java new file mode 100644 index 000000000000..9477f8027ca0 --- /dev/null +++ b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/HDInsightClusterProvisioningState.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.hdinsight.v2015_03_01_preview; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for HDInsightClusterProvisioningState. + */ +public enum HDInsightClusterProvisioningState { + /** Enum value InProgress. */ + IN_PROGRESS("InProgress"), + + /** Enum value Failed. */ + FAILED("Failed"), + + /** Enum value Succeeded. */ + SUCCEEDED("Succeeded"), + + /** Enum value Canceled. */ + CANCELED("Canceled"), + + /** Enum value Deleting. */ + DELETING("Deleting"); + + /** The actual serialized value for a HDInsightClusterProvisioningState instance. */ + private String value; + + HDInsightClusterProvisioningState(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a HDInsightClusterProvisioningState instance. + * + * @param value the serialized value to parse. + * @return the parsed HDInsightClusterProvisioningState object, or null if unable to parse. + */ + @JsonCreator + public static HDInsightClusterProvisioningState fromString(String value) { + HDInsightClusterProvisioningState[] items = HDInsightClusterProvisioningState.values(); + for (HDInsightClusterProvisioningState item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/HardwareProfile.java b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/HardwareProfile.java new file mode 100644 index 000000000000..b62f0ff9c61d --- /dev/null +++ b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/HardwareProfile.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.hdinsight.v2015_03_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The hardware profile. + */ +public class HardwareProfile { + /** + * The size of the VM. + */ + @JsonProperty(value = "vmSize") + private String vmSize; + + /** + * Get the size of the VM. + * + * @return the vmSize value + */ + public String vmSize() { + return this.vmSize; + } + + /** + * Set the size of the VM. + * + * @param vmSize the vmSize value to set + * @return the HardwareProfile object itself. + */ + public HardwareProfile withVmSize(String vmSize) { + this.vmSize = vmSize; + return this; + } + +} diff --git a/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/LinuxOperatingSystemProfile.java b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/LinuxOperatingSystemProfile.java new file mode 100644 index 000000000000..6b56e20a709b --- /dev/null +++ b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/LinuxOperatingSystemProfile.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.hdinsight.v2015_03_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The ssh username, password, and ssh public key. + */ +public class LinuxOperatingSystemProfile { + /** + * The username. + */ + @JsonProperty(value = "username") + private String username; + + /** + * The password. + */ + @JsonProperty(value = "password") + private String password; + + /** + * The SSH profile. + */ + @JsonProperty(value = "sshProfile") + private SshProfile sshProfile; + + /** + * Get the username. + * + * @return the username value + */ + public String username() { + return this.username; + } + + /** + * Set the username. + * + * @param username the username value to set + * @return the LinuxOperatingSystemProfile object itself. + */ + public LinuxOperatingSystemProfile withUsername(String username) { + this.username = username; + return this; + } + + /** + * Get the password. + * + * @return the password value + */ + public String password() { + return this.password; + } + + /** + * Set the password. + * + * @param password the password value to set + * @return the LinuxOperatingSystemProfile object itself. + */ + public LinuxOperatingSystemProfile withPassword(String password) { + this.password = password; + return this; + } + + /** + * Get the SSH profile. + * + * @return the sshProfile value + */ + public SshProfile sshProfile() { + return this.sshProfile; + } + + /** + * Set the SSH profile. + * + * @param sshProfile the sshProfile value to set + * @return the LinuxOperatingSystemProfile object itself. + */ + public LinuxOperatingSystemProfile withSshProfile(SshProfile sshProfile) { + this.sshProfile = sshProfile; + return this; + } + +} diff --git a/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/LocalizedName.java b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/LocalizedName.java new file mode 100644 index 000000000000..e0eb4a3a2238 --- /dev/null +++ b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/LocalizedName.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.hdinsight.v2015_03_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The details about the localizable name of a type of usage. + */ +public class LocalizedName { + /** + * The name of the used resource. + */ + @JsonProperty(value = "value") + private String value; + + /** + * The localized name of the used resource. + */ + @JsonProperty(value = "localizedValue") + private String localizedValue; + + /** + * Get the name of the used resource. + * + * @return the value value + */ + public String value() { + return this.value; + } + + /** + * Set the name of the used resource. + * + * @param value the value value to set + * @return the LocalizedName object itself. + */ + public LocalizedName withValue(String value) { + this.value = value; + return this; + } + + /** + * Get the localized name of the used resource. + * + * @return the localizedValue value + */ + public String localizedValue() { + return this.localizedValue; + } + + /** + * Set the localized name of the used resource. + * + * @param localizedValue the localizedValue value to set + * @return the LocalizedName object itself. + */ + public LocalizedName withLocalizedValue(String localizedValue) { + this.localizedValue = localizedValue; + return this; + } + +} diff --git a/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/Locations.java b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/Locations.java new file mode 100644 index 000000000000..6fe5d8500dfc --- /dev/null +++ b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/Locations.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.hdinsight.v2015_03_01_preview; + +import rx.Observable; + +/** + * Type representing Locations. + */ +public interface Locations { + /** + * Gets the capabilities for the specified location. + * + * @param location The location. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getCapabilitiesAsync(String location); + + /** + * Lists the usages for the specified location. + * + * @param location The location. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listUsagesAsync(String location); + +} diff --git a/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/OSType.java b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/OSType.java new file mode 100644 index 000000000000..7f5c5621820c --- /dev/null +++ b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/OSType.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.hdinsight.v2015_03_01_preview; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for OSType. + */ +public enum OSType { + /** Enum value Windows. */ + WINDOWS("Windows"), + + /** Enum value Linux. */ + LINUX("Linux"); + + /** The actual serialized value for a OSType instance. */ + private String value; + + OSType(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a OSType instance. + * + * @param value the serialized value to parse. + * @return the parsed OSType object, or null if unable to parse. + */ + @JsonCreator + public static OSType fromString(String value) { + OSType[] items = OSType.values(); + for (OSType item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/Operation.java b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/Operation.java new file mode 100644 index 000000000000..a3aab4ee0290 --- /dev/null +++ b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/Operation.java @@ -0,0 +1,30 @@ +/** + * 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.hdinsight.v2015_03_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.hdinsight.v2015_03_01_preview.implementation.HDInsightManager; +import com.microsoft.azure.management.hdinsight.v2015_03_01_preview.implementation.OperationInner; + +/** + * Type representing Operation. + */ +public interface Operation extends HasInner, HasManager { + /** + * @return the display value. + */ + OperationDisplay display(); + + /** + * @return the name value. + */ + String name(); + +} diff --git a/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/OperationDisplay.java b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/OperationDisplay.java new file mode 100644 index 000000000000..02795284f566 --- /dev/null +++ b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/OperationDisplay.java @@ -0,0 +1,96 @@ +/** + * 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.hdinsight.v2015_03_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The object that represents the operation. + */ +public class OperationDisplay { + /** + * The service provider: Microsoft.HDInsight. + */ + @JsonProperty(value = "provider") + private String provider; + + /** + * The resource on which the operation is performed: Cluster, Applications, + * etc. + */ + @JsonProperty(value = "resource") + private String resource; + + /** + * The operation type: read, write, delete, etc. + */ + @JsonProperty(value = "operation") + private String operation; + + /** + * Get the service provider: Microsoft.HDInsight. + * + * @return the provider value + */ + public String provider() { + return this.provider; + } + + /** + * Set the service provider: Microsoft.HDInsight. + * + * @param provider the provider value to set + * @return the OperationDisplay object itself. + */ + public OperationDisplay withProvider(String provider) { + this.provider = provider; + return this; + } + + /** + * Get the resource on which the operation is performed: Cluster, Applications, etc. + * + * @return the resource value + */ + public String resource() { + return this.resource; + } + + /** + * Set the resource on which the operation is performed: Cluster, Applications, etc. + * + * @param resource the resource value to set + * @return the OperationDisplay object itself. + */ + public OperationDisplay withResource(String resource) { + this.resource = resource; + return this; + } + + /** + * Get the operation type: read, write, delete, etc. + * + * @return the operation value + */ + public String operation() { + return this.operation; + } + + /** + * Set the operation type: read, write, delete, etc. + * + * @param operation the operation value to set + * @return the OperationDisplay object itself. + */ + public OperationDisplay withOperation(String operation) { + this.operation = operation; + return this; + } + +} diff --git a/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/OperationResource.java b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/OperationResource.java new file mode 100644 index 000000000000..873d830bdaa3 --- /dev/null +++ b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/OperationResource.java @@ -0,0 +1,70 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2015_03_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The azure async operation response. + */ +public class OperationResource { + /** + * The async operation state. Possible values include: 'InProgress', + * 'Succeeded', 'Failed'. + */ + @JsonProperty(value = "status") + private AsyncOperationState status; + + /** + * The operation error information. + */ + @JsonProperty(value = "error") + private Errors error; + + /** + * Get the async operation state. Possible values include: 'InProgress', 'Succeeded', 'Failed'. + * + * @return the status value + */ + public AsyncOperationState status() { + return this.status; + } + + /** + * Set the async operation state. Possible values include: 'InProgress', 'Succeeded', 'Failed'. + * + * @param status the status value to set + * @return the OperationResource object itself. + */ + public OperationResource withStatus(AsyncOperationState status) { + this.status = status; + return this; + } + + /** + * Get the operation error information. + * + * @return the error value + */ + public Errors error() { + return this.error; + } + + /** + * Set the operation error information. + * + * @param error the error value to set + * @return the OperationResource object itself. + */ + public OperationResource withError(Errors error) { + this.error = error; + return this; + } + +} diff --git a/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/Operations.java b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/Operations.java new file mode 100644 index 000000000000..e22be5b83ad6 --- /dev/null +++ b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/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.hdinsight.v2015_03_01_preview; + +import rx.Observable; +import com.microsoft.azure.management.hdinsight.v2015_03_01_preview.implementation.OperationsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing Operations. + */ +public interface Operations extends HasInner { + /** + * Lists all of the available HDInsight REST API operations. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(); + +} diff --git a/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/OsProfile.java b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/OsProfile.java new file mode 100644 index 000000000000..b5f4f2b78c06 --- /dev/null +++ b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/OsProfile.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.hdinsight.v2015_03_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The Linux operation systems profile. + */ +public class OsProfile { + /** + * The Linux OS profile. + */ + @JsonProperty(value = "linuxOperatingSystemProfile") + private LinuxOperatingSystemProfile linuxOperatingSystemProfile; + + /** + * Get the Linux OS profile. + * + * @return the linuxOperatingSystemProfile value + */ + public LinuxOperatingSystemProfile linuxOperatingSystemProfile() { + return this.linuxOperatingSystemProfile; + } + + /** + * Set the Linux OS profile. + * + * @param linuxOperatingSystemProfile the linuxOperatingSystemProfile value to set + * @return the OsProfile object itself. + */ + public OsProfile withLinuxOperatingSystemProfile(LinuxOperatingSystemProfile linuxOperatingSystemProfile) { + this.linuxOperatingSystemProfile = linuxOperatingSystemProfile; + return this; + } + +} diff --git a/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/QuotaCapability.java b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/QuotaCapability.java new file mode 100644 index 000000000000..617b9f05f32f --- /dev/null +++ b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/QuotaCapability.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.hdinsight.v2015_03_01_preview; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The regional quota capability. + */ +public class QuotaCapability { + /** + * The list of region quota capabilities. + */ + @JsonProperty(value = "regionalQuotas") + private List regionalQuotas; + + /** + * Get the list of region quota capabilities. + * + * @return the regionalQuotas value + */ + public List regionalQuotas() { + return this.regionalQuotas; + } + + /** + * Set the list of region quota capabilities. + * + * @param regionalQuotas the regionalQuotas value to set + * @return the QuotaCapability object itself. + */ + public QuotaCapability withRegionalQuotas(List regionalQuotas) { + this.regionalQuotas = regionalQuotas; + return this; + } + +} diff --git a/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/QuotaInfo.java b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/QuotaInfo.java new file mode 100644 index 000000000000..6a8c9f055808 --- /dev/null +++ b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/QuotaInfo.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.hdinsight.v2015_03_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The quota properties for the cluster. + */ +public class QuotaInfo { + /** + * The cores used by the cluster. + */ + @JsonProperty(value = "coresUsed") + private Integer coresUsed; + + /** + * Get the cores used by the cluster. + * + * @return the coresUsed value + */ + public Integer coresUsed() { + return this.coresUsed; + } + + /** + * Set the cores used by the cluster. + * + * @param coresUsed the coresUsed value to set + * @return the QuotaInfo object itself. + */ + public QuotaInfo withCoresUsed(Integer coresUsed) { + this.coresUsed = coresUsed; + return this; + } + +} diff --git a/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/RegionalQuotaCapability.java b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/RegionalQuotaCapability.java new file mode 100644 index 000000000000..24ce926a8128 --- /dev/null +++ b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/RegionalQuotaCapability.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.hdinsight.v2015_03_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The regional quota capacity. + */ +public class RegionalQuotaCapability { + /** + * The region name. + */ + @JsonProperty(value = "region_name") + private String regionName; + + /** + * The number of cores used in the region. + */ + @JsonProperty(value = "cores_used") + private Long coresUsed; + + /** + * The number of courses available in the region. + */ + @JsonProperty(value = "cores_available") + private Long coresAvailable; + + /** + * Get the region name. + * + * @return the regionName value + */ + public String regionName() { + return this.regionName; + } + + /** + * Set the region name. + * + * @param regionName the regionName value to set + * @return the RegionalQuotaCapability object itself. + */ + public RegionalQuotaCapability withRegionName(String regionName) { + this.regionName = regionName; + return this; + } + + /** + * Get the number of cores used in the region. + * + * @return the coresUsed value + */ + public Long coresUsed() { + return this.coresUsed; + } + + /** + * Set the number of cores used in the region. + * + * @param coresUsed the coresUsed value to set + * @return the RegionalQuotaCapability object itself. + */ + public RegionalQuotaCapability withCoresUsed(Long coresUsed) { + this.coresUsed = coresUsed; + return this; + } + + /** + * Get the number of courses available in the region. + * + * @return the coresAvailable value + */ + public Long coresAvailable() { + return this.coresAvailable; + } + + /** + * Set the number of courses available in the region. + * + * @param coresAvailable the coresAvailable value to set + * @return the RegionalQuotaCapability object itself. + */ + public RegionalQuotaCapability withCoresAvailable(Long coresAvailable) { + this.coresAvailable = coresAvailable; + return this; + } + +} diff --git a/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/RegionsCapability.java b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/RegionsCapability.java new file mode 100644 index 000000000000..88d0126b8b36 --- /dev/null +++ b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/RegionsCapability.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.hdinsight.v2015_03_01_preview; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The regions capability. + */ +public class RegionsCapability { + /** + * The list of region capabilities. + */ + @JsonProperty(value = "available") + private List available; + + /** + * Get the list of region capabilities. + * + * @return the available value + */ + public List available() { + return this.available; + } + + /** + * Set the list of region capabilities. + * + * @param available the available value to set + * @return the RegionsCapability object itself. + */ + public RegionsCapability withAvailable(List available) { + this.available = available; + return this; + } + +} diff --git a/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/Role.java b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/Role.java new file mode 100644 index 000000000000..28f0d6ebb5fc --- /dev/null +++ b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/Role.java @@ -0,0 +1,227 @@ +/** + * 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.hdinsight.v2015_03_01_preview; + +import java.util.List; +import com.microsoft.azure.management.hdinsight.v2015_03_01_preview.implementation.ScriptActionInner; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Describes a role on the cluster. + */ +public class Role { + /** + * The name of the role. + */ + @JsonProperty(value = "name") + private String name; + + /** + * The minimum instance count of the cluster. + */ + @JsonProperty(value = "minInstanceCount") + private Integer minInstanceCount; + + /** + * The instance count of the cluster. + */ + @JsonProperty(value = "targetInstanceCount") + private Integer targetInstanceCount; + + /** + * The hardware profile. + */ + @JsonProperty(value = "hardwareProfile") + private HardwareProfile hardwareProfile; + + /** + * The operating system profile. + */ + @JsonProperty(value = "osProfile") + private OsProfile osProfile; + + /** + * The virtual network profile. + */ + @JsonProperty(value = "virtualNetworkProfile") + private VirtualNetworkProfile virtualNetworkProfile; + + /** + * The data disks groups for the role. + */ + @JsonProperty(value = "dataDisksGroups") + private List dataDisksGroups; + + /** + * The list of script actions on the role. + */ + @JsonProperty(value = "scriptActions") + private List scriptActions; + + /** + * Get the name of the role. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name of the role. + * + * @param name the name value to set + * @return the Role object itself. + */ + public Role withName(String name) { + this.name = name; + return this; + } + + /** + * Get the minimum instance count of the cluster. + * + * @return the minInstanceCount value + */ + public Integer minInstanceCount() { + return this.minInstanceCount; + } + + /** + * Set the minimum instance count of the cluster. + * + * @param minInstanceCount the minInstanceCount value to set + * @return the Role object itself. + */ + public Role withMinInstanceCount(Integer minInstanceCount) { + this.minInstanceCount = minInstanceCount; + return this; + } + + /** + * Get the instance count of the cluster. + * + * @return the targetInstanceCount value + */ + public Integer targetInstanceCount() { + return this.targetInstanceCount; + } + + /** + * Set the instance count of the cluster. + * + * @param targetInstanceCount the targetInstanceCount value to set + * @return the Role object itself. + */ + public Role withTargetInstanceCount(Integer targetInstanceCount) { + this.targetInstanceCount = targetInstanceCount; + return this; + } + + /** + * Get the hardware profile. + * + * @return the hardwareProfile value + */ + public HardwareProfile hardwareProfile() { + return this.hardwareProfile; + } + + /** + * Set the hardware profile. + * + * @param hardwareProfile the hardwareProfile value to set + * @return the Role object itself. + */ + public Role withHardwareProfile(HardwareProfile hardwareProfile) { + this.hardwareProfile = hardwareProfile; + return this; + } + + /** + * Get the operating system profile. + * + * @return the osProfile value + */ + public OsProfile osProfile() { + return this.osProfile; + } + + /** + * Set the operating system profile. + * + * @param osProfile the osProfile value to set + * @return the Role object itself. + */ + public Role withOsProfile(OsProfile osProfile) { + this.osProfile = osProfile; + return this; + } + + /** + * Get the virtual network profile. + * + * @return the virtualNetworkProfile value + */ + public VirtualNetworkProfile virtualNetworkProfile() { + return this.virtualNetworkProfile; + } + + /** + * Set the virtual network profile. + * + * @param virtualNetworkProfile the virtualNetworkProfile value to set + * @return the Role object itself. + */ + public Role withVirtualNetworkProfile(VirtualNetworkProfile virtualNetworkProfile) { + this.virtualNetworkProfile = virtualNetworkProfile; + return this; + } + + /** + * Get the data disks groups for the role. + * + * @return the dataDisksGroups value + */ + public List dataDisksGroups() { + return this.dataDisksGroups; + } + + /** + * Set the data disks groups for the role. + * + * @param dataDisksGroups the dataDisksGroups value to set + * @return the Role object itself. + */ + public Role withDataDisksGroups(List dataDisksGroups) { + this.dataDisksGroups = dataDisksGroups; + return this; + } + + /** + * Get the list of script actions on the role. + * + * @return the scriptActions value + */ + public List scriptActions() { + return this.scriptActions; + } + + /** + * Set the list of script actions on the role. + * + * @param scriptActions the scriptActions value to set + * @return the Role object itself. + */ + public Role withScriptActions(List scriptActions) { + this.scriptActions = scriptActions; + return this; + } + +} diff --git a/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/RuntimeScriptAction.java b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/RuntimeScriptAction.java new file mode 100644 index 000000000000..7f48cba55d6f --- /dev/null +++ b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/RuntimeScriptAction.java @@ -0,0 +1,137 @@ +/** + * 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.hdinsight.v2015_03_01_preview; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Describes a script action on a running cluster. + */ +public class RuntimeScriptAction { + /** + * The name of the script action. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /** + * The URI to the script. + */ + @JsonProperty(value = "uri", required = true) + private String uri; + + /** + * The parameters for the script. + */ + @JsonProperty(value = "parameters") + private String parameters; + + /** + * The list of roles where script will be executed. + */ + @JsonProperty(value = "roles", required = true) + private List roles; + + /** + * The application name of the script action, if any. + */ + @JsonProperty(value = "applicationName", access = JsonProperty.Access.WRITE_ONLY) + private String applicationName; + + /** + * Get the name of the script action. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name of the script action. + * + * @param name the name value to set + * @return the RuntimeScriptAction object itself. + */ + public RuntimeScriptAction withName(String name) { + this.name = name; + return this; + } + + /** + * Get the URI to the script. + * + * @return the uri value + */ + public String uri() { + return this.uri; + } + + /** + * Set the URI to the script. + * + * @param uri the uri value to set + * @return the RuntimeScriptAction object itself. + */ + public RuntimeScriptAction withUri(String uri) { + this.uri = uri; + return this; + } + + /** + * Get the parameters for the script. + * + * @return the parameters value + */ + public String parameters() { + return this.parameters; + } + + /** + * Set the parameters for the script. + * + * @param parameters the parameters value to set + * @return the RuntimeScriptAction object itself. + */ + public RuntimeScriptAction withParameters(String parameters) { + this.parameters = parameters; + return this; + } + + /** + * Get the list of roles where script will be executed. + * + * @return the roles value + */ + public List roles() { + return this.roles; + } + + /** + * Set the list of roles where script will be executed. + * + * @param roles the roles value to set + * @return the RuntimeScriptAction object itself. + */ + public RuntimeScriptAction withRoles(List roles) { + this.roles = roles; + return this; + } + + /** + * Get the application name of the script action, if any. + * + * @return the applicationName value + */ + public String applicationName() { + return this.applicationName; + } + +} diff --git a/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/RuntimeScriptActionDetail.java b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/RuntimeScriptActionDetail.java new file mode 100644 index 000000000000..1ebb47d93dff --- /dev/null +++ b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/RuntimeScriptActionDetail.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.hdinsight.v2015_03_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.hdinsight.v2015_03_01_preview.implementation.RuntimeScriptActionDetailInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.hdinsight.v2015_03_01_preview.implementation.HDInsightManager; +import java.util.List; + +/** + * Type representing RuntimeScriptActionDetail. + */ +public interface RuntimeScriptActionDetail extends HasInner, HasManager { + /** + * @return the applicationName value. + */ + String applicationName(); + + /** + * @return the debugInformation value. + */ + String debugInformation(); + + /** + * @return the endTime value. + */ + String endTime(); + + /** + * @return the executionSummary value. + */ + List executionSummary(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the operation value. + */ + String operation(); + + /** + * @return the parameters value. + */ + String parameters(); + + /** + * @return the roles value. + */ + List roles(); + + /** + * @return the scriptExecutionId value. + */ + Long scriptExecutionId(); + + /** + * @return the startTime value. + */ + String startTime(); + + /** + * @return the status value. + */ + String status(); + + /** + * @return the uri value. + */ + String uri(); + +} diff --git a/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/ScriptActionExecutionSummary.java b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/ScriptActionExecutionSummary.java new file mode 100644 index 000000000000..47500214d1b6 --- /dev/null +++ b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/ScriptActionExecutionSummary.java @@ -0,0 +1,47 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2015_03_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The execution summary of a script action. + */ +public class ScriptActionExecutionSummary { + /** + * The status of script action execution. + */ + @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY) + private String status; + + /** + * The instance count for a given script action execution status. + */ + @JsonProperty(value = "instanceCount", access = JsonProperty.Access.WRITE_ONLY) + private Integer instanceCount; + + /** + * Get the status of script action execution. + * + * @return the status value + */ + public String status() { + return this.status; + } + + /** + * Get the instance count for a given script action execution status. + * + * @return the instanceCount value + */ + public Integer instanceCount() { + return this.instanceCount; + } + +} diff --git a/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/ScriptActionPersistedGetResponseSpec.java b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/ScriptActionPersistedGetResponseSpec.java new file mode 100644 index 000000000000..61c41edfe608 --- /dev/null +++ b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/ScriptActionPersistedGetResponseSpec.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.hdinsight.v2015_03_01_preview; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The persisted script action for cluster. + */ +public class ScriptActionPersistedGetResponseSpec { + /** + * The name of script action. + */ + @JsonProperty(value = "name") + private String name; + + /** + * The URI to the script. + */ + @JsonProperty(value = "uri") + private String uri; + + /** + * The parameters for the script provided. + */ + @JsonProperty(value = "parameters") + private String parameters; + + /** + * The list of roles where script will be executed. + */ + @JsonProperty(value = "roles") + private List roles; + + /** + * The application name for the script action. + */ + @JsonProperty(value = "applicationName") + private String applicationName; + + /** + * Get the name of script action. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name of script action. + * + * @param name the name value to set + * @return the ScriptActionPersistedGetResponseSpec object itself. + */ + public ScriptActionPersistedGetResponseSpec withName(String name) { + this.name = name; + return this; + } + + /** + * Get the URI to the script. + * + * @return the uri value + */ + public String uri() { + return this.uri; + } + + /** + * Set the URI to the script. + * + * @param uri the uri value to set + * @return the ScriptActionPersistedGetResponseSpec object itself. + */ + public ScriptActionPersistedGetResponseSpec withUri(String uri) { + this.uri = uri; + return this; + } + + /** + * Get the parameters for the script provided. + * + * @return the parameters value + */ + public String parameters() { + return this.parameters; + } + + /** + * Set the parameters for the script provided. + * + * @param parameters the parameters value to set + * @return the ScriptActionPersistedGetResponseSpec object itself. + */ + public ScriptActionPersistedGetResponseSpec withParameters(String parameters) { + this.parameters = parameters; + return this; + } + + /** + * Get the list of roles where script will be executed. + * + * @return the roles value + */ + public List roles() { + return this.roles; + } + + /** + * Set the list of roles where script will be executed. + * + * @param roles the roles value to set + * @return the ScriptActionPersistedGetResponseSpec object itself. + */ + public ScriptActionPersistedGetResponseSpec withRoles(List roles) { + this.roles = roles; + return this; + } + + /** + * Get the application name for the script action. + * + * @return the applicationName value + */ + public String applicationName() { + return this.applicationName; + } + + /** + * Set the application name for the script action. + * + * @param applicationName the applicationName value to set + * @return the ScriptActionPersistedGetResponseSpec object itself. + */ + public ScriptActionPersistedGetResponseSpec withApplicationName(String applicationName) { + this.applicationName = applicationName; + return this; + } + +} diff --git a/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/ScriptActions.java b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/ScriptActions.java new file mode 100644 index 000000000000..1c17347a6add --- /dev/null +++ b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/ScriptActions.java @@ -0,0 +1,52 @@ +/** + * 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.hdinsight.v2015_03_01_preview; + +import rx.Completable; +import rx.Observable; +import com.microsoft.azure.management.hdinsight.v2015_03_01_preview.implementation.ScriptActionsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing ScriptActions. + */ +public interface ScriptActions extends HasInner { + /** + * Lists all the persisted script actions for the specified cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listPersistedScriptsAsync(final String resourceGroupName, final String clusterName); + + /** + * Deletes a specified persisted script action of the cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param scriptName The name of the script. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable deleteAsync(String resourceGroupName, String clusterName, String scriptName); + + /** + * Gets the script execution detail for the given script execution ID. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param scriptExecutionId The script execution Id + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getExecutionDetailAsync(String resourceGroupName, String clusterName, String scriptExecutionId); + +} diff --git a/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/ScriptExecutionHistorys.java b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/ScriptExecutionHistorys.java new file mode 100644 index 000000000000..43e9d4c92a13 --- /dev/null +++ b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/ScriptExecutionHistorys.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2015_03_01_preview; + +import rx.Completable; +import rx.Observable; +import com.microsoft.azure.management.hdinsight.v2015_03_01_preview.implementation.ScriptExecutionHistorysInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing ScriptExecutionHistorys. + */ +public interface ScriptExecutionHistorys extends HasInner { + /** + * Lists all scripts' execution history for the specified cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(final String resourceGroupName, final String clusterName); + + /** + * Promotes the specified ad-hoc script execution to a persisted script. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param scriptExecutionId The script execution Id + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable promoteAsync(String resourceGroupName, String clusterName, String scriptExecutionId); + +} diff --git a/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/SecurityProfile.java b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/SecurityProfile.java new file mode 100644 index 000000000000..529417dc103d --- /dev/null +++ b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/SecurityProfile.java @@ -0,0 +1,202 @@ +/** + * 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.hdinsight.v2015_03_01_preview; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The security profile which contains Ssh public key for the HDInsight + * cluster. + */ +public class SecurityProfile { + /** + * The directory type. Possible values include: 'ActiveDirectory'. + */ + @JsonProperty(value = "directoryType") + private DirectoryType directoryType; + + /** + * The organization's active directory domain. + */ + @JsonProperty(value = "domain") + private String domain; + + /** + * The organizational unit within the Active Directory to place the cluster + * and service accounts. + */ + @JsonProperty(value = "organizationalUnitDN") + private String organizationalUnitDN; + + /** + * The LDAPS protocol URLs to communicate with the Active Directory. + */ + @JsonProperty(value = "ldapsUrls") + private List ldapsUrls; + + /** + * The domain user account that will have admin privileges on the cluster. + */ + @JsonProperty(value = "domainUsername") + private String domainUsername; + + /** + * The domain admin password. + */ + @JsonProperty(value = "domainUserPassword") + private String domainUserPassword; + + /** + * Optional. The Distinguished Names for cluster user groups. + */ + @JsonProperty(value = "clusterUsersGroupDNs") + private List clusterUsersGroupDNs; + + /** + * Get the directory type. Possible values include: 'ActiveDirectory'. + * + * @return the directoryType value + */ + public DirectoryType directoryType() { + return this.directoryType; + } + + /** + * Set the directory type. Possible values include: 'ActiveDirectory'. + * + * @param directoryType the directoryType value to set + * @return the SecurityProfile object itself. + */ + public SecurityProfile withDirectoryType(DirectoryType directoryType) { + this.directoryType = directoryType; + return this; + } + + /** + * Get the organization's active directory domain. + * + * @return the domain value + */ + public String domain() { + return this.domain; + } + + /** + * Set the organization's active directory domain. + * + * @param domain the domain value to set + * @return the SecurityProfile object itself. + */ + public SecurityProfile withDomain(String domain) { + this.domain = domain; + return this; + } + + /** + * Get the organizational unit within the Active Directory to place the cluster and service accounts. + * + * @return the organizationalUnitDN value + */ + public String organizationalUnitDN() { + return this.organizationalUnitDN; + } + + /** + * Set the organizational unit within the Active Directory to place the cluster and service accounts. + * + * @param organizationalUnitDN the organizationalUnitDN value to set + * @return the SecurityProfile object itself. + */ + public SecurityProfile withOrganizationalUnitDN(String organizationalUnitDN) { + this.organizationalUnitDN = organizationalUnitDN; + return this; + } + + /** + * Get the LDAPS protocol URLs to communicate with the Active Directory. + * + * @return the ldapsUrls value + */ + public List ldapsUrls() { + return this.ldapsUrls; + } + + /** + * Set the LDAPS protocol URLs to communicate with the Active Directory. + * + * @param ldapsUrls the ldapsUrls value to set + * @return the SecurityProfile object itself. + */ + public SecurityProfile withLdapsUrls(List ldapsUrls) { + this.ldapsUrls = ldapsUrls; + return this; + } + + /** + * Get the domain user account that will have admin privileges on the cluster. + * + * @return the domainUsername value + */ + public String domainUsername() { + return this.domainUsername; + } + + /** + * Set the domain user account that will have admin privileges on the cluster. + * + * @param domainUsername the domainUsername value to set + * @return the SecurityProfile object itself. + */ + public SecurityProfile withDomainUsername(String domainUsername) { + this.domainUsername = domainUsername; + return this; + } + + /** + * Get the domain admin password. + * + * @return the domainUserPassword value + */ + public String domainUserPassword() { + return this.domainUserPassword; + } + + /** + * Set the domain admin password. + * + * @param domainUserPassword the domainUserPassword value to set + * @return the SecurityProfile object itself. + */ + public SecurityProfile withDomainUserPassword(String domainUserPassword) { + this.domainUserPassword = domainUserPassword; + return this; + } + + /** + * Get optional. The Distinguished Names for cluster user groups. + * + * @return the clusterUsersGroupDNs value + */ + public List clusterUsersGroupDNs() { + return this.clusterUsersGroupDNs; + } + + /** + * Set optional. The Distinguished Names for cluster user groups. + * + * @param clusterUsersGroupDNs the clusterUsersGroupDNs value to set + * @return the SecurityProfile object itself. + */ + public SecurityProfile withClusterUsersGroupDNs(List clusterUsersGroupDNs) { + this.clusterUsersGroupDNs = clusterUsersGroupDNs; + return this; + } + +} diff --git a/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/SshProfile.java b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/SshProfile.java new file mode 100644 index 000000000000..630e034ccdc8 --- /dev/null +++ b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/SshProfile.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.hdinsight.v2015_03_01_preview; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The list of SSH public keys. + */ +public class SshProfile { + /** + * The list of SSH public keys. + */ + @JsonProperty(value = "publicKeys") + private List publicKeys; + + /** + * Get the list of SSH public keys. + * + * @return the publicKeys value + */ + public List publicKeys() { + return this.publicKeys; + } + + /** + * Set the list of SSH public keys. + * + * @param publicKeys the publicKeys value to set + * @return the SshProfile object itself. + */ + public SshProfile withPublicKeys(List publicKeys) { + this.publicKeys = publicKeys; + return this; + } + +} diff --git a/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/SshPublicKey.java b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/SshPublicKey.java new file mode 100644 index 000000000000..4cd02c94237f --- /dev/null +++ b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/SshPublicKey.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.hdinsight.v2015_03_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The SSH public key for the cluster nodes. + */ +public class SshPublicKey { + /** + * The certificate for SSH. + */ + @JsonProperty(value = "certificateData") + private String certificateData; + + /** + * Get the certificate for SSH. + * + * @return the certificateData value + */ + public String certificateData() { + return this.certificateData; + } + + /** + * Set the certificate for SSH. + * + * @param certificateData the certificateData value to set + * @return the SshPublicKey object itself. + */ + public SshPublicKey withCertificateData(String certificateData) { + this.certificateData = certificateData; + return this; + } + +} diff --git a/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/StorageAccount.java b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/StorageAccount.java new file mode 100644 index 000000000000..cbe69089ef5c --- /dev/null +++ b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/StorageAccount.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.hdinsight.v2015_03_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The storage Account. + */ +public class StorageAccount { + /** + * The name of the storage account. + */ + @JsonProperty(value = "name") + private String name; + + /** + * Whether or not the storage account is the default storage account. + */ + @JsonProperty(value = "isDefault") + private Boolean isDefault; + + /** + * The container in the storage account, only to be specified for WASB + * storage accounts. + */ + @JsonProperty(value = "container") + private String container; + + /** + * The filesystem, only to be specified for Azure Data Lake Storage Gen 2. + */ + @JsonProperty(value = "fileSystem") + private String fileSystem; + + /** + * The storage account access key. + */ + @JsonProperty(value = "key") + private String key; + + /** + * Get the name of the storage account. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name of the storage account. + * + * @param name the name value to set + * @return the StorageAccount object itself. + */ + public StorageAccount withName(String name) { + this.name = name; + return this; + } + + /** + * Get whether or not the storage account is the default storage account. + * + * @return the isDefault value + */ + public Boolean isDefault() { + return this.isDefault; + } + + /** + * Set whether or not the storage account is the default storage account. + * + * @param isDefault the isDefault value to set + * @return the StorageAccount object itself. + */ + public StorageAccount withIsDefault(Boolean isDefault) { + this.isDefault = isDefault; + return this; + } + + /** + * Get the container in the storage account, only to be specified for WASB storage accounts. + * + * @return the container value + */ + public String container() { + return this.container; + } + + /** + * Set the container in the storage account, only to be specified for WASB storage accounts. + * + * @param container the container value to set + * @return the StorageAccount object itself. + */ + public StorageAccount withContainer(String container) { + this.container = container; + return this; + } + + /** + * Get the filesystem, only to be specified for Azure Data Lake Storage Gen 2. + * + * @return the fileSystem value + */ + public String fileSystem() { + return this.fileSystem; + } + + /** + * Set the filesystem, only to be specified for Azure Data Lake Storage Gen 2. + * + * @param fileSystem the fileSystem value to set + * @return the StorageAccount object itself. + */ + public StorageAccount withFileSystem(String fileSystem) { + this.fileSystem = fileSystem; + return this; + } + + /** + * Get the storage account access key. + * + * @return the key value + */ + public String key() { + return this.key; + } + + /** + * Set the storage account access key. + * + * @param key the key value to set + * @return the StorageAccount object itself. + */ + public StorageAccount withKey(String key) { + this.key = key; + return this; + } + +} diff --git a/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/StorageProfile.java b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/StorageProfile.java new file mode 100644 index 000000000000..2bbb3039bcc0 --- /dev/null +++ b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/StorageProfile.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.hdinsight.v2015_03_01_preview; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The storage profile. + */ +public class StorageProfile { + /** + * The list of storage accounts in the cluster. + */ + @JsonProperty(value = "storageaccounts") + private List storageaccounts; + + /** + * Get the list of storage accounts in the cluster. + * + * @return the storageaccounts value + */ + public List storageaccounts() { + return this.storageaccounts; + } + + /** + * Set the list of storage accounts in the cluster. + * + * @param storageaccounts the storageaccounts value to set + * @return the StorageProfile object itself. + */ + public StorageProfile withStorageaccounts(List storageaccounts) { + this.storageaccounts = storageaccounts; + return this; + } + +} diff --git a/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/Tier.java b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/Tier.java new file mode 100644 index 000000000000..7dc759818fca --- /dev/null +++ b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/Tier.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.hdinsight.v2015_03_01_preview; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for Tier. + */ +public enum Tier { + /** Enum value Standard. */ + STANDARD("Standard"), + + /** Enum value Premium. */ + PREMIUM("Premium"); + + /** The actual serialized value for a Tier instance. */ + private String value; + + Tier(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a Tier instance. + * + * @param value the serialized value to parse. + * @return the parsed Tier object, or null if unable to parse. + */ + @JsonCreator + public static Tier fromString(String value) { + Tier[] items = Tier.values(); + for (Tier item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/Usage.java b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/Usage.java new file mode 100644 index 000000000000..dc0f242a2493 --- /dev/null +++ b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/Usage.java @@ -0,0 +1,121 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2015_03_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The details about the usage of a particular limited resource. + */ +public class Usage { + /** + * The type of measurement for usage. + */ + @JsonProperty(value = "unit") + private String unit; + + /** + * The current usage. + */ + @JsonProperty(value = "currentValue") + private Integer currentValue; + + /** + * The maximum allowed usage. + */ + @JsonProperty(value = "limit") + private Integer limit; + + /** + * The details about the localizable name of the used resource. + */ + @JsonProperty(value = "name") + private LocalizedName name; + + /** + * Get the type of measurement for usage. + * + * @return the unit value + */ + public String unit() { + return this.unit; + } + + /** + * Set the type of measurement for usage. + * + * @param unit the unit value to set + * @return the Usage object itself. + */ + public Usage withUnit(String unit) { + this.unit = unit; + return this; + } + + /** + * Get the current usage. + * + * @return the currentValue value + */ + public Integer currentValue() { + return this.currentValue; + } + + /** + * Set the current usage. + * + * @param currentValue the currentValue value to set + * @return the Usage object itself. + */ + public Usage withCurrentValue(Integer currentValue) { + this.currentValue = currentValue; + return this; + } + + /** + * Get the maximum allowed usage. + * + * @return the limit value + */ + public Integer limit() { + return this.limit; + } + + /** + * Set the maximum allowed usage. + * + * @param limit the limit value to set + * @return the Usage object itself. + */ + public Usage withLimit(Integer limit) { + this.limit = limit; + return this; + } + + /** + * Get the details about the localizable name of the used resource. + * + * @return the name value + */ + public LocalizedName name() { + return this.name; + } + + /** + * Set the details about the localizable name of the used resource. + * + * @param name the name value to set + * @return the Usage object itself. + */ + public Usage withName(LocalizedName name) { + this.name = name; + return this; + } + +} diff --git a/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/UsagesListResult.java b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/UsagesListResult.java new file mode 100644 index 000000000000..41df247f7011 --- /dev/null +++ b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/UsagesListResult.java @@ -0,0 +1,26 @@ +/** + * 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.hdinsight.v2015_03_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.hdinsight.v2015_03_01_preview.implementation.HDInsightManager; +import com.microsoft.azure.management.hdinsight.v2015_03_01_preview.implementation.UsagesListResultInner; +import java.util.List; + +/** + * Type representing UsagesListResult. + */ +public interface UsagesListResult extends HasInner, HasManager { + /** + * @return the value value. + */ + List value(); + +} diff --git a/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/VersionSpec.java b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/VersionSpec.java new file mode 100644 index 000000000000..69ca14ae0810 --- /dev/null +++ b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/VersionSpec.java @@ -0,0 +1,122 @@ +/** + * 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.hdinsight.v2015_03_01_preview; + +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The version properties. + */ +public class VersionSpec { + /** + * The friendly name. + */ + @JsonProperty(value = "friendlyName") + private String friendlyName; + + /** + * The display name. + */ + @JsonProperty(value = "displayName") + private String displayName; + + /** + * Whether or not the version is the default version. + */ + @JsonProperty(value = "isDefault") + private String isDefault; + + /** + * The component version property. + */ + @JsonProperty(value = "componentVersions") + private Map componentVersions; + + /** + * Get the friendly name. + * + * @return the friendlyName value + */ + public String friendlyName() { + return this.friendlyName; + } + + /** + * Set the friendly name. + * + * @param friendlyName the friendlyName value to set + * @return the VersionSpec object itself. + */ + public VersionSpec withFriendlyName(String friendlyName) { + this.friendlyName = friendlyName; + return this; + } + + /** + * Get the display name. + * + * @return the displayName value + */ + public String displayName() { + return this.displayName; + } + + /** + * Set the display name. + * + * @param displayName the displayName value to set + * @return the VersionSpec object itself. + */ + public VersionSpec withDisplayName(String displayName) { + this.displayName = displayName; + return this; + } + + /** + * Get whether or not the version is the default version. + * + * @return the isDefault value + */ + public String isDefault() { + return this.isDefault; + } + + /** + * Set whether or not the version is the default version. + * + * @param isDefault the isDefault value to set + * @return the VersionSpec object itself. + */ + public VersionSpec withIsDefault(String isDefault) { + this.isDefault = isDefault; + return this; + } + + /** + * Get the component version property. + * + * @return the componentVersions value + */ + public Map componentVersions() { + return this.componentVersions; + } + + /** + * Set the component version property. + * + * @param componentVersions the componentVersions value to set + * @return the VersionSpec object itself. + */ + public VersionSpec withComponentVersions(Map componentVersions) { + this.componentVersions = componentVersions; + return this; + } + +} diff --git a/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/VersionsCapability.java b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/VersionsCapability.java new file mode 100644 index 000000000000..7c2cdb4dcba0 --- /dev/null +++ b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/VersionsCapability.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.hdinsight.v2015_03_01_preview; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The version capability. + */ +public class VersionsCapability { + /** + * The list of version capabilities. + */ + @JsonProperty(value = "available") + private List available; + + /** + * Get the list of version capabilities. + * + * @return the available value + */ + public List available() { + return this.available; + } + + /** + * Set the list of version capabilities. + * + * @param available the available value to set + * @return the VersionsCapability object itself. + */ + public VersionsCapability withAvailable(List available) { + this.available = available; + return this; + } + +} diff --git a/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/VirtualNetworkProfile.java b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/VirtualNetworkProfile.java new file mode 100644 index 000000000000..a0a63a604d88 --- /dev/null +++ b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/VirtualNetworkProfile.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.hdinsight.v2015_03_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The virtual network properties. + */ +public class VirtualNetworkProfile { + /** + * The ID of the virtual network. + */ + @JsonProperty(value = "id") + private String id; + + /** + * The name of the subnet. + */ + @JsonProperty(value = "subnet") + private String subnet; + + /** + * Get the ID of the virtual network. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set the ID of the virtual network. + * + * @param id the id value to set + * @return the VirtualNetworkProfile object itself. + */ + public VirtualNetworkProfile withId(String id) { + this.id = id; + return this; + } + + /** + * Get the name of the subnet. + * + * @return the subnet value + */ + public String subnet() { + return this.subnet; + } + + /** + * Set the name of the subnet. + * + * @param subnet the subnet value to set + * @return the VirtualNetworkProfile object itself. + */ + public VirtualNetworkProfile withSubnet(String subnet) { + this.subnet = subnet; + return this; + } + +} diff --git a/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/VmSizeCompatibilityFilter.java b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/VmSizeCompatibilityFilter.java new file mode 100644 index 000000000000..b861aad8dab8 --- /dev/null +++ b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/VmSizeCompatibilityFilter.java @@ -0,0 +1,174 @@ +/** + * 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.hdinsight.v2015_03_01_preview; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The virtual machine type compatibility filter. + */ +public class VmSizeCompatibilityFilter { + /** + * The mode for the filter. + */ + @JsonProperty(value = "FilterMode") + private String filterMode; + + /** + * The list of regions. + */ + @JsonProperty(value = "Regions") + private List regions; + + /** + * The list of cluster types available. + */ + @JsonProperty(value = "ClusterFlavors") + private List clusterFlavors; + + /** + * The list of node types. + */ + @JsonProperty(value = "NodeTypes") + private List nodeTypes; + + /** + * The list of cluster versions. + */ + @JsonProperty(value = "ClusterVersions") + private List clusterVersions; + + /** + * The list of virtual machine sizes. + */ + @JsonProperty(value = "vmsizes") + private List vmsizes; + + /** + * Get the mode for the filter. + * + * @return the filterMode value + */ + public String filterMode() { + return this.filterMode; + } + + /** + * Set the mode for the filter. + * + * @param filterMode the filterMode value to set + * @return the VmSizeCompatibilityFilter object itself. + */ + public VmSizeCompatibilityFilter withFilterMode(String filterMode) { + this.filterMode = filterMode; + return this; + } + + /** + * Get the list of regions. + * + * @return the regions value + */ + public List regions() { + return this.regions; + } + + /** + * Set the list of regions. + * + * @param regions the regions value to set + * @return the VmSizeCompatibilityFilter object itself. + */ + public VmSizeCompatibilityFilter withRegions(List regions) { + this.regions = regions; + return this; + } + + /** + * Get the list of cluster types available. + * + * @return the clusterFlavors value + */ + public List clusterFlavors() { + return this.clusterFlavors; + } + + /** + * Set the list of cluster types available. + * + * @param clusterFlavors the clusterFlavors value to set + * @return the VmSizeCompatibilityFilter object itself. + */ + public VmSizeCompatibilityFilter withClusterFlavors(List clusterFlavors) { + this.clusterFlavors = clusterFlavors; + return this; + } + + /** + * Get the list of node types. + * + * @return the nodeTypes value + */ + public List nodeTypes() { + return this.nodeTypes; + } + + /** + * Set the list of node types. + * + * @param nodeTypes the nodeTypes value to set + * @return the VmSizeCompatibilityFilter object itself. + */ + public VmSizeCompatibilityFilter withNodeTypes(List nodeTypes) { + this.nodeTypes = nodeTypes; + return this; + } + + /** + * Get the list of cluster versions. + * + * @return the clusterVersions value + */ + public List clusterVersions() { + return this.clusterVersions; + } + + /** + * Set the list of cluster versions. + * + * @param clusterVersions the clusterVersions value to set + * @return the VmSizeCompatibilityFilter object itself. + */ + public VmSizeCompatibilityFilter withClusterVersions(List clusterVersions) { + this.clusterVersions = clusterVersions; + return this; + } + + /** + * Get the list of virtual machine sizes. + * + * @return the vmsizes value + */ + public List vmsizes() { + return this.vmsizes; + } + + /** + * Set the list of virtual machine sizes. + * + * @param vmsizes the vmsizes value to set + * @return the VmSizeCompatibilityFilter object itself. + */ + public VmSizeCompatibilityFilter withVmsizes(List vmsizes) { + this.vmsizes = vmsizes; + return this; + } + +} diff --git a/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/VmSizesCapability.java b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/VmSizesCapability.java new file mode 100644 index 000000000000..59cd9f7bd761 --- /dev/null +++ b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/VmSizesCapability.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.hdinsight.v2015_03_01_preview; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The virtual machine sizes capability. + */ +public class VmSizesCapability { + /** + * The list of virtual machine size capabilities. + */ + @JsonProperty(value = "available") + private List available; + + /** + * Get the list of virtual machine size capabilities. + * + * @return the available value + */ + public List available() { + return this.available; + } + + /** + * Set the list of virtual machine size capabilities. + * + * @param available the available value to set + * @return the VmSizesCapability object itself. + */ + public VmSizesCapability withAvailable(List available) { + this.available = available; + return this; + } + +} diff --git a/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/ApplicationImpl.java b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/ApplicationImpl.java new file mode 100644 index 000000000000..86c674e3a677 --- /dev/null +++ b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/ApplicationImpl.java @@ -0,0 +1,129 @@ +/** + * 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.hdinsight.v2015_03_01_preview.implementation; + +import com.microsoft.azure.management.hdinsight.v2015_03_01_preview.Application; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import java.util.Map; +import com.microsoft.azure.management.hdinsight.v2015_03_01_preview.ApplicationProperties; + +class ApplicationImpl extends CreatableUpdatableImpl implements Application, Application.Definition, Application.Update { + private final HDInsightManager manager; + private String resourceGroupName; + private String clusterName; + private String applicationName; + + ApplicationImpl(String name, HDInsightManager manager) { + super(name, new ApplicationInner()); + this.manager = manager; + // Set resource name + this.applicationName = name; + // + } + + ApplicationImpl(ApplicationInner inner, HDInsightManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.applicationName = inner.name(); + // resource ancestor names + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.clusterName = IdParsingUtils.getValueFromIdByName(inner.id(), "clusters"); + this.applicationName = IdParsingUtils.getValueFromIdByName(inner.id(), "applications"); + // + } + + @Override + public HDInsightManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + ApplicationsInner client = this.manager().inner().applications(); + return client.createAsync(this.resourceGroupName, this.clusterName, this.applicationName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + ApplicationsInner client = this.manager().inner().applications(); + return client.createAsync(this.resourceGroupName, this.clusterName, this.applicationName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + ApplicationsInner client = this.manager().inner().applications(); + return client.getAsync(this.resourceGroupName, this.clusterName, this.applicationName); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public String etag() { + return this.inner().etag(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public ApplicationProperties properties() { + return this.inner().properties(); + } + + @Override + public Map tags() { + return this.inner().tags(); + } + + @Override + public String type() { + return this.inner().type(); + } + + @Override + public ApplicationImpl withExistingCluster(String resourceGroupName, String clusterName) { + this.resourceGroupName = resourceGroupName; + this.clusterName = clusterName; + return this; + } + + @Override + public ApplicationImpl withEtag(String etag) { + this.inner().withEtag(etag); + return this; + } + + @Override + public ApplicationImpl withProperties(ApplicationProperties properties) { + this.inner().withProperties(properties); + return this; + } + + @Override + public ApplicationImpl withTags(Map tags) { + this.inner().withTags(tags); + return this; + } + +} diff --git a/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/ApplicationInner.java b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/ApplicationInner.java new file mode 100644 index 000000000000..585317163657 --- /dev/null +++ b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/ApplicationInner.java @@ -0,0 +1,98 @@ +/** + * 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.hdinsight.v2015_03_01_preview.implementation; + +import java.util.Map; +import com.microsoft.azure.management.hdinsight.v2015_03_01_preview.ApplicationProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.azure.ProxyResource; + +/** + * The HDInsight cluster application. + */ +public class ApplicationInner extends ProxyResource { + /** + * The ETag for the application. + */ + @JsonProperty(value = "etag") + private String etag; + + /** + * The tags for the application. + */ + @JsonProperty(value = "tags") + private Map tags; + + /** + * The properties of the application. + */ + @JsonProperty(value = "properties") + private ApplicationProperties properties; + + /** + * Get the ETag for the application. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + + /** + * Set the ETag for the application. + * + * @param etag the etag value to set + * @return the ApplicationInner object itself. + */ + public ApplicationInner withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Get the tags for the application. + * + * @return the tags value + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags for the application. + * + * @param tags the tags value to set + * @return the ApplicationInner object itself. + */ + public ApplicationInner withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Get the properties of the application. + * + * @return the properties value + */ + public ApplicationProperties properties() { + return this.properties; + } + + /** + * Set the properties of the application. + * + * @param properties the properties value to set + * @return the ApplicationInner object itself. + */ + public ApplicationInner withProperties(ApplicationProperties properties) { + this.properties = properties; + return this; + } + +} diff --git a/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/ApplicationsImpl.java b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/ApplicationsImpl.java new file mode 100644 index 000000000000..62f0b65973e0 --- /dev/null +++ b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/ApplicationsImpl.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.hdinsight.v2015_03_01_preview.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.hdinsight.v2015_03_01_preview.Applications; +import rx.Completable; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.hdinsight.v2015_03_01_preview.Application; + +class ApplicationsImpl extends WrapperImpl implements Applications { + private final HDInsightManager manager; + + ApplicationsImpl(HDInsightManager manager) { + super(manager.inner().applications()); + this.manager = manager; + } + + public HDInsightManager manager() { + return this.manager; + } + + @Override + public ApplicationImpl define(String name) { + return wrapModel(name); + } + + private ApplicationImpl wrapModel(ApplicationInner inner) { + return new ApplicationImpl(inner, manager()); + } + + private ApplicationImpl wrapModel(String name) { + return new ApplicationImpl(name, this.manager()); + } + + @Override + public Observable listAsync(final String resourceGroupName, final String clusterName) { + ApplicationsInner client = this.inner(); + return client.listAsync(resourceGroupName, clusterName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public Application call(ApplicationInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Observable getAsync(String resourceGroupName, String clusterName, String applicationName) { + ApplicationsInner client = this.inner(); + return client.getAsync(resourceGroupName, clusterName, applicationName) + .map(new Func1() { + @Override + public Application call(ApplicationInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Completable deleteAsync(String resourceGroupName, String clusterName, String applicationName) { + ApplicationsInner client = this.inner(); + return client.deleteAsync(resourceGroupName, clusterName, applicationName).toCompletable(); + } + +} diff --git a/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/ApplicationsInner.java b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/ApplicationsInner.java new file mode 100644 index 000000000000..75518b9e1e1a --- /dev/null +++ b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/ApplicationsInner.java @@ -0,0 +1,774 @@ +/** + * 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.hdinsight.v2015_03_01_preview.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.hdinsight.v2015_03_01_preview.ErrorResponseException; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.Path; +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 Applications. + */ +public class ApplicationsInner { + /** The Retrofit service to perform REST calls. */ + private ApplicationsService service; + /** The service client containing this operation class. */ + private HDInsightManagementClientImpl client; + + /** + * Initializes an instance of ApplicationsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public ApplicationsInner(Retrofit retrofit, HDInsightManagementClientImpl client) { + this.service = retrofit.create(ApplicationsService.class); + this.client = client; + } + + /** + * The interface defining all the services for Applications to be + * used by Retrofit to perform actually REST calls. + */ + interface ApplicationsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.hdinsight.v2015_03_01_preview.Applications list" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/applications") + Observable> list(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @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.hdinsight.v2015_03_01_preview.Applications get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/applications/{applicationName}") + Observable> get(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Path("applicationName") String applicationName, @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.hdinsight.v2015_03_01_preview.Applications create" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/applications/{applicationName}") + Observable> create(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Path("applicationName") String applicationName, @Query("api-version") String apiVersion, @Body ApplicationInner parameters, @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.hdinsight.v2015_03_01_preview.Applications beginCreate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/applications/{applicationName}") + Observable> beginCreate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Path("applicationName") String applicationName, @Query("api-version") String apiVersion, @Body ApplicationInner parameters, @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.hdinsight.v2015_03_01_preview.Applications delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/applications/{applicationName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Path("applicationName") String applicationName, @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.hdinsight.v2015_03_01_preview.Applications beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/applications/{applicationName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Path("applicationName") String applicationName, @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.hdinsight.v2015_03_01_preview.Applications listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Lists all of the applications for the HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException 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<ApplicationInner> object if successful. + */ + public PagedList list(final String resourceGroupName, final String clusterName) { + ServiceResponse> response = listSinglePageAsync(resourceGroupName, clusterName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all of the applications for the HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @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 String resourceGroupName, final String clusterName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(resourceGroupName, clusterName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all of the applications for the HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ApplicationInner> object + */ + public Observable> listAsync(final String resourceGroupName, final String clusterName) { + return listWithServiceResponseAsync(resourceGroupName, clusterName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all of the applications for the HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ApplicationInner> object + */ + public Observable>> listWithServiceResponseAsync(final String resourceGroupName, final String clusterName) { + return listSinglePageAsync(resourceGroupName, clusterName) + .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 applications for the HDInsight cluster. + * + ServiceResponse> * @param resourceGroupName The name of the resource group. + ServiceResponse> * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ApplicationInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync(final String resourceGroupName, final String clusterName) { + 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 (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName 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(), resourceGroupName, clusterName, 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 ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Lists properties of the specified application. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param applicationName The constant value for the application name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ApplicationInner object if successful. + */ + public ApplicationInner get(String resourceGroupName, String clusterName, String applicationName) { + return getWithServiceResponseAsync(resourceGroupName, clusterName, applicationName).toBlocking().single().body(); + } + + /** + * Lists properties of the specified application. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param applicationName The constant value for the application name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String resourceGroupName, String clusterName, String applicationName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, clusterName, applicationName), serviceCallback); + } + + /** + * Lists properties of the specified application. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param applicationName The constant value for the application name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ApplicationInner object + */ + public Observable getAsync(String resourceGroupName, String clusterName, String applicationName) { + return getWithServiceResponseAsync(resourceGroupName, clusterName, applicationName).map(new Func1, ApplicationInner>() { + @Override + public ApplicationInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Lists properties of the specified application. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param applicationName The constant value for the application name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ApplicationInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String clusterName, String applicationName) { + 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 (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName is required and cannot be null."); + } + if (applicationName == null) { + throw new IllegalArgumentException("Parameter applicationName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.get(this.client.subscriptionId(), resourceGroupName, clusterName, applicationName, 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 ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Creates applications for the HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param applicationName The constant value for the application name. + * @param parameters The application create request. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ApplicationInner object if successful. + */ + public ApplicationInner create(String resourceGroupName, String clusterName, String applicationName, ApplicationInner parameters) { + return createWithServiceResponseAsync(resourceGroupName, clusterName, applicationName, parameters).toBlocking().last().body(); + } + + /** + * Creates applications for the HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param applicationName The constant value for the application name. + * @param parameters The application create request. + * @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 createAsync(String resourceGroupName, String clusterName, String applicationName, ApplicationInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createWithServiceResponseAsync(resourceGroupName, clusterName, applicationName, parameters), serviceCallback); + } + + /** + * Creates applications for the HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param applicationName The constant value for the application name. + * @param parameters The application create request. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createAsync(String resourceGroupName, String clusterName, String applicationName, ApplicationInner parameters) { + return createWithServiceResponseAsync(resourceGroupName, clusterName, applicationName, parameters).map(new Func1, ApplicationInner>() { + @Override + public ApplicationInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates applications for the HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param applicationName The constant value for the application name. + * @param parameters The application create request. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createWithServiceResponseAsync(String resourceGroupName, String clusterName, String applicationName, ApplicationInner parameters) { + 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 (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName is required and cannot be null."); + } + if (applicationName == null) { + throw new IllegalArgumentException("Parameter applicationName 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 (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + Observable> observable = service.create(this.client.subscriptionId(), resourceGroupName, clusterName, applicationName, this.client.apiVersion(), parameters, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Creates applications for the HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param applicationName The constant value for the application name. + * @param parameters The application create request. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ApplicationInner object if successful. + */ + public ApplicationInner beginCreate(String resourceGroupName, String clusterName, String applicationName, ApplicationInner parameters) { + return beginCreateWithServiceResponseAsync(resourceGroupName, clusterName, applicationName, parameters).toBlocking().single().body(); + } + + /** + * Creates applications for the HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param applicationName The constant value for the application name. + * @param parameters The application create request. + * @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 beginCreateAsync(String resourceGroupName, String clusterName, String applicationName, ApplicationInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateWithServiceResponseAsync(resourceGroupName, clusterName, applicationName, parameters), serviceCallback); + } + + /** + * Creates applications for the HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param applicationName The constant value for the application name. + * @param parameters The application create request. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ApplicationInner object + */ + public Observable beginCreateAsync(String resourceGroupName, String clusterName, String applicationName, ApplicationInner parameters) { + return beginCreateWithServiceResponseAsync(resourceGroupName, clusterName, applicationName, parameters).map(new Func1, ApplicationInner>() { + @Override + public ApplicationInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates applications for the HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param applicationName The constant value for the application name. + * @param parameters The application create request. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ApplicationInner object + */ + public Observable> beginCreateWithServiceResponseAsync(String resourceGroupName, String clusterName, String applicationName, ApplicationInner parameters) { + 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 (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName is required and cannot be null."); + } + if (applicationName == null) { + throw new IllegalArgumentException("Parameter applicationName 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 (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + return service.beginCreate(this.client.subscriptionId(), resourceGroupName, clusterName, applicationName, this.client.apiVersion(), parameters, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Deletes the specified application on the HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param applicationName The constant value for the application name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException 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 clusterName, String applicationName) { + deleteWithServiceResponseAsync(resourceGroupName, clusterName, applicationName).toBlocking().last().body(); + } + + /** + * Deletes the specified application on the HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param applicationName The constant value for the application name. + * @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 clusterName, String applicationName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, clusterName, applicationName), serviceCallback); + } + + /** + * Deletes the specified application on the HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param applicationName The constant value for the application name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String clusterName, String applicationName) { + return deleteWithServiceResponseAsync(resourceGroupName, clusterName, applicationName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the specified application on the HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param applicationName The constant value for the application name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String clusterName, String applicationName) { + 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 (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName is required and cannot be null."); + } + if (applicationName == null) { + throw new IllegalArgumentException("Parameter applicationName 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, clusterName, applicationName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Deletes the specified application on the HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param applicationName The constant value for the application name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException 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 clusterName, String applicationName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, clusterName, applicationName).toBlocking().single().body(); + } + + /** + * Deletes the specified application on the HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param applicationName The constant value for the application name. + * @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 clusterName, String applicationName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, clusterName, applicationName), serviceCallback); + } + + /** + * Deletes the specified application on the HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param applicationName The constant value for the application name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String clusterName, String applicationName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, clusterName, applicationName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the specified application on the HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param applicationName The constant value for the application name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String clusterName, String applicationName) { + 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 (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName is required and cannot be null."); + } + if (applicationName == null) { + throw new IllegalArgumentException("Parameter applicationName 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, clusterName, applicationName, 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 ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Lists all of the applications for the HDInsight cluster. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException 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<ApplicationInner> 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 applications for the HDInsight cluster. + * + * @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 applications for the HDInsight cluster. + * + * @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<ApplicationInner> 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 applications for the HDInsight cluster. + * + * @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<ApplicationInner> 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 applications for the HDInsight cluster. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ApplicationInner> 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 ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + +} diff --git a/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/CapabilitiesResultImpl.java b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/CapabilitiesResultImpl.java new file mode 100644 index 000000000000..b2b6e28bc5a4 --- /dev/null +++ b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/CapabilitiesResultImpl.java @@ -0,0 +1,63 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2015_03_01_preview.implementation; + +import com.microsoft.azure.management.hdinsight.v2015_03_01_preview.CapabilitiesResult; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import java.util.List; +import com.microsoft.azure.management.hdinsight.v2015_03_01_preview.QuotaCapability; +import java.util.Map; +import com.microsoft.azure.management.hdinsight.v2015_03_01_preview.RegionsCapability; +import com.microsoft.azure.management.hdinsight.v2015_03_01_preview.VersionsCapability; +import com.microsoft.azure.management.hdinsight.v2015_03_01_preview.VmSizeCompatibilityFilter; +import com.microsoft.azure.management.hdinsight.v2015_03_01_preview.VmSizesCapability; + +class CapabilitiesResultImpl extends WrapperImpl implements CapabilitiesResult { + private final HDInsightManager manager; + CapabilitiesResultImpl(CapabilitiesResultInner inner, HDInsightManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public HDInsightManager manager() { + return this.manager; + } + + @Override + public List features() { + return this.inner().features(); + } + + @Override + public QuotaCapability quota() { + return this.inner().quota(); + } + + @Override + public Map regions() { + return this.inner().regions(); + } + + @Override + public Map versions() { + return this.inner().versions(); + } + + @Override + public List vmSizeFilters() { + return this.inner().vmSizeFilters(); + } + + @Override + public Map vmSizes() { + return this.inner().vmSizes(); + } + +} diff --git a/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/CapabilitiesResultInner.java b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/CapabilitiesResultInner.java new file mode 100644 index 000000000000..231c4c5fb7a8 --- /dev/null +++ b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/CapabilitiesResultInner.java @@ -0,0 +1,180 @@ +/** + * 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.hdinsight.v2015_03_01_preview.implementation; + +import java.util.Map; +import com.microsoft.azure.management.hdinsight.v2015_03_01_preview.VersionsCapability; +import com.microsoft.azure.management.hdinsight.v2015_03_01_preview.RegionsCapability; +import com.microsoft.azure.management.hdinsight.v2015_03_01_preview.VmSizesCapability; +import java.util.List; +import com.microsoft.azure.management.hdinsight.v2015_03_01_preview.VmSizeCompatibilityFilter; +import com.microsoft.azure.management.hdinsight.v2015_03_01_preview.QuotaCapability; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The Get Capabilities operation response. + */ +public class CapabilitiesResultInner { + /** + * The version capability. + */ + @JsonProperty(value = "versions") + private Map versions; + + /** + * The virtual machine size compatibilty features. + */ + @JsonProperty(value = "regions") + private Map regions; + + /** + * The virtual machine sizes. + */ + @JsonProperty(value = "vmSizes") + private Map vmSizes; + + /** + * The virtual machine size compatibilty filters. + */ + @JsonProperty(value = "vmSize_filters") + private List vmSizeFilters; + + /** + * The capabilty features. + */ + @JsonProperty(value = "features") + private List features; + + /** + * The quota capability. + */ + @JsonProperty(value = "quota") + private QuotaCapability quota; + + /** + * Get the version capability. + * + * @return the versions value + */ + public Map versions() { + return this.versions; + } + + /** + * Set the version capability. + * + * @param versions the versions value to set + * @return the CapabilitiesResultInner object itself. + */ + public CapabilitiesResultInner withVersions(Map versions) { + this.versions = versions; + return this; + } + + /** + * Get the virtual machine size compatibilty features. + * + * @return the regions value + */ + public Map regions() { + return this.regions; + } + + /** + * Set the virtual machine size compatibilty features. + * + * @param regions the regions value to set + * @return the CapabilitiesResultInner object itself. + */ + public CapabilitiesResultInner withRegions(Map regions) { + this.regions = regions; + return this; + } + + /** + * Get the virtual machine sizes. + * + * @return the vmSizes value + */ + public Map vmSizes() { + return this.vmSizes; + } + + /** + * Set the virtual machine sizes. + * + * @param vmSizes the vmSizes value to set + * @return the CapabilitiesResultInner object itself. + */ + public CapabilitiesResultInner withVmSizes(Map vmSizes) { + this.vmSizes = vmSizes; + return this; + } + + /** + * Get the virtual machine size compatibilty filters. + * + * @return the vmSizeFilters value + */ + public List vmSizeFilters() { + return this.vmSizeFilters; + } + + /** + * Set the virtual machine size compatibilty filters. + * + * @param vmSizeFilters the vmSizeFilters value to set + * @return the CapabilitiesResultInner object itself. + */ + public CapabilitiesResultInner withVmSizeFilters(List vmSizeFilters) { + this.vmSizeFilters = vmSizeFilters; + return this; + } + + /** + * Get the capabilty features. + * + * @return the features value + */ + public List features() { + return this.features; + } + + /** + * Set the capabilty features. + * + * @param features the features value to set + * @return the CapabilitiesResultInner object itself. + */ + public CapabilitiesResultInner withFeatures(List features) { + this.features = features; + return this; + } + + /** + * Get the quota capability. + * + * @return the quota value + */ + public QuotaCapability quota() { + return this.quota; + } + + /** + * Set the quota capability. + * + * @param quota the quota value to set + * @return the CapabilitiesResultInner object itself. + */ + public CapabilitiesResultInner withQuota(QuotaCapability quota) { + this.quota = quota; + return this; + } + +} diff --git a/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/ClusterImpl.java b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/ClusterImpl.java new file mode 100644 index 000000000000..511925987a58 --- /dev/null +++ b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/ClusterImpl.java @@ -0,0 +1,87 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2015_03_01_preview.implementation; + +import com.microsoft.azure.arm.resources.models.implementation.GroupableResourceCoreImpl; +import com.microsoft.azure.management.hdinsight.v2015_03_01_preview.Cluster; +import rx.Observable; +import com.microsoft.azure.management.hdinsight.v2015_03_01_preview.ClusterCreateParametersExtended; +import com.microsoft.azure.management.hdinsight.v2015_03_01_preview.ClusterGetProperties; +import com.microsoft.azure.management.hdinsight.v2015_03_01_preview.ClusterCreateProperties; +import rx.functions.Func1; + +class ClusterImpl extends GroupableResourceCoreImpl implements Cluster, Cluster.Definition, Cluster.Update { + private ClusterCreateParametersExtended createOrUpdateParameter; + ClusterImpl(String name, ClusterInner inner, HDInsightManager manager) { + super(name, inner, manager); + this.createOrUpdateParameter = new ClusterCreateParametersExtended(); + } + + @Override + public Observable createResourceAsync() { + ClustersInner client = this.manager().inner().clusters(); + this.createOrUpdateParameter.withLocation(inner().location()); + this.createOrUpdateParameter.withTags(inner().getTags()); + return client.createAsync(this.resourceGroupName(), this.name(), this.createOrUpdateParameter) + .map(new Func1() { + @Override + public ClusterInner call(ClusterInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + ClustersInner client = this.manager().inner().clusters(); + return client.createAsync(this.resourceGroupName(), this.name(), this.createOrUpdateParameter) + .map(new Func1() { + @Override + public ClusterInner call(ClusterInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + ClustersInner client = this.manager().inner().clusters(); + return client.getByResourceGroupAsync(this.resourceGroupName(), this.name()); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + private void resetCreateUpdateParameters() { + this.createOrUpdateParameter = new ClusterCreateParametersExtended(); + } + + @Override + public String etag() { + return this.inner().etag(); + } + + @Override + public ClusterGetProperties properties() { + return this.inner().properties(); + } + + @Override + public ClusterImpl withProperties(ClusterCreateProperties properties) { + this.createOrUpdateParameter.withProperties(properties); + return this; + } + +} diff --git a/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/ClusterInner.java b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/ClusterInner.java new file mode 100644 index 000000000000..373c9c981326 --- /dev/null +++ b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/ClusterInner.java @@ -0,0 +1,73 @@ +/** + * 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.hdinsight.v2015_03_01_preview.implementation; + +import com.microsoft.azure.management.hdinsight.v2015_03_01_preview.ClusterGetProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.SkipParentValidation; +import com.microsoft.azure.Resource; + +/** + * The HDInsight cluster. + */ +@SkipParentValidation +public class ClusterInner extends Resource { + /** + * The ETag for the resource. + */ + @JsonProperty(value = "etag") + private String etag; + + /** + * The properties of the cluster. + */ + @JsonProperty(value = "properties") + private ClusterGetProperties properties; + + /** + * Get the ETag for the resource. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + + /** + * Set the ETag for the resource. + * + * @param etag the etag value to set + * @return the ClusterInner object itself. + */ + public ClusterInner withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Get the properties of the cluster. + * + * @return the properties value + */ + public ClusterGetProperties properties() { + return this.properties; + } + + /** + * Set the properties of the cluster. + * + * @param properties the properties value to set + * @return the ClusterInner object itself. + */ + public ClusterInner withProperties(ClusterGetProperties properties) { + this.properties = properties; + return this; + } + +} diff --git a/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/ClusterMonitoringResponseImpl.java b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/ClusterMonitoringResponseImpl.java new file mode 100644 index 000000000000..ef98a3fa9404 --- /dev/null +++ b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/ClusterMonitoringResponseImpl.java @@ -0,0 +1,36 @@ +/** + * 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.hdinsight.v2015_03_01_preview.implementation; + +import com.microsoft.azure.management.hdinsight.v2015_03_01_preview.ClusterMonitoringResponse; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; + +class ClusterMonitoringResponseImpl extends WrapperImpl implements ClusterMonitoringResponse { + private final HDInsightManager manager; + ClusterMonitoringResponseImpl(ClusterMonitoringResponseInner inner, HDInsightManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public HDInsightManager manager() { + return this.manager; + } + + @Override + public Boolean clusterMonitoringEnabled() { + return this.inner().clusterMonitoringEnabled(); + } + + @Override + public String workspaceId() { + return this.inner().workspaceId(); + } + +} diff --git a/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/ClusterMonitoringResponseInner.java b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/ClusterMonitoringResponseInner.java new file mode 100644 index 000000000000..ee8f37c4ec43 --- /dev/null +++ b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/ClusterMonitoringResponseInner.java @@ -0,0 +1,71 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2015_03_01_preview.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The Operations Management Suite (OMS) status response. + */ +public class ClusterMonitoringResponseInner { + /** + * The status of the Operations Management Suite (OMS) on the HDInsight + * cluster. + */ + @JsonProperty(value = "clusterMonitoringEnabled") + private Boolean clusterMonitoringEnabled; + + /** + * The workspace ID of the Operations Management Suite (OMS) on the + * HDInsight cluster. + */ + @JsonProperty(value = "workspaceId") + private String workspaceId; + + /** + * Get the status of the Operations Management Suite (OMS) on the HDInsight cluster. + * + * @return the clusterMonitoringEnabled value + */ + public Boolean clusterMonitoringEnabled() { + return this.clusterMonitoringEnabled; + } + + /** + * Set the status of the Operations Management Suite (OMS) on the HDInsight cluster. + * + * @param clusterMonitoringEnabled the clusterMonitoringEnabled value to set + * @return the ClusterMonitoringResponseInner object itself. + */ + public ClusterMonitoringResponseInner withClusterMonitoringEnabled(Boolean clusterMonitoringEnabled) { + this.clusterMonitoringEnabled = clusterMonitoringEnabled; + return this; + } + + /** + * Get the workspace ID of the Operations Management Suite (OMS) on the HDInsight cluster. + * + * @return the workspaceId value + */ + public String workspaceId() { + return this.workspaceId; + } + + /** + * Set the workspace ID of the Operations Management Suite (OMS) on the HDInsight cluster. + * + * @param workspaceId the workspaceId value to set + * @return the ClusterMonitoringResponseInner object itself. + */ + public ClusterMonitoringResponseInner withWorkspaceId(String workspaceId) { + this.workspaceId = workspaceId; + return this; + } + +} diff --git a/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/ClustersImpl.java b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/ClustersImpl.java new file mode 100644 index 000000000000..e3684e84d790 --- /dev/null +++ b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/ClustersImpl.java @@ -0,0 +1,151 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * def + */ + +package com.microsoft.azure.management.hdinsight.v2015_03_01_preview.implementation; + +import com.microsoft.azure.arm.resources.collection.implementation.GroupableResourcesCoreImpl; +import com.microsoft.azure.management.hdinsight.v2015_03_01_preview.Clusters; +import com.microsoft.azure.management.hdinsight.v2015_03_01_preview.Cluster; +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.hdinsight.v2015_03_01_preview.ExecuteScriptActionParameters; + +class ClustersImpl extends GroupableResourcesCoreImpl implements Clusters { + protected ClustersImpl(HDInsightManager manager) { + super(manager.inner().clusters(), manager); + } + + @Override + protected Observable getInnerAsync(String resourceGroupName, String name) { + ClustersInner client = this.inner(); + return client.getByResourceGroupAsync(resourceGroupName, name); + } + + @Override + protected Completable deleteInnerAsync(String resourceGroupName, String name) { + ClustersInner 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) { + ClustersInner client = this.inner(); + return this.wrapList(client.listByResourceGroup(resourceGroupName)); + } + + @Override + public Observable listByResourceGroupAsync(String resourceGroupName) { + ClustersInner 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 Cluster call(ClusterInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public PagedList list() { + ClustersInner client = this.inner(); + return this.wrapList(client.list()); + } + + @Override + public Observable listAsync() { + ClustersInner client = this.inner(); + return client.listAsync() + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public Cluster call(ClusterInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public ClusterImpl define(String name) { + return wrapModel(name); + } + + @Override + public Completable executeScriptActionsAsync(String resourceGroupName, String clusterName, ExecuteScriptActionParameters parameters) { + ClustersInner client = this.inner(); + return client.executeScriptActionsAsync(resourceGroupName, clusterName, parameters).toCompletable(); + } + + @Override + protected ClusterImpl wrapModel(ClusterInner inner) { + return new ClusterImpl(inner.name(), inner, manager()); + } + + @Override + protected ClusterImpl wrapModel(String name) { + return new ClusterImpl(name, new ClusterInner(), this.manager()); + } + + @Override + public Completable resizeAsync(String resourceGroupName, String clusterName) { + ClustersInner client = this.inner(); + return client.resizeAsync(resourceGroupName, clusterName).toCompletable(); + } + +} diff --git a/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/ClustersInner.java b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/ClustersInner.java new file mode 100644 index 000000000000..e75b8f8cb623 --- /dev/null +++ b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/ClustersInner.java @@ -0,0 +1,1653 @@ +/** + * 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.hdinsight.v2015_03_01_preview.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.hdinsight.v2015_03_01_preview.ClusterCreateParametersExtended; +import com.microsoft.azure.management.hdinsight.v2015_03_01_preview.ClusterPatchParameters; +import com.microsoft.azure.management.hdinsight.v2015_03_01_preview.ClusterResizeParameters; +import com.microsoft.azure.management.hdinsight.v2015_03_01_preview.ErrorResponseException; +import com.microsoft.azure.management.hdinsight.v2015_03_01_preview.ExecuteScriptActionParameters; +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 Clusters. + */ +public class ClustersInner implements InnerSupportsGet, InnerSupportsDelete, InnerSupportsListing { + /** The Retrofit service to perform REST calls. */ + private ClustersService service; + /** The service client containing this operation class. */ + private HDInsightManagementClientImpl client; + + /** + * Initializes an instance of ClustersInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public ClustersInner(Retrofit retrofit, HDInsightManagementClientImpl client) { + this.service = retrofit.create(ClustersService.class); + this.client = client; + } + + /** + * The interface defining all the services for Clusters to be + * used by Retrofit to perform actually REST calls. + */ + interface ClustersService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.hdinsight.v2015_03_01_preview.Clusters create" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}") + Observable> create(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Query("api-version") String apiVersion, @Body ClusterCreateParametersExtended parameters, @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.hdinsight.v2015_03_01_preview.Clusters beginCreate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}") + Observable> beginCreate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Query("api-version") String apiVersion, @Body ClusterCreateParametersExtended parameters, @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.hdinsight.v2015_03_01_preview.Clusters update" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}") + Observable> update(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body ClusterPatchParameters parameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.hdinsight.v2015_03_01_preview.Clusters delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @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.hdinsight.v2015_03_01_preview.Clusters beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @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.hdinsight.v2015_03_01_preview.Clusters getByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}") + Observable> getByResourceGroup(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @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.hdinsight.v2015_03_01_preview.Clusters listByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters") + 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.hdinsight.v2015_03_01_preview.Clusters resize" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/roles/{roleName}/resize") + Observable> resize(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Path("roleName") String roleName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body ClusterResizeParameters parameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.hdinsight.v2015_03_01_preview.Clusters beginResize" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/roles/{roleName}/resize") + Observable> beginResize(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Path("roleName") String roleName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body ClusterResizeParameters parameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.hdinsight.v2015_03_01_preview.Clusters list" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.HDInsight/clusters") + 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.hdinsight.v2015_03_01_preview.Clusters executeScriptActions" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/executeScriptActions") + Observable> executeScriptActions(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Query("api-version") String apiVersion, @Body ExecuteScriptActionParameters parameters, @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.hdinsight.v2015_03_01_preview.Clusters beginExecuteScriptActions" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/executeScriptActions") + Observable> beginExecuteScriptActions(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Query("api-version") String apiVersion, @Body ExecuteScriptActionParameters parameters, @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.hdinsight.v2015_03_01_preview.Clusters listByResourceGroupNext" }) + @GET + Observable> listByResourceGroupNext(@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.hdinsight.v2015_03_01_preview.Clusters listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Creates a new HDInsight cluster with the specified parameters. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param parameters The cluster create request. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ClusterInner object if successful. + */ + public ClusterInner create(String resourceGroupName, String clusterName, ClusterCreateParametersExtended parameters) { + return createWithServiceResponseAsync(resourceGroupName, clusterName, parameters).toBlocking().last().body(); + } + + /** + * Creates a new HDInsight cluster with the specified parameters. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param parameters The cluster create request. + * @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 createAsync(String resourceGroupName, String clusterName, ClusterCreateParametersExtended parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createWithServiceResponseAsync(resourceGroupName, clusterName, parameters), serviceCallback); + } + + /** + * Creates a new HDInsight cluster with the specified parameters. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param parameters The cluster create request. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createAsync(String resourceGroupName, String clusterName, ClusterCreateParametersExtended parameters) { + return createWithServiceResponseAsync(resourceGroupName, clusterName, parameters).map(new Func1, ClusterInner>() { + @Override + public ClusterInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates a new HDInsight cluster with the specified parameters. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param parameters The cluster create request. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createWithServiceResponseAsync(String resourceGroupName, String clusterName, ClusterCreateParametersExtended parameters) { + 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 (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName 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 (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + Observable> observable = service.create(this.client.subscriptionId(), resourceGroupName, clusterName, this.client.apiVersion(), parameters, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Creates a new HDInsight cluster with the specified parameters. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param parameters The cluster create request. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ClusterInner object if successful. + */ + public ClusterInner beginCreate(String resourceGroupName, String clusterName, ClusterCreateParametersExtended parameters) { + return beginCreateWithServiceResponseAsync(resourceGroupName, clusterName, parameters).toBlocking().single().body(); + } + + /** + * Creates a new HDInsight cluster with the specified parameters. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param parameters The cluster create request. + * @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 beginCreateAsync(String resourceGroupName, String clusterName, ClusterCreateParametersExtended parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateWithServiceResponseAsync(resourceGroupName, clusterName, parameters), serviceCallback); + } + + /** + * Creates a new HDInsight cluster with the specified parameters. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param parameters The cluster create request. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ClusterInner object + */ + public Observable beginCreateAsync(String resourceGroupName, String clusterName, ClusterCreateParametersExtended parameters) { + return beginCreateWithServiceResponseAsync(resourceGroupName, clusterName, parameters).map(new Func1, ClusterInner>() { + @Override + public ClusterInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates a new HDInsight cluster with the specified parameters. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param parameters The cluster create request. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ClusterInner object + */ + public Observable> beginCreateWithServiceResponseAsync(String resourceGroupName, String clusterName, ClusterCreateParametersExtended parameters) { + 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 (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName 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 (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + return service.beginCreate(this.client.subscriptionId(), resourceGroupName, clusterName, this.client.apiVersion(), parameters, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Patch HDInsight cluster with the specified parameters. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ClusterInner object if successful. + */ + public ClusterInner update(String resourceGroupName, String clusterName) { + return updateWithServiceResponseAsync(resourceGroupName, clusterName).toBlocking().single().body(); + } + + /** + * Patch HDInsight cluster with the specified parameters. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @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 clusterName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, clusterName), serviceCallback); + } + + /** + * Patch HDInsight cluster with the specified parameters. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ClusterInner object + */ + public Observable updateAsync(String resourceGroupName, String clusterName) { + return updateWithServiceResponseAsync(resourceGroupName, clusterName).map(new Func1, ClusterInner>() { + @Override + public ClusterInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Patch HDInsight cluster with the specified parameters. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ClusterInner object + */ + public Observable> updateWithServiceResponseAsync(String resourceGroupName, String clusterName) { + 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 (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName 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; + ClusterPatchParameters parameters = new ClusterPatchParameters(); + parameters.withTags(null); + return service.update(this.client.subscriptionId(), resourceGroupName, clusterName, this.client.apiVersion(), this.client.acceptLanguage(), parameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = updateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Patch HDInsight cluster with the specified parameters. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param tags The resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ClusterInner object if successful. + */ + public ClusterInner update(String resourceGroupName, String clusterName, Map tags) { + return updateWithServiceResponseAsync(resourceGroupName, clusterName, tags).toBlocking().single().body(); + } + + /** + * Patch HDInsight cluster with the specified parameters. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param tags The resource 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 clusterName, Map tags, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, clusterName, tags), serviceCallback); + } + + /** + * Patch HDInsight cluster with the specified parameters. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param tags The resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ClusterInner object + */ + public Observable updateAsync(String resourceGroupName, String clusterName, Map tags) { + return updateWithServiceResponseAsync(resourceGroupName, clusterName, tags).map(new Func1, ClusterInner>() { + @Override + public ClusterInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Patch HDInsight cluster with the specified parameters. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param tags The resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ClusterInner object + */ + public Observable> updateWithServiceResponseAsync(String resourceGroupName, String clusterName, 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 (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName 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); + ClusterPatchParameters parameters = new ClusterPatchParameters(); + parameters.withTags(tags); + return service.update(this.client.subscriptionId(), resourceGroupName, clusterName, this.client.apiVersion(), this.client.acceptLanguage(), parameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = updateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse updateDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Deletes the specified HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException 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 clusterName) { + deleteWithServiceResponseAsync(resourceGroupName, clusterName).toBlocking().last().body(); + } + + /** + * Deletes the specified HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @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 clusterName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, clusterName), serviceCallback); + } + + /** + * Deletes the specified HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String clusterName) { + return deleteWithServiceResponseAsync(resourceGroupName, clusterName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the specified HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String clusterName) { + 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 (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName 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, clusterName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Deletes the specified HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException 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 clusterName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, clusterName).toBlocking().single().body(); + } + + /** + * Deletes the specified HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @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 clusterName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, clusterName), serviceCallback); + } + + /** + * Deletes the specified HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String clusterName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, clusterName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the specified HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String clusterName) { + 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 (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName 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, clusterName, 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 ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Gets the specified cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ClusterInner object if successful. + */ + public ClusterInner getByResourceGroup(String resourceGroupName, String clusterName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, clusterName).toBlocking().single().body(); + } + + /** + * Gets the specified cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @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 clusterName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getByResourceGroupWithServiceResponseAsync(resourceGroupName, clusterName), serviceCallback); + } + + /** + * Gets the specified cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ClusterInner object + */ + public Observable getByResourceGroupAsync(String resourceGroupName, String clusterName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, clusterName).map(new Func1, ClusterInner>() { + @Override + public ClusterInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the specified cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ClusterInner object + */ + public Observable> getByResourceGroupWithServiceResponseAsync(String resourceGroupName, String clusterName) { + 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 (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName 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, clusterName, 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 ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Lists the HDInsight clusters in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException 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<ClusterInner> 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(); + } + }; + } + + /** + * Lists the HDInsight clusters in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupAsync(final String resourceGroupName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupSinglePageAsync(resourceGroupName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists the HDInsight clusters in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ClusterInner> object + */ + public Observable> listByResourceGroupAsync(final String resourceGroupName) { + return listByResourceGroupWithServiceResponseAsync(resourceGroupName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists the HDInsight clusters in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ClusterInner> 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)); + } + }); + } + + /** + * Lists the HDInsight clusters in a resource group. + * + ServiceResponse> * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ClusterInner> 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 ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Resizes the specified HDInsight cluster to the specified size. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void resize(String resourceGroupName, String clusterName) { + resizeWithServiceResponseAsync(resourceGroupName, clusterName).toBlocking().last().body(); + } + + /** + * Resizes the specified HDInsight cluster to the specified size. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @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 resizeAsync(String resourceGroupName, String clusterName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(resizeWithServiceResponseAsync(resourceGroupName, clusterName), serviceCallback); + } + + /** + * Resizes the specified HDInsight cluster to the specified size. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable resizeAsync(String resourceGroupName, String clusterName) { + return resizeWithServiceResponseAsync(resourceGroupName, clusterName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Resizes the specified HDInsight cluster to the specified size. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> resizeWithServiceResponseAsync(String resourceGroupName, String clusterName) { + 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 (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName 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 String roleName = "workernode"; + final Integer targetInstanceCount = null; + ClusterResizeParameters parameters = new ClusterResizeParameters(); + parameters.withTargetInstanceCount(null); + Observable> observable = service.resize(this.client.subscriptionId(), resourceGroupName, clusterName, roleName, this.client.apiVersion(), this.client.acceptLanguage(), parameters, this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + /** + * Resizes the specified HDInsight cluster to the specified size. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param targetInstanceCount The target instance count for the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void resize(String resourceGroupName, String clusterName, Integer targetInstanceCount) { + resizeWithServiceResponseAsync(resourceGroupName, clusterName, targetInstanceCount).toBlocking().last().body(); + } + + /** + * Resizes the specified HDInsight cluster to the specified size. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param targetInstanceCount The target instance count for the operation. + * @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 resizeAsync(String resourceGroupName, String clusterName, Integer targetInstanceCount, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(resizeWithServiceResponseAsync(resourceGroupName, clusterName, targetInstanceCount), serviceCallback); + } + + /** + * Resizes the specified HDInsight cluster to the specified size. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param targetInstanceCount The target instance count for the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable resizeAsync(String resourceGroupName, String clusterName, Integer targetInstanceCount) { + return resizeWithServiceResponseAsync(resourceGroupName, clusterName, targetInstanceCount).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Resizes the specified HDInsight cluster to the specified size. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param targetInstanceCount The target instance count for the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> resizeWithServiceResponseAsync(String resourceGroupName, String clusterName, Integer targetInstanceCount) { + 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 (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName 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 String roleName = "workernode"; + ClusterResizeParameters parameters = new ClusterResizeParameters(); + parameters.withTargetInstanceCount(targetInstanceCount); + Observable> observable = service.resize(this.client.subscriptionId(), resourceGroupName, clusterName, roleName, this.client.apiVersion(), this.client.acceptLanguage(), parameters, this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Resizes the specified HDInsight cluster to the specified size. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginResize(String resourceGroupName, String clusterName) { + beginResizeWithServiceResponseAsync(resourceGroupName, clusterName).toBlocking().single().body(); + } + + /** + * Resizes the specified HDInsight cluster to the specified size. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @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 beginResizeAsync(String resourceGroupName, String clusterName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginResizeWithServiceResponseAsync(resourceGroupName, clusterName), serviceCallback); + } + + /** + * Resizes the specified HDInsight cluster to the specified size. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginResizeAsync(String resourceGroupName, String clusterName) { + return beginResizeWithServiceResponseAsync(resourceGroupName, clusterName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Resizes the specified HDInsight cluster to the specified size. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginResizeWithServiceResponseAsync(String resourceGroupName, String clusterName) { + 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 (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName 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 String roleName = "workernode"; + final Integer targetInstanceCount = null; + ClusterResizeParameters parameters = new ClusterResizeParameters(); + parameters.withTargetInstanceCount(null); + return service.beginResize(this.client.subscriptionId(), resourceGroupName, clusterName, roleName, this.client.apiVersion(), this.client.acceptLanguage(), parameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginResizeDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Resizes the specified HDInsight cluster to the specified size. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param targetInstanceCount The target instance count for the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginResize(String resourceGroupName, String clusterName, Integer targetInstanceCount) { + beginResizeWithServiceResponseAsync(resourceGroupName, clusterName, targetInstanceCount).toBlocking().single().body(); + } + + /** + * Resizes the specified HDInsight cluster to the specified size. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param targetInstanceCount The target instance count for the operation. + * @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 beginResizeAsync(String resourceGroupName, String clusterName, Integer targetInstanceCount, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginResizeWithServiceResponseAsync(resourceGroupName, clusterName, targetInstanceCount), serviceCallback); + } + + /** + * Resizes the specified HDInsight cluster to the specified size. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param targetInstanceCount The target instance count for the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginResizeAsync(String resourceGroupName, String clusterName, Integer targetInstanceCount) { + return beginResizeWithServiceResponseAsync(resourceGroupName, clusterName, targetInstanceCount).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Resizes the specified HDInsight cluster to the specified size. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param targetInstanceCount The target instance count for the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginResizeWithServiceResponseAsync(String resourceGroupName, String clusterName, Integer targetInstanceCount) { + 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 (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName 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 String roleName = "workernode"; + ClusterResizeParameters parameters = new ClusterResizeParameters(); + parameters.withTargetInstanceCount(targetInstanceCount); + return service.beginResize(this.client.subscriptionId(), resourceGroupName, clusterName, roleName, this.client.apiVersion(), this.client.acceptLanguage(), parameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginResizeDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginResizeDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Lists all the HDInsight clusters under the subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException 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<ClusterInner> 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 the HDInsight clusters under the 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); + } + + /** + * Lists all the HDInsight clusters under the subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ClusterInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all the HDInsight clusters under the subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ClusterInner> 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 the HDInsight clusters under the subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ClusterInner> 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 ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Executes script actions on the specified HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param parameters The parameters for executing script actions. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void executeScriptActions(String resourceGroupName, String clusterName, ExecuteScriptActionParameters parameters) { + executeScriptActionsWithServiceResponseAsync(resourceGroupName, clusterName, parameters).toBlocking().last().body(); + } + + /** + * Executes script actions on the specified HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param parameters The parameters for executing script actions. + * @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 executeScriptActionsAsync(String resourceGroupName, String clusterName, ExecuteScriptActionParameters parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(executeScriptActionsWithServiceResponseAsync(resourceGroupName, clusterName, parameters), serviceCallback); + } + + /** + * Executes script actions on the specified HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param parameters The parameters for executing script actions. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable executeScriptActionsAsync(String resourceGroupName, String clusterName, ExecuteScriptActionParameters parameters) { + return executeScriptActionsWithServiceResponseAsync(resourceGroupName, clusterName, parameters).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Executes script actions on the specified HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param parameters The parameters for executing script actions. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> executeScriptActionsWithServiceResponseAsync(String resourceGroupName, String clusterName, ExecuteScriptActionParameters parameters) { + 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 (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName 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 (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + Observable> observable = service.executeScriptActions(this.client.subscriptionId(), resourceGroupName, clusterName, this.client.apiVersion(), parameters, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Executes script actions on the specified HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param parameters The parameters for executing script actions. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginExecuteScriptActions(String resourceGroupName, String clusterName, ExecuteScriptActionParameters parameters) { + beginExecuteScriptActionsWithServiceResponseAsync(resourceGroupName, clusterName, parameters).toBlocking().single().body(); + } + + /** + * Executes script actions on the specified HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param parameters The parameters for executing script actions. + * @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 beginExecuteScriptActionsAsync(String resourceGroupName, String clusterName, ExecuteScriptActionParameters parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginExecuteScriptActionsWithServiceResponseAsync(resourceGroupName, clusterName, parameters), serviceCallback); + } + + /** + * Executes script actions on the specified HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param parameters The parameters for executing script actions. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginExecuteScriptActionsAsync(String resourceGroupName, String clusterName, ExecuteScriptActionParameters parameters) { + return beginExecuteScriptActionsWithServiceResponseAsync(resourceGroupName, clusterName, parameters).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Executes script actions on the specified HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param parameters The parameters for executing script actions. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginExecuteScriptActionsWithServiceResponseAsync(String resourceGroupName, String clusterName, ExecuteScriptActionParameters parameters) { + 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 (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName 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 (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + return service.beginExecuteScriptActions(this.client.subscriptionId(), resourceGroupName, clusterName, this.client.apiVersion(), parameters, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginExecuteScriptActionsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginExecuteScriptActionsDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Lists the HDInsight clusters 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 ErrorResponseException 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<ClusterInner> 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(); + } + }; + } + + /** + * Lists the HDInsight clusters 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); + } + + /** + * Lists the HDInsight clusters 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<ClusterInner> object + */ + public Observable> listByResourceGroupNextAsync(final String nextPageLink) { + return listByResourceGroupNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists the HDInsight clusters 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<ClusterInner> 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)); + } + }); + } + + /** + * Lists the HDInsight clusters 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<ClusterInner> 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 ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Lists all the HDInsight clusters under the subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException 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<ClusterInner> 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 the HDInsight clusters under the 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); + } + + /** + * Lists all the HDInsight clusters under the 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<ClusterInner> 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 the HDInsight clusters under the 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<ClusterInner> 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 the HDInsight clusters under the 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<ClusterInner> 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 ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + +} diff --git a/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/ConfigurationsImpl.java b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/ConfigurationsImpl.java new file mode 100644 index 000000000000..5a518832da80 --- /dev/null +++ b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/ConfigurationsImpl.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. + * abc + */ + +package com.microsoft.azure.management.hdinsight.v2015_03_01_preview.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.hdinsight.v2015_03_01_preview.Configurations; +import rx.Completable; +import rx.functions.Func1; +import rx.Observable; +import java.util.Map; + +class ConfigurationsImpl extends WrapperImpl implements Configurations { + private final HDInsightManager manager; + + ConfigurationsImpl(HDInsightManager manager) { + super(manager.inner().configurations()); + this.manager = manager; + } + + public HDInsightManager manager() { + return this.manager; + } + + @Override + public Completable updateHTTPSettingsAsync(String resourceGroupName, String clusterName, String configurationName, Map parameters) { + ConfigurationsInner client = this.inner(); + return client.updateHTTPSettingsAsync(resourceGroupName, clusterName, configurationName, parameters).toCompletable(); + } + + @Override + public Observable> getAsync(String resourceGroupName, String clusterName, String configurationName) { + ConfigurationsInner client = this.inner(); + return client.getAsync(resourceGroupName, clusterName, configurationName) + ;} + +} diff --git a/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/ConfigurationsInner.java b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/ConfigurationsInner.java new file mode 100644 index 000000000000..d6cf943c9d95 --- /dev/null +++ b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/ConfigurationsInner.java @@ -0,0 +1,350 @@ +/** + * 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.hdinsight.v2015_03_01_preview.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.management.hdinsight.v2015_03_01_preview.ErrorResponseException; +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.Map; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Path; +import retrofit2.http.POST; +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 Configurations. + */ +public class ConfigurationsInner { + /** The Retrofit service to perform REST calls. */ + private ConfigurationsService service; + /** The service client containing this operation class. */ + private HDInsightManagementClientImpl client; + + /** + * Initializes an instance of ConfigurationsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public ConfigurationsInner(Retrofit retrofit, HDInsightManagementClientImpl client) { + this.service = retrofit.create(ConfigurationsService.class); + this.client = client; + } + + /** + * The interface defining all the services for Configurations to be + * used by Retrofit to perform actually REST calls. + */ + interface ConfigurationsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.hdinsight.v2015_03_01_preview.Configurations updateHTTPSettings" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/configurations/{configurationName}") + Observable> updateHTTPSettings(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Path("configurationName") String configurationName, @Query("api-version") String apiVersion, @Body Map parameters, @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.hdinsight.v2015_03_01_preview.Configurations beginUpdateHTTPSettings" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/configurations/{configurationName}") + Observable> beginUpdateHTTPSettings(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Path("configurationName") String configurationName, @Query("api-version") String apiVersion, @Body Map parameters, @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.hdinsight.v2015_03_01_preview.Configurations get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/configurations/{configurationName}") + Observable> get(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Path("configurationName") String configurationName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Configures the HTTP settings on the specified cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param configurationName The name of the cluster configuration. + * @param parameters The cluster configurations. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void updateHTTPSettings(String resourceGroupName, String clusterName, String configurationName, Map parameters) { + updateHTTPSettingsWithServiceResponseAsync(resourceGroupName, clusterName, configurationName, parameters).toBlocking().last().body(); + } + + /** + * Configures the HTTP settings on the specified cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param configurationName The name of the cluster configuration. + * @param parameters The cluster configurations. + * @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 updateHTTPSettingsAsync(String resourceGroupName, String clusterName, String configurationName, Map parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateHTTPSettingsWithServiceResponseAsync(resourceGroupName, clusterName, configurationName, parameters), serviceCallback); + } + + /** + * Configures the HTTP settings on the specified cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param configurationName The name of the cluster configuration. + * @param parameters The cluster configurations. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable updateHTTPSettingsAsync(String resourceGroupName, String clusterName, String configurationName, Map parameters) { + return updateHTTPSettingsWithServiceResponseAsync(resourceGroupName, clusterName, configurationName, parameters).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Configures the HTTP settings on the specified cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param configurationName The name of the cluster configuration. + * @param parameters The cluster configurations. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> updateHTTPSettingsWithServiceResponseAsync(String resourceGroupName, String clusterName, String configurationName, Map parameters) { + 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 (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName is required and cannot be null."); + } + if (configurationName == null) { + throw new IllegalArgumentException("Parameter configurationName 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 (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + Observable> observable = service.updateHTTPSettings(this.client.subscriptionId(), resourceGroupName, clusterName, configurationName, this.client.apiVersion(), parameters, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Configures the HTTP settings on the specified cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param configurationName The name of the cluster configuration. + * @param parameters The cluster configurations. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginUpdateHTTPSettings(String resourceGroupName, String clusterName, String configurationName, Map parameters) { + beginUpdateHTTPSettingsWithServiceResponseAsync(resourceGroupName, clusterName, configurationName, parameters).toBlocking().single().body(); + } + + /** + * Configures the HTTP settings on the specified cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param configurationName The name of the cluster configuration. + * @param parameters The cluster configurations. + * @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 beginUpdateHTTPSettingsAsync(String resourceGroupName, String clusterName, String configurationName, Map parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateHTTPSettingsWithServiceResponseAsync(resourceGroupName, clusterName, configurationName, parameters), serviceCallback); + } + + /** + * Configures the HTTP settings on the specified cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param configurationName The name of the cluster configuration. + * @param parameters The cluster configurations. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginUpdateHTTPSettingsAsync(String resourceGroupName, String clusterName, String configurationName, Map parameters) { + return beginUpdateHTTPSettingsWithServiceResponseAsync(resourceGroupName, clusterName, configurationName, parameters).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Configures the HTTP settings on the specified cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param configurationName The name of the cluster configuration. + * @param parameters The cluster configurations. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginUpdateHTTPSettingsWithServiceResponseAsync(String resourceGroupName, String clusterName, String configurationName, Map parameters) { + 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 (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName is required and cannot be null."); + } + if (configurationName == null) { + throw new IllegalArgumentException("Parameter configurationName 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 (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + return service.beginUpdateHTTPSettings(this.client.subscriptionId(), resourceGroupName, clusterName, configurationName, this.client.apiVersion(), parameters, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginUpdateHTTPSettingsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginUpdateHTTPSettingsDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * The configuration object for the specified cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param configurationName The name of the cluster configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Map<String, String> object if successful. + */ + public Map get(String resourceGroupName, String clusterName, String configurationName) { + return getWithServiceResponseAsync(resourceGroupName, clusterName, configurationName).toBlocking().single().body(); + } + + /** + * The configuration object for the specified cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param configurationName The name of the cluster configuration. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> getAsync(String resourceGroupName, String clusterName, String configurationName, final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, clusterName, configurationName), serviceCallback); + } + + /** + * The configuration object for the specified cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param configurationName The name of the cluster configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Map<String, String> object + */ + public Observable> getAsync(String resourceGroupName, String clusterName, String configurationName) { + return getWithServiceResponseAsync(resourceGroupName, clusterName, configurationName).map(new Func1>, Map>() { + @Override + public Map call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * The configuration object for the specified cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param configurationName The name of the cluster configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Map<String, String> object + */ + public Observable>> getWithServiceResponseAsync(String resourceGroupName, String clusterName, String configurationName) { + 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 (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName is required and cannot be null."); + } + if (configurationName == null) { + throw new IllegalArgumentException("Parameter configurationName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.get(this.client.subscriptionId(), resourceGroupName, clusterName, configurationName, 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 ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + +} diff --git a/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/ExtensionImpl.java b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/ExtensionImpl.java new file mode 100644 index 000000000000..32c4922c4897 --- /dev/null +++ b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/ExtensionImpl.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.hdinsight.v2015_03_01_preview.implementation; + +import com.microsoft.azure.management.hdinsight.v2015_03_01_preview.Extension; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import rx.Observable; + +class ExtensionImpl extends WrapperImpl implements Extension { + private final HDInsightManager manager; + private String resourceGroupName; + private String clusterName; + private String extensionName; + + ExtensionImpl(ExtensionInner inner, HDInsightManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public HDInsightManager manager() { + return this.manager; + } + + + + @Override + public String primaryKey() { + return this.inner().primaryKey(); + } + + @Override + public String workspaceId() { + return this.inner().workspaceId(); + } + +} diff --git a/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/ExtensionInner.java b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/ExtensionInner.java new file mode 100644 index 000000000000..a65fbca54f90 --- /dev/null +++ b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/ExtensionInner.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.hdinsight.v2015_03_01_preview.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Cluster monitoring extensions. + */ +public class ExtensionInner { + /** + * The workspace ID for the cluster monitoring extension. + */ + @JsonProperty(value = "workspaceId") + private String workspaceId; + + /** + * The certificate for the cluster monitoring extensions. + */ + @JsonProperty(value = "primaryKey") + private String primaryKey; + + /** + * Get the workspace ID for the cluster monitoring extension. + * + * @return the workspaceId value + */ + public String workspaceId() { + return this.workspaceId; + } + + /** + * Set the workspace ID for the cluster monitoring extension. + * + * @param workspaceId the workspaceId value to set + * @return the ExtensionInner object itself. + */ + public ExtensionInner withWorkspaceId(String workspaceId) { + this.workspaceId = workspaceId; + return this; + } + + /** + * Get the certificate for the cluster monitoring extensions. + * + * @return the primaryKey value + */ + public String primaryKey() { + return this.primaryKey; + } + + /** + * Set the certificate for the cluster monitoring extensions. + * + * @param primaryKey the primaryKey value to set + * @return the ExtensionInner object itself. + */ + public ExtensionInner withPrimaryKey(String primaryKey) { + this.primaryKey = primaryKey; + return this; + } + +} diff --git a/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/ExtensionsImpl.java b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/ExtensionsImpl.java new file mode 100644 index 000000000000..01cf8996226d --- /dev/null +++ b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/ExtensionsImpl.java @@ -0,0 +1,85 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * + */ + +package com.microsoft.azure.management.hdinsight.v2015_03_01_preview.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.hdinsight.v2015_03_01_preview.Extensions; +import rx.Completable; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.management.hdinsight.v2015_03_01_preview.ClusterMonitoringResponse; +import com.microsoft.azure.management.hdinsight.v2015_03_01_preview.Extension; +import com.microsoft.azure.management.hdinsight.v2015_03_01_preview.ClusterMonitoringRequest; + +class ExtensionsImpl extends WrapperImpl implements Extensions { + private final HDInsightManager manager; + + ExtensionsImpl(HDInsightManager manager) { + super(manager.inner().extensions()); + this.manager = manager; + } + + public HDInsightManager manager() { + return this.manager; + } + + private ExtensionImpl wrapModel(ExtensionInner inner) { + return new ExtensionImpl(inner, manager()); + } + + @Override + public Observable getMonitoringStatusAsync(String resourceGroupName, String clusterName) { + ExtensionsInner client = this.inner(); + return client.getMonitoringStatusAsync(resourceGroupName, clusterName) + .map(new Func1() { + @Override + public ClusterMonitoringResponse call(ClusterMonitoringResponseInner inner) { + return new ClusterMonitoringResponseImpl(inner, manager()); + } + }); + } + + @Override + public Completable disableMonitoringAsync(String resourceGroupName, String clusterName) { + ExtensionsInner client = this.inner(); + return client.disableMonitoringAsync(resourceGroupName, clusterName).toCompletable(); + } + + @Override + public Observable getAsync(String resourceGroupName, String clusterName, String extensionName) { + ExtensionsInner client = this.inner(); + return client.getAsync(resourceGroupName, clusterName, extensionName) + .map(new Func1() { + @Override + public Extension call(ExtensionInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Completable deleteAsync(String resourceGroupName, String clusterName, String extensionName) { + ExtensionsInner client = this.inner(); + return client.deleteAsync(resourceGroupName, clusterName, extensionName).toCompletable(); + } + + @Override + public Completable enableMonitoringAsync(String resourceGroupName, String clusterName, ClusterMonitoringRequest parameters) { + ExtensionsInner client = this.inner(); + return client.enableMonitoringAsync(resourceGroupName, clusterName, parameters).toCompletable(); + } + + @Override + public Completable createAsync(String resourceGroupName, String clusterName, String extensionName, ExtensionInner parameters) { + ExtensionsInner client = this.inner(); + return client.createAsync(resourceGroupName, clusterName, extensionName, parameters).toCompletable(); + } + +} diff --git a/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/ExtensionsInner.java b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/ExtensionsInner.java new file mode 100644 index 000000000000..311e8bc8ffbe --- /dev/null +++ b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/ExtensionsInner.java @@ -0,0 +1,790 @@ +/** + * 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.hdinsight.v2015_03_01_preview.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.management.hdinsight.v2015_03_01_preview.ClusterMonitoringRequest; +import com.microsoft.azure.management.hdinsight.v2015_03_01_preview.ErrorResponseException; +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 okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.Path; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Extensions. + */ +public class ExtensionsInner { + /** The Retrofit service to perform REST calls. */ + private ExtensionsService service; + /** The service client containing this operation class. */ + private HDInsightManagementClientImpl client; + + /** + * Initializes an instance of ExtensionsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public ExtensionsInner(Retrofit retrofit, HDInsightManagementClientImpl client) { + this.service = retrofit.create(ExtensionsService.class); + this.client = client; + } + + /** + * The interface defining all the services for Extensions to be + * used by Retrofit to perform actually REST calls. + */ + interface ExtensionsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.hdinsight.v2015_03_01_preview.Extensions enableMonitoring" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/extensions/clustermonitoring") + Observable> enableMonitoring(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Query("api-version") String apiVersion, @Body ClusterMonitoringRequest parameters, @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.hdinsight.v2015_03_01_preview.Extensions beginEnableMonitoring" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/extensions/clustermonitoring") + Observable> beginEnableMonitoring(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Query("api-version") String apiVersion, @Body ClusterMonitoringRequest parameters, @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.hdinsight.v2015_03_01_preview.Extensions getMonitoringStatus" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/extensions/clustermonitoring") + Observable> getMonitoringStatus(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @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.hdinsight.v2015_03_01_preview.Extensions disableMonitoring" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/extensions/clustermonitoring", method = "DELETE", hasBody = true) + Observable> disableMonitoring(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @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.hdinsight.v2015_03_01_preview.Extensions beginDisableMonitoring" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/extensions/clustermonitoring", method = "DELETE", hasBody = true) + Observable> beginDisableMonitoring(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @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.hdinsight.v2015_03_01_preview.Extensions create" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/extensions/{extensionName}") + Observable> create(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Path("extensionName") String extensionName, @Query("api-version") String apiVersion, @Body ExtensionInner parameters, @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.hdinsight.v2015_03_01_preview.Extensions get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/extensions/{extensionName}") + Observable> get(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Path("extensionName") String extensionName, @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.hdinsight.v2015_03_01_preview.Extensions delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/extensions/{extensionName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Path("extensionName") String extensionName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Enables the Operations Management Suite (OMS) on the HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param parameters The Operations Management Suite (OMS) workspace parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void enableMonitoring(String resourceGroupName, String clusterName, ClusterMonitoringRequest parameters) { + enableMonitoringWithServiceResponseAsync(resourceGroupName, clusterName, parameters).toBlocking().last().body(); + } + + /** + * Enables the Operations Management Suite (OMS) on the HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param parameters The Operations Management Suite (OMS) workspace parameters. + * @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 enableMonitoringAsync(String resourceGroupName, String clusterName, ClusterMonitoringRequest parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(enableMonitoringWithServiceResponseAsync(resourceGroupName, clusterName, parameters), serviceCallback); + } + + /** + * Enables the Operations Management Suite (OMS) on the HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param parameters The Operations Management Suite (OMS) workspace parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable enableMonitoringAsync(String resourceGroupName, String clusterName, ClusterMonitoringRequest parameters) { + return enableMonitoringWithServiceResponseAsync(resourceGroupName, clusterName, parameters).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Enables the Operations Management Suite (OMS) on the HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param parameters The Operations Management Suite (OMS) workspace parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> enableMonitoringWithServiceResponseAsync(String resourceGroupName, String clusterName, ClusterMonitoringRequest parameters) { + 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 (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName 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 (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + Observable> observable = service.enableMonitoring(this.client.subscriptionId(), resourceGroupName, clusterName, this.client.apiVersion(), parameters, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Enables the Operations Management Suite (OMS) on the HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param parameters The Operations Management Suite (OMS) workspace parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginEnableMonitoring(String resourceGroupName, String clusterName, ClusterMonitoringRequest parameters) { + beginEnableMonitoringWithServiceResponseAsync(resourceGroupName, clusterName, parameters).toBlocking().single().body(); + } + + /** + * Enables the Operations Management Suite (OMS) on the HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param parameters The Operations Management Suite (OMS) workspace parameters. + * @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 beginEnableMonitoringAsync(String resourceGroupName, String clusterName, ClusterMonitoringRequest parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginEnableMonitoringWithServiceResponseAsync(resourceGroupName, clusterName, parameters), serviceCallback); + } + + /** + * Enables the Operations Management Suite (OMS) on the HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param parameters The Operations Management Suite (OMS) workspace parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginEnableMonitoringAsync(String resourceGroupName, String clusterName, ClusterMonitoringRequest parameters) { + return beginEnableMonitoringWithServiceResponseAsync(resourceGroupName, clusterName, parameters).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Enables the Operations Management Suite (OMS) on the HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param parameters The Operations Management Suite (OMS) workspace parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginEnableMonitoringWithServiceResponseAsync(String resourceGroupName, String clusterName, ClusterMonitoringRequest parameters) { + 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 (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName 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 (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + return service.beginEnableMonitoring(this.client.subscriptionId(), resourceGroupName, clusterName, this.client.apiVersion(), parameters, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginEnableMonitoringDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginEnableMonitoringDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Gets the status of Operations Management Suite (OMS) on the HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ClusterMonitoringResponseInner object if successful. + */ + public ClusterMonitoringResponseInner getMonitoringStatus(String resourceGroupName, String clusterName) { + return getMonitoringStatusWithServiceResponseAsync(resourceGroupName, clusterName).toBlocking().single().body(); + } + + /** + * Gets the status of Operations Management Suite (OMS) on the HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @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 getMonitoringStatusAsync(String resourceGroupName, String clusterName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getMonitoringStatusWithServiceResponseAsync(resourceGroupName, clusterName), serviceCallback); + } + + /** + * Gets the status of Operations Management Suite (OMS) on the HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ClusterMonitoringResponseInner object + */ + public Observable getMonitoringStatusAsync(String resourceGroupName, String clusterName) { + return getMonitoringStatusWithServiceResponseAsync(resourceGroupName, clusterName).map(new Func1, ClusterMonitoringResponseInner>() { + @Override + public ClusterMonitoringResponseInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the status of Operations Management Suite (OMS) on the HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ClusterMonitoringResponseInner object + */ + public Observable> getMonitoringStatusWithServiceResponseAsync(String resourceGroupName, String clusterName) { + 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 (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName 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.getMonitoringStatus(this.client.subscriptionId(), resourceGroupName, clusterName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getMonitoringStatusDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getMonitoringStatusDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Disables the Operations Management Suite (OMS) on the HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void disableMonitoring(String resourceGroupName, String clusterName) { + disableMonitoringWithServiceResponseAsync(resourceGroupName, clusterName).toBlocking().last().body(); + } + + /** + * Disables the Operations Management Suite (OMS) on the HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @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 disableMonitoringAsync(String resourceGroupName, String clusterName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(disableMonitoringWithServiceResponseAsync(resourceGroupName, clusterName), serviceCallback); + } + + /** + * Disables the Operations Management Suite (OMS) on the HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable disableMonitoringAsync(String resourceGroupName, String clusterName) { + return disableMonitoringWithServiceResponseAsync(resourceGroupName, clusterName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Disables the Operations Management Suite (OMS) on the HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> disableMonitoringWithServiceResponseAsync(String resourceGroupName, String clusterName) { + 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 (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName 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.disableMonitoring(this.client.subscriptionId(), resourceGroupName, clusterName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Disables the Operations Management Suite (OMS) on the HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDisableMonitoring(String resourceGroupName, String clusterName) { + beginDisableMonitoringWithServiceResponseAsync(resourceGroupName, clusterName).toBlocking().single().body(); + } + + /** + * Disables the Operations Management Suite (OMS) on the HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @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 beginDisableMonitoringAsync(String resourceGroupName, String clusterName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDisableMonitoringWithServiceResponseAsync(resourceGroupName, clusterName), serviceCallback); + } + + /** + * Disables the Operations Management Suite (OMS) on the HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDisableMonitoringAsync(String resourceGroupName, String clusterName) { + return beginDisableMonitoringWithServiceResponseAsync(resourceGroupName, clusterName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Disables the Operations Management Suite (OMS) on the HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDisableMonitoringWithServiceResponseAsync(String resourceGroupName, String clusterName) { + 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 (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName 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.beginDisableMonitoring(this.client.subscriptionId(), resourceGroupName, clusterName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDisableMonitoringDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDisableMonitoringDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Creates an HDInsight cluster extension. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param extensionName The name of the cluster extension. + * @param parameters The cluster extensions create request. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void create(String resourceGroupName, String clusterName, String extensionName, ExtensionInner parameters) { + createWithServiceResponseAsync(resourceGroupName, clusterName, extensionName, parameters).toBlocking().single().body(); + } + + /** + * Creates an HDInsight cluster extension. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param extensionName The name of the cluster extension. + * @param parameters The cluster extensions create request. + * @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 createAsync(String resourceGroupName, String clusterName, String extensionName, ExtensionInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createWithServiceResponseAsync(resourceGroupName, clusterName, extensionName, parameters), serviceCallback); + } + + /** + * Creates an HDInsight cluster extension. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param extensionName The name of the cluster extension. + * @param parameters The cluster extensions create request. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable createAsync(String resourceGroupName, String clusterName, String extensionName, ExtensionInner parameters) { + return createWithServiceResponseAsync(resourceGroupName, clusterName, extensionName, parameters).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates an HDInsight cluster extension. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param extensionName The name of the cluster extension. + * @param parameters The cluster extensions create request. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> createWithServiceResponseAsync(String resourceGroupName, String clusterName, String extensionName, ExtensionInner parameters) { + 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 (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName is required and cannot be null."); + } + if (extensionName == null) { + throw new IllegalArgumentException("Parameter extensionName 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 (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + return service.create(this.client.subscriptionId(), resourceGroupName, clusterName, extensionName, this.client.apiVersion(), parameters, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = createDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse createDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Gets the extension properties for the specified HDInsight cluster extension. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param extensionName The name of the cluster extension. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ExtensionInner object if successful. + */ + public ExtensionInner get(String resourceGroupName, String clusterName, String extensionName) { + return getWithServiceResponseAsync(resourceGroupName, clusterName, extensionName).toBlocking().single().body(); + } + + /** + * Gets the extension properties for the specified HDInsight cluster extension. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param extensionName The name of the cluster extension. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String resourceGroupName, String clusterName, String extensionName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, clusterName, extensionName), serviceCallback); + } + + /** + * Gets the extension properties for the specified HDInsight cluster extension. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param extensionName The name of the cluster extension. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ExtensionInner object + */ + public Observable getAsync(String resourceGroupName, String clusterName, String extensionName) { + return getWithServiceResponseAsync(resourceGroupName, clusterName, extensionName).map(new Func1, ExtensionInner>() { + @Override + public ExtensionInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the extension properties for the specified HDInsight cluster extension. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param extensionName The name of the cluster extension. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ExtensionInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String clusterName, String extensionName) { + 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 (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName is required and cannot be null."); + } + if (extensionName == null) { + throw new IllegalArgumentException("Parameter extensionName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.get(this.client.subscriptionId(), resourceGroupName, clusterName, extensionName, 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 ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Deletes the specified extension for HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param extensionName The name of the cluster extension. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException 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 clusterName, String extensionName) { + deleteWithServiceResponseAsync(resourceGroupName, clusterName, extensionName).toBlocking().single().body(); + } + + /** + * Deletes the specified extension for HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param extensionName The name of the cluster extension. + * @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 clusterName, String extensionName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, clusterName, extensionName), serviceCallback); + } + + /** + * Deletes the specified extension for HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param extensionName The name of the cluster extension. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable deleteAsync(String resourceGroupName, String clusterName, String extensionName) { + return deleteWithServiceResponseAsync(resourceGroupName, clusterName, extensionName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the specified extension for HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param extensionName The name of the cluster extension. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String clusterName, String extensionName) { + 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 (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName is required and cannot be null."); + } + if (extensionName == null) { + throw new IllegalArgumentException("Parameter extensionName 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.delete(this.client.subscriptionId(), resourceGroupName, clusterName, extensionName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = deleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse deleteDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + +} diff --git a/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/HDInsightManagementClientImpl.java b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/HDInsightManagementClientImpl.java new file mode 100644 index 000000000000..5c53e58065c2 --- /dev/null +++ b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/HDInsightManagementClientImpl.java @@ -0,0 +1,294 @@ +/** + * 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.hdinsight.v2015_03_01_preview.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 HDInsightManagementClientImpl class. + */ +public class HDInsightManagementClientImpl 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 credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. */ + private String subscriptionId; + + /** + * Gets The subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + * + * @return the subscriptionId value. + */ + public String subscriptionId() { + return this.subscriptionId; + } + + /** + * Sets The subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + * + * @param subscriptionId the subscriptionId value. + * @return the service client itself + */ + public HDInsightManagementClientImpl withSubscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; + return this; + } + + /** The HDInsight client API Version. */ + private String apiVersion; + + /** + * Gets The HDInsight client API Version. + * + * @return the apiVersion value. + */ + public String apiVersion() { + return this.apiVersion; + } + + /** The preferred language for the response. */ + private String acceptLanguage; + + /** + * Gets The preferred language for the response. + * + * @return the acceptLanguage value. + */ + public String acceptLanguage() { + return this.acceptLanguage; + } + + /** + * Sets The preferred language for the response. + * + * @param acceptLanguage the acceptLanguage value. + * @return the service client itself + */ + public HDInsightManagementClientImpl 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 HDInsightManagementClientImpl 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 HDInsightManagementClientImpl withGenerateClientRequestId(boolean generateClientRequestId) { + this.generateClientRequestId = generateClientRequestId; + return this; + } + + /** + * The ClustersInner object to access its operations. + */ + private ClustersInner clusters; + + /** + * Gets the ClustersInner object to access its operations. + * @return the ClustersInner object. + */ + public ClustersInner clusters() { + return this.clusters; + } + + /** + * The ApplicationsInner object to access its operations. + */ + private ApplicationsInner applications; + + /** + * Gets the ApplicationsInner object to access its operations. + * @return the ApplicationsInner object. + */ + public ApplicationsInner applications() { + return this.applications; + } + + /** + * The LocationsInner object to access its operations. + */ + private LocationsInner locations; + + /** + * Gets the LocationsInner object to access its operations. + * @return the LocationsInner object. + */ + public LocationsInner locations() { + return this.locations; + } + + /** + * The ConfigurationsInner object to access its operations. + */ + private ConfigurationsInner configurations; + + /** + * Gets the ConfigurationsInner object to access its operations. + * @return the ConfigurationsInner object. + */ + public ConfigurationsInner configurations() { + return this.configurations; + } + + /** + * The ExtensionsInner object to access its operations. + */ + private ExtensionsInner extensions; + + /** + * Gets the ExtensionsInner object to access its operations. + * @return the ExtensionsInner object. + */ + public ExtensionsInner extensions() { + return this.extensions; + } + + /** + * The ScriptActionsInner object to access its operations. + */ + private ScriptActionsInner scriptActions; + + /** + * Gets the ScriptActionsInner object to access its operations. + * @return the ScriptActionsInner object. + */ + public ScriptActionsInner scriptActions() { + return this.scriptActions; + } + + /** + * The ScriptExecutionHistorysInner object to access its operations. + */ + private ScriptExecutionHistorysInner scriptExecutionHistorys; + + /** + * Gets the ScriptExecutionHistorysInner object to access its operations. + * @return the ScriptExecutionHistorysInner object. + */ + public ScriptExecutionHistorysInner scriptExecutionHistorys() { + return this.scriptExecutionHistorys; + } + + /** + * 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; + } + + /** + * Initializes an instance of HDInsightManagementClient client. + * + * @param credentials the management credentials for Azure + */ + public HDInsightManagementClientImpl(ServiceClientCredentials credentials) { + this("https://management.azure.com", credentials); + } + + /** + * Initializes an instance of HDInsightManagementClient client. + * + * @param baseUrl the base URL of the host + * @param credentials the management credentials for Azure + */ + public HDInsightManagementClientImpl(String baseUrl, ServiceClientCredentials credentials) { + super(baseUrl, credentials); + initialize(); + } + + /** + * Initializes an instance of HDInsightManagementClient client. + * + * @param restClient the REST client to connect to Azure. + */ + public HDInsightManagementClientImpl(RestClient restClient) { + super(restClient); + initialize(); + } + + protected void initialize() { + this.apiVersion = "2015-03-01-preview"; + this.acceptLanguage = "en-US"; + this.longRunningOperationRetryTimeout = 30; + this.generateClientRequestId = true; + this.clusters = new ClustersInner(restClient().retrofit(), this); + this.applications = new ApplicationsInner(restClient().retrofit(), this); + this.locations = new LocationsInner(restClient().retrofit(), this); + this.configurations = new ConfigurationsInner(restClient().retrofit(), this); + this.extensions = new ExtensionsInner(restClient().retrofit(), this); + this.scriptActions = new ScriptActionsInner(restClient().retrofit(), this); + this.scriptExecutionHistorys = new ScriptExecutionHistorysInner(restClient().retrofit(), this); + this.operations = new OperationsInner(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(), "HDInsightManagementClient", "2015-03-01-preview"); + } +} diff --git a/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/HDInsightManager.java b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/HDInsightManager.java new file mode 100644 index 000000000000..6f7342f04a44 --- /dev/null +++ b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/HDInsightManager.java @@ -0,0 +1,183 @@ +/** + * 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.hdinsight.v2015_03_01_preview.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.hdinsight.v2015_03_01_preview.Clusters; +import com.microsoft.azure.management.hdinsight.v2015_03_01_preview.Applications; +import com.microsoft.azure.management.hdinsight.v2015_03_01_preview.Locations; +import com.microsoft.azure.management.hdinsight.v2015_03_01_preview.Configurations; +import com.microsoft.azure.management.hdinsight.v2015_03_01_preview.Extensions; +import com.microsoft.azure.management.hdinsight.v2015_03_01_preview.ScriptActions; +import com.microsoft.azure.management.hdinsight.v2015_03_01_preview.ScriptExecutionHistorys; +import com.microsoft.azure.management.hdinsight.v2015_03_01_preview.Operations; +import com.microsoft.azure.arm.resources.implementation.AzureConfigurableCoreImpl; +import com.microsoft.azure.arm.resources.implementation.ManagerCore; + +/** + * Entry point to Azure HDInsight resource management. + */ +public final class HDInsightManager extends ManagerCore { + private Clusters clusters; + private Applications applications; + private Locations locations; + private Configurations configurations; + private Extensions extensions; + private ScriptActions scriptActions; + private ScriptExecutionHistorys scriptExecutionHistorys; + private Operations operations; + /** + * Get a Configurable instance that can be used to create HDInsightManager with optional configuration. + * + * @return the instance allowing configurations + */ + public static Configurable configure() { + return new HDInsightManager.ConfigurableImpl(); + } + /** + * Creates an instance of HDInsightManager that exposes HDInsight resource management API entry points. + * + * @param credentials the credentials to use + * @param subscriptionId the subscription UUID + * @return the HDInsightManager + */ + public static HDInsightManager authenticate(AzureTokenCredentials credentials, String subscriptionId) { + return new HDInsightManager(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 HDInsightManager that exposes HDInsight resource management API entry points. + * + * @param restClient the RestClient to be used for API calls. + * @param subscriptionId the subscription UUID + * @return the HDInsightManager + */ + public static HDInsightManager authenticate(RestClient restClient, String subscriptionId) { + return new HDInsightManager(restClient, subscriptionId); + } + /** + * The interface allowing configurations to be set. + */ + public interface Configurable extends AzureConfigurable { + /** + * Creates an instance of HDInsightManager that exposes HDInsight management API entry points. + * + * @param credentials the credentials to use + * @param subscriptionId the subscription UUID + * @return the interface exposing HDInsight management API entry points that work across subscriptions + */ + HDInsightManager authenticate(AzureTokenCredentials credentials, String subscriptionId); + } + + /** + * @return Entry point to manage Clusters. + */ + public Clusters clusters() { + if (this.clusters == null) { + this.clusters = new ClustersImpl(this); + } + return this.clusters; + } + + /** + * @return Entry point to manage Applications. + */ + public Applications applications() { + if (this.applications == null) { + this.applications = new ApplicationsImpl(this); + } + return this.applications; + } + + /** + * @return Entry point to manage Locations. + */ + public Locations locations() { + if (this.locations == null) { + this.locations = new LocationsImpl(this); + } + return this.locations; + } + + /** + * @return Entry point to manage Configurations. + */ + public Configurations configurations() { + if (this.configurations == null) { + this.configurations = new ConfigurationsImpl(this); + } + return this.configurations; + } + + /** + * @return Entry point to manage Extensions. + */ + public Extensions extensions() { + if (this.extensions == null) { + this.extensions = new ExtensionsImpl(this); + } + return this.extensions; + } + + /** + * @return Entry point to manage ScriptActions. + */ + public ScriptActions scriptActions() { + if (this.scriptActions == null) { + this.scriptActions = new ScriptActionsImpl(this); + } + return this.scriptActions; + } + + /** + * @return Entry point to manage ScriptExecutionHistorys. + */ + public ScriptExecutionHistorys scriptExecutionHistorys() { + if (this.scriptExecutionHistorys == null) { + this.scriptExecutionHistorys = new ScriptExecutionHistorysImpl(this); + } + return this.scriptExecutionHistorys; + } + + /** + * @return Entry point to manage Operations. + */ + public Operations operations() { + if (this.operations == null) { + this.operations = new OperationsImpl(this); + } + return this.operations; + } + + /** + * The implementation for Configurable interface. + */ + private static final class ConfigurableImpl extends AzureConfigurableCoreImpl implements Configurable { + public HDInsightManager authenticate(AzureTokenCredentials credentials, String subscriptionId) { + return HDInsightManager.authenticate(buildRestClient(credentials), subscriptionId); + } + } + private HDInsightManager(RestClient restClient, String subscriptionId) { + super( + restClient, + subscriptionId, + new HDInsightManagementClientImpl(restClient).withSubscriptionId(subscriptionId)); + } +} diff --git a/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/IdParsingUtils.java b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/IdParsingUtils.java new file mode 100644 index 000000000000..2856ccff2ea3 --- /dev/null +++ b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/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.hdinsight.v2015_03_01_preview.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/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/LocationsImpl.java b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/LocationsImpl.java new file mode 100644 index 000000000000..5b4f1e0e8365 --- /dev/null +++ b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/LocationsImpl.java @@ -0,0 +1,55 @@ +/** + * 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.hdinsight.v2015_03_01_preview.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.hdinsight.v2015_03_01_preview.Locations; +import rx.functions.Func1; +import rx.Observable; +import com.microsoft.azure.management.hdinsight.v2015_03_01_preview.CapabilitiesResult; +import com.microsoft.azure.management.hdinsight.v2015_03_01_preview.UsagesListResult; + +class LocationsImpl extends WrapperImpl implements Locations { + private final HDInsightManager manager; + + LocationsImpl(HDInsightManager manager) { + super(manager.inner().locations()); + this.manager = manager; + } + + public HDInsightManager manager() { + return this.manager; + } + + @Override + public Observable getCapabilitiesAsync(String location) { + LocationsInner client = this.inner(); + return client.getCapabilitiesAsync(location) + .map(new Func1() { + @Override + public CapabilitiesResult call(CapabilitiesResultInner inner) { + return new CapabilitiesResultImpl(inner, manager()); + } + }); + } + + @Override + public Observable listUsagesAsync(String location) { + LocationsInner client = this.inner(); + return client.listUsagesAsync(location) + .map(new Func1() { + @Override + public UsagesListResult call(UsagesListResultInner inner) { + return new UsagesListResultImpl(inner, manager()); + } + }); + } + +} diff --git a/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/LocationsInner.java b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/LocationsInner.java new file mode 100644 index 000000000000..e63af6880216 --- /dev/null +++ b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/LocationsInner.java @@ -0,0 +1,222 @@ +/** + * 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.hdinsight.v2015_03_01_preview.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.management.hdinsight.v2015_03_01_preview.ErrorResponseException; +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 Locations. + */ +public class LocationsInner { + /** The Retrofit service to perform REST calls. */ + private LocationsService service; + /** The service client containing this operation class. */ + private HDInsightManagementClientImpl client; + + /** + * Initializes an instance of LocationsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public LocationsInner(Retrofit retrofit, HDInsightManagementClientImpl client) { + this.service = retrofit.create(LocationsService.class); + this.client = client; + } + + /** + * The interface defining all the services for Locations to be + * used by Retrofit to perform actually REST calls. + */ + interface LocationsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.hdinsight.v2015_03_01_preview.Locations getCapabilities" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.HDInsight/locations/{location}/capabilities") + Observable> getCapabilities(@Path("subscriptionId") String subscriptionId, @Path("location") String location, @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.hdinsight.v2015_03_01_preview.Locations listUsages" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.HDInsight/locations/{location}/usages") + Observable> listUsages(@Path("subscriptionId") String subscriptionId, @Path("location") String location, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Gets the capabilities for the specified location. + * + * @param location The location. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the CapabilitiesResultInner object if successful. + */ + public CapabilitiesResultInner getCapabilities(String location) { + return getCapabilitiesWithServiceResponseAsync(location).toBlocking().single().body(); + } + + /** + * Gets the capabilities for the specified location. + * + * @param location The location. + * @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 getCapabilitiesAsync(String location, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getCapabilitiesWithServiceResponseAsync(location), serviceCallback); + } + + /** + * Gets the capabilities for the specified location. + * + * @param location The location. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the CapabilitiesResultInner object + */ + public Observable getCapabilitiesAsync(String location) { + return getCapabilitiesWithServiceResponseAsync(location).map(new Func1, CapabilitiesResultInner>() { + @Override + public CapabilitiesResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the capabilities for the specified location. + * + * @param location The location. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the CapabilitiesResultInner object + */ + public Observable> getCapabilitiesWithServiceResponseAsync(String location) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (location == null) { + throw new IllegalArgumentException("Parameter location 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.getCapabilities(this.client.subscriptionId(), location, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getCapabilitiesDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getCapabilitiesDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Lists the usages for the specified location. + * + * @param location The location. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the UsagesListResultInner object if successful. + */ + public UsagesListResultInner listUsages(String location) { + return listUsagesWithServiceResponseAsync(location).toBlocking().single().body(); + } + + /** + * Lists the usages for the specified location. + * + * @param location The location. + * @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 listUsagesAsync(String location, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(listUsagesWithServiceResponseAsync(location), serviceCallback); + } + + /** + * Lists the usages for the specified location. + * + * @param location The location. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the UsagesListResultInner object + */ + public Observable listUsagesAsync(String location) { + return listUsagesWithServiceResponseAsync(location).map(new Func1, UsagesListResultInner>() { + @Override + public UsagesListResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Lists the usages for the specified location. + * + * @param location The location. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the UsagesListResultInner object + */ + public Observable> listUsagesWithServiceResponseAsync(String location) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (location == null) { + throw new IllegalArgumentException("Parameter location 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.listUsages(this.client.subscriptionId(), location, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = listUsagesDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse listUsagesDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + +} diff --git a/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/OperationImpl.java b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/OperationImpl.java new file mode 100644 index 000000000000..947b18f4bea8 --- /dev/null +++ b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/OperationImpl.java @@ -0,0 +1,37 @@ +/** + * 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.hdinsight.v2015_03_01_preview.implementation; + +import com.microsoft.azure.management.hdinsight.v2015_03_01_preview.Operation; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.hdinsight.v2015_03_01_preview.OperationDisplay; + +class OperationImpl extends WrapperImpl implements Operation { + private final HDInsightManager manager; + OperationImpl(OperationInner inner, HDInsightManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public HDInsightManager manager() { + return this.manager; + } + + @Override + public OperationDisplay display() { + return this.inner().display(); + } + + @Override + public String name() { + return this.inner().name(); + } + +} diff --git a/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/OperationInner.java b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/OperationInner.java new file mode 100644 index 000000000000..51a4daa9c93a --- /dev/null +++ b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/OperationInner.java @@ -0,0 +1,70 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2015_03_01_preview.implementation; + +import com.microsoft.azure.management.hdinsight.v2015_03_01_preview.OperationDisplay; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The HDInsight REST API operation. + */ +public class OperationInner { + /** + * The operation name: {provider}/{resource}/{operation}. + */ + @JsonProperty(value = "name") + private String name; + + /** + * The object that represents the operation. + */ + @JsonProperty(value = "display") + private OperationDisplay display; + + /** + * Get the operation name: {provider}/{resource}/{operation}. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the operation name: {provider}/{resource}/{operation}. + * + * @param name the name value to set + * @return the OperationInner object itself. + */ + public OperationInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get the object that represents the operation. + * + * @return the display value + */ + public OperationDisplay display() { + return this.display; + } + + /** + * Set the object that represents 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/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/OperationsImpl.java b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/OperationsImpl.java new file mode 100644 index 000000000000..f5b37e168ec3 --- /dev/null +++ b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/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.hdinsight.v2015_03_01_preview.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.hdinsight.v2015_03_01_preview.Operations; +import rx.functions.Func1; +import rx.Observable; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.hdinsight.v2015_03_01_preview.Operation; + +class OperationsImpl extends WrapperImpl implements Operations { + private final HDInsightManager manager; + + OperationsImpl(HDInsightManager manager) { + super(manager.inner().operations()); + this.manager = manager; + } + + public HDInsightManager 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/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/OperationsInner.java b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/OperationsInner.java new file mode 100644 index 000000000000..49444335200d --- /dev/null +++ b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/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.hdinsight.v2015_03_01_preview.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.hdinsight.v2015_03_01_preview.ErrorResponseException; +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 HDInsightManagementClientImpl 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, HDInsightManagementClientImpl 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.hdinsight.v2015_03_01_preview.Operations list" }) + @GET("providers/Microsoft.HDInsight/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.hdinsight.v2015_03_01_preview.Operations listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Lists all of the available HDInsight REST API operations. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException 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 HDInsight 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 HDInsight 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 HDInsight 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 HDInsight 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 ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Lists all of the available HDInsight REST API operations. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException 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 HDInsight 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 HDInsight 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 HDInsight 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 HDInsight 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 ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + +} diff --git a/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/PageImpl.java b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/PageImpl.java new file mode 100644 index 000000000000..e66c3d88145c --- /dev/null +++ b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/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.hdinsight.v2015_03_01_preview.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/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/RuntimeScriptActionDetailImpl.java b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/RuntimeScriptActionDetailImpl.java new file mode 100644 index 000000000000..e641b030b44e --- /dev/null +++ b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/RuntimeScriptActionDetailImpl.java @@ -0,0 +1,92 @@ +/** + * 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.hdinsight.v2015_03_01_preview.implementation; + +import com.microsoft.azure.management.hdinsight.v2015_03_01_preview.RuntimeScriptActionDetail; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import rx.Observable; +import java.util.List; +import com.microsoft.azure.management.hdinsight.v2015_03_01_preview.ScriptActionExecutionSummary; + +class RuntimeScriptActionDetailImpl extends WrapperImpl implements RuntimeScriptActionDetail { + private final HDInsightManager manager; + + RuntimeScriptActionDetailImpl(RuntimeScriptActionDetailInner inner, HDInsightManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public HDInsightManager manager() { + return this.manager; + } + + + + @Override + public String applicationName() { + return this.inner().applicationName(); + } + + @Override + public String debugInformation() { + return this.inner().debugInformation(); + } + + @Override + public String endTime() { + return this.inner().endTime(); + } + + @Override + public List executionSummary() { + return this.inner().executionSummary(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public String operation() { + return this.inner().operation(); + } + + @Override + public String parameters() { + return this.inner().parameters(); + } + + @Override + public List roles() { + return this.inner().roles(); + } + + @Override + public Long scriptExecutionId() { + return this.inner().scriptExecutionId(); + } + + @Override + public String startTime() { + return this.inner().startTime(); + } + + @Override + public String status() { + return this.inner().status(); + } + + @Override + public String uri() { + return this.inner().uri(); + } + +} diff --git a/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/RuntimeScriptActionDetailInner.java b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/RuntimeScriptActionDetailInner.java new file mode 100644 index 000000000000..6a3fe64a029a --- /dev/null +++ b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/RuntimeScriptActionDetailInner.java @@ -0,0 +1,125 @@ +/** + * 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.hdinsight.v2015_03_01_preview.implementation; + +import java.util.List; +import com.microsoft.azure.management.hdinsight.v2015_03_01_preview.ScriptActionExecutionSummary; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.azure.management.hdinsight.v2015_03_01_preview.RuntimeScriptAction; + +/** + * The execution details of a script action. + */ +public class RuntimeScriptActionDetailInner extends RuntimeScriptAction { + /** + * The execution id of the script action. + */ + @JsonProperty(value = "scriptExecutionId", access = JsonProperty.Access.WRITE_ONLY) + private Long scriptExecutionId; + + /** + * The start time of script action execution. + */ + @JsonProperty(value = "startTime", access = JsonProperty.Access.WRITE_ONLY) + private String startTime; + + /** + * The end time of script action execution. + */ + @JsonProperty(value = "endTime", access = JsonProperty.Access.WRITE_ONLY) + private String endTime; + + /** + * The current execution status of the script action. + */ + @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY) + private String status; + + /** + * The reason why the script action was executed. + */ + @JsonProperty(value = "operation", access = JsonProperty.Access.WRITE_ONLY) + private String operation; + + /** + * The summary of script action execution result. + */ + @JsonProperty(value = "executionSummary", access = JsonProperty.Access.WRITE_ONLY) + private List executionSummary; + + /** + * The script action execution debug information. + */ + @JsonProperty(value = "debugInformation", access = JsonProperty.Access.WRITE_ONLY) + private String debugInformation; + + /** + * Get the execution id of the script action. + * + * @return the scriptExecutionId value + */ + public Long scriptExecutionId() { + return this.scriptExecutionId; + } + + /** + * Get the start time of script action execution. + * + * @return the startTime value + */ + public String startTime() { + return this.startTime; + } + + /** + * Get the end time of script action execution. + * + * @return the endTime value + */ + public String endTime() { + return this.endTime; + } + + /** + * Get the current execution status of the script action. + * + * @return the status value + */ + public String status() { + return this.status; + } + + /** + * Get the reason why the script action was executed. + * + * @return the operation value + */ + public String operation() { + return this.operation; + } + + /** + * Get the summary of script action execution result. + * + * @return the executionSummary value + */ + public List executionSummary() { + return this.executionSummary; + } + + /** + * Get the script action execution debug information. + * + * @return the debugInformation value + */ + public String debugInformation() { + return this.debugInformation; + } + +} diff --git a/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/ScriptActionInner.java b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/ScriptActionInner.java new file mode 100644 index 000000000000..cd45286692fa --- /dev/null +++ b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/ScriptActionInner.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.hdinsight.v2015_03_01_preview.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Describes a script action on role on the cluster. + */ +public class ScriptActionInner { + /** + * The name of the script action. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /** + * The URI to the script. + */ + @JsonProperty(value = "uri", required = true) + private String uri; + + /** + * The parameters for the script provided. + */ + @JsonProperty(value = "parameters", required = true) + private String parameters; + + /** + * Get the name of the script action. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name of the script action. + * + * @param name the name value to set + * @return the ScriptActionInner object itself. + */ + public ScriptActionInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get the URI to the script. + * + * @return the uri value + */ + public String uri() { + return this.uri; + } + + /** + * Set the URI to the script. + * + * @param uri the uri value to set + * @return the ScriptActionInner object itself. + */ + public ScriptActionInner withUri(String uri) { + this.uri = uri; + return this; + } + + /** + * Get the parameters for the script provided. + * + * @return the parameters value + */ + public String parameters() { + return this.parameters; + } + + /** + * Set the parameters for the script provided. + * + * @param parameters the parameters value to set + * @return the ScriptActionInner object itself. + */ + public ScriptActionInner withParameters(String parameters) { + this.parameters = parameters; + return this; + } + +} diff --git a/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/ScriptActionsImpl.java b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/ScriptActionsImpl.java new file mode 100644 index 000000000000..19b74979ea12 --- /dev/null +++ b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/ScriptActionsImpl.java @@ -0,0 +1,72 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * + */ + +package com.microsoft.azure.management.hdinsight.v2015_03_01_preview.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.hdinsight.v2015_03_01_preview.ScriptActions; +import rx.Completable; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.hdinsight.v2015_03_01_preview.RuntimeScriptActionDetail; + +class ScriptActionsImpl extends WrapperImpl implements ScriptActions { + private final HDInsightManager manager; + + ScriptActionsImpl(HDInsightManager manager) { + super(manager.inner().scriptActions()); + this.manager = manager; + } + + public HDInsightManager manager() { + return this.manager; + } + + private RuntimeScriptActionDetailImpl wrapModel(RuntimeScriptActionDetailInner inner) { + return new RuntimeScriptActionDetailImpl(inner, manager()); + } + + @Override + public Observable listPersistedScriptsAsync(final String resourceGroupName, final String clusterName) { + ScriptActionsInner client = this.inner(); + return client.listPersistedScriptsAsync(resourceGroupName, clusterName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public RuntimeScriptActionDetail call(RuntimeScriptActionDetailInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Completable deleteAsync(String resourceGroupName, String clusterName, String scriptName) { + ScriptActionsInner client = this.inner(); + return client.deleteAsync(resourceGroupName, clusterName, scriptName).toCompletable(); + } + + @Override + public Observable getExecutionDetailAsync(String resourceGroupName, String clusterName, String scriptExecutionId) { + ScriptActionsInner client = this.inner(); + return client.getExecutionDetailAsync(resourceGroupName, clusterName, scriptExecutionId) + .map(new Func1() { + @Override + public RuntimeScriptActionDetail call(RuntimeScriptActionDetailInner inner) { + return new RuntimeScriptActionDetailImpl(inner, manager()); + } + }); + } + +} diff --git a/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/ScriptActionsInner.java b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/ScriptActionsInner.java new file mode 100644 index 000000000000..6e0f85951cab --- /dev/null +++ b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/ScriptActionsInner.java @@ -0,0 +1,498 @@ +/** + * 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.hdinsight.v2015_03_01_preview.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.hdinsight.v2015_03_01_preview.ErrorResponseException; +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 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.HTTP; +import retrofit2.http.Path; +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 ScriptActions. + */ +public class ScriptActionsInner { + /** The Retrofit service to perform REST calls. */ + private ScriptActionsService service; + /** The service client containing this operation class. */ + private HDInsightManagementClientImpl client; + + /** + * Initializes an instance of ScriptActionsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public ScriptActionsInner(Retrofit retrofit, HDInsightManagementClientImpl client) { + this.service = retrofit.create(ScriptActionsService.class); + this.client = client; + } + + /** + * The interface defining all the services for ScriptActions to be + * used by Retrofit to perform actually REST calls. + */ + interface ScriptActionsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.hdinsight.v2015_03_01_preview.ScriptActions delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/scriptActions/{scriptName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Path("scriptName") String scriptName, @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.hdinsight.v2015_03_01_preview.ScriptActions listPersistedScripts" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/scriptActions") + Observable> listPersistedScripts(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @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.hdinsight.v2015_03_01_preview.ScriptActions getExecutionDetail" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/scriptExecutionHistory/{scriptExecutionId}") + Observable> getExecutionDetail(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Path("scriptExecutionId") String scriptExecutionId, @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.hdinsight.v2015_03_01_preview.ScriptActions listPersistedScriptsNext" }) + @GET + Observable> listPersistedScriptsNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Deletes a specified persisted script action of the cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param scriptName The name of the script. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException 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 clusterName, String scriptName) { + deleteWithServiceResponseAsync(resourceGroupName, clusterName, scriptName).toBlocking().single().body(); + } + + /** + * Deletes a specified persisted script action of the cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param scriptName The name of the script. + * @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 clusterName, String scriptName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, clusterName, scriptName), serviceCallback); + } + + /** + * Deletes a specified persisted script action of the cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param scriptName The name of the script. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable deleteAsync(String resourceGroupName, String clusterName, String scriptName) { + return deleteWithServiceResponseAsync(resourceGroupName, clusterName, scriptName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes a specified persisted script action of the cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param scriptName The name of the script. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String clusterName, String scriptName) { + 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 (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName is required and cannot be null."); + } + if (scriptName == null) { + throw new IllegalArgumentException("Parameter scriptName 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.delete(this.client.subscriptionId(), resourceGroupName, clusterName, scriptName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = deleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse deleteDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Lists all the persisted script actions for the specified cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException 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<RuntimeScriptActionDetailInner> object if successful. + */ + public PagedList listPersistedScripts(final String resourceGroupName, final String clusterName) { + ServiceResponse> response = listPersistedScriptsSinglePageAsync(resourceGroupName, clusterName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listPersistedScriptsNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all the persisted script actions for the specified cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @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> listPersistedScriptsAsync(final String resourceGroupName, final String clusterName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listPersistedScriptsSinglePageAsync(resourceGroupName, clusterName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listPersistedScriptsNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all the persisted script actions for the specified cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<RuntimeScriptActionDetailInner> object + */ + public Observable> listPersistedScriptsAsync(final String resourceGroupName, final String clusterName) { + return listPersistedScriptsWithServiceResponseAsync(resourceGroupName, clusterName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all the persisted script actions for the specified cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<RuntimeScriptActionDetailInner> object + */ + public Observable>> listPersistedScriptsWithServiceResponseAsync(final String resourceGroupName, final String clusterName) { + return listPersistedScriptsSinglePageAsync(resourceGroupName, clusterName) + .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(listPersistedScriptsNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all the persisted script actions for the specified cluster. + * + ServiceResponse> * @param resourceGroupName The name of the resource group. + ServiceResponse> * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<RuntimeScriptActionDetailInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listPersistedScriptsSinglePageAsync(final String resourceGroupName, final String clusterName) { + 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 (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName 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.listPersistedScripts(this.client.subscriptionId(), resourceGroupName, clusterName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listPersistedScriptsDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listPersistedScriptsDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Gets the script execution detail for the given script execution ID. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param scriptExecutionId The script execution Id + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the RuntimeScriptActionDetailInner object if successful. + */ + public RuntimeScriptActionDetailInner getExecutionDetail(String resourceGroupName, String clusterName, String scriptExecutionId) { + return getExecutionDetailWithServiceResponseAsync(resourceGroupName, clusterName, scriptExecutionId).toBlocking().single().body(); + } + + /** + * Gets the script execution detail for the given script execution ID. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param scriptExecutionId The script execution Id + * @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 getExecutionDetailAsync(String resourceGroupName, String clusterName, String scriptExecutionId, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getExecutionDetailWithServiceResponseAsync(resourceGroupName, clusterName, scriptExecutionId), serviceCallback); + } + + /** + * Gets the script execution detail for the given script execution ID. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param scriptExecutionId The script execution Id + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the RuntimeScriptActionDetailInner object + */ + public Observable getExecutionDetailAsync(String resourceGroupName, String clusterName, String scriptExecutionId) { + return getExecutionDetailWithServiceResponseAsync(resourceGroupName, clusterName, scriptExecutionId).map(new Func1, RuntimeScriptActionDetailInner>() { + @Override + public RuntimeScriptActionDetailInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the script execution detail for the given script execution ID. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param scriptExecutionId The script execution Id + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the RuntimeScriptActionDetailInner object + */ + public Observable> getExecutionDetailWithServiceResponseAsync(String resourceGroupName, String clusterName, String scriptExecutionId) { + 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 (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName is required and cannot be null."); + } + if (scriptExecutionId == null) { + throw new IllegalArgumentException("Parameter scriptExecutionId 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.getExecutionDetail(this.client.subscriptionId(), resourceGroupName, clusterName, scriptExecutionId, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getExecutionDetailDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getExecutionDetailDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Lists all the persisted script actions for the specified cluster. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException 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<RuntimeScriptActionDetailInner> object if successful. + */ + public PagedList listPersistedScriptsNext(final String nextPageLink) { + ServiceResponse> response = listPersistedScriptsNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listPersistedScriptsNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all the persisted script actions for the specified cluster. + * + * @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> listPersistedScriptsNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listPersistedScriptsNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listPersistedScriptsNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all the persisted script actions for the specified cluster. + * + * @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<RuntimeScriptActionDetailInner> object + */ + public Observable> listPersistedScriptsNextAsync(final String nextPageLink) { + return listPersistedScriptsNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all the persisted script actions for the specified cluster. + * + * @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<RuntimeScriptActionDetailInner> object + */ + public Observable>> listPersistedScriptsNextWithServiceResponseAsync(final String nextPageLink) { + return listPersistedScriptsNextSinglePageAsync(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(listPersistedScriptsNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all the persisted script actions for the specified cluster. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<RuntimeScriptActionDetailInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listPersistedScriptsNextSinglePageAsync(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.listPersistedScriptsNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listPersistedScriptsNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listPersistedScriptsNextDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + +} diff --git a/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/ScriptExecutionHistorysImpl.java b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/ScriptExecutionHistorysImpl.java new file mode 100644 index 000000000000..b8850abe9e7c --- /dev/null +++ b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/ScriptExecutionHistorysImpl.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. + * abc + */ + +package com.microsoft.azure.management.hdinsight.v2015_03_01_preview.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.hdinsight.v2015_03_01_preview.ScriptExecutionHistorys; +import rx.Completable; +import rx.functions.Func1; +import rx.Observable; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.hdinsight.v2015_03_01_preview.RuntimeScriptActionDetail; + +class ScriptExecutionHistorysImpl extends WrapperImpl implements ScriptExecutionHistorys { + private final HDInsightManager manager; + + ScriptExecutionHistorysImpl(HDInsightManager manager) { + super(manager.inner().scriptExecutionHistorys()); + this.manager = manager; + } + + public HDInsightManager manager() { + return this.manager; + } + + @Override + public Observable listAsync(final String resourceGroupName, final String clusterName) { + ScriptExecutionHistorysInner client = this.inner(); + return client.listAsync(resourceGroupName, clusterName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public RuntimeScriptActionDetail call(RuntimeScriptActionDetailInner inner) { + return new RuntimeScriptActionDetailImpl(inner, manager()); + } + }); + } + + @Override + public Completable promoteAsync(String resourceGroupName, String clusterName, String scriptExecutionId) { + ScriptExecutionHistorysInner client = this.inner(); + return client.promoteAsync(resourceGroupName, clusterName, scriptExecutionId).toCompletable(); + } + +} diff --git a/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/ScriptExecutionHistorysInner.java b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/ScriptExecutionHistorysInner.java new file mode 100644 index 000000000000..2c9a861eb927 --- /dev/null +++ b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/ScriptExecutionHistorysInner.java @@ -0,0 +1,401 @@ +/** + * 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.hdinsight.v2015_03_01_preview.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.hdinsight.v2015_03_01_preview.ErrorResponseException; +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 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.Path; +import retrofit2.http.POST; +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 ScriptExecutionHistorys. + */ +public class ScriptExecutionHistorysInner { + /** The Retrofit service to perform REST calls. */ + private ScriptExecutionHistorysService service; + /** The service client containing this operation class. */ + private HDInsightManagementClientImpl client; + + /** + * Initializes an instance of ScriptExecutionHistorysInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public ScriptExecutionHistorysInner(Retrofit retrofit, HDInsightManagementClientImpl client) { + this.service = retrofit.create(ScriptExecutionHistorysService.class); + this.client = client; + } + + /** + * The interface defining all the services for ScriptExecutionHistorys to be + * used by Retrofit to perform actually REST calls. + */ + interface ScriptExecutionHistorysService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.hdinsight.v2015_03_01_preview.ScriptExecutionHistorys list" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/scriptExecutionHistory") + Observable> list(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @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.hdinsight.v2015_03_01_preview.ScriptExecutionHistorys promote" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/scriptExecutionHistory/{scriptExecutionId}/promote") + Observable> promote(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Path("scriptExecutionId") String scriptExecutionId, @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.hdinsight.v2015_03_01_preview.ScriptExecutionHistorys listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Lists all scripts' execution history for the specified cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException 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<RuntimeScriptActionDetailInner> object if successful. + */ + public PagedList list(final String resourceGroupName, final String clusterName) { + ServiceResponse> response = listSinglePageAsync(resourceGroupName, clusterName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all scripts' execution history for the specified cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @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 String resourceGroupName, final String clusterName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(resourceGroupName, clusterName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all scripts' execution history for the specified cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<RuntimeScriptActionDetailInner> object + */ + public Observable> listAsync(final String resourceGroupName, final String clusterName) { + return listWithServiceResponseAsync(resourceGroupName, clusterName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all scripts' execution history for the specified cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<RuntimeScriptActionDetailInner> object + */ + public Observable>> listWithServiceResponseAsync(final String resourceGroupName, final String clusterName) { + return listSinglePageAsync(resourceGroupName, clusterName) + .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 scripts' execution history for the specified cluster. + * + ServiceResponse> * @param resourceGroupName The name of the resource group. + ServiceResponse> * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<RuntimeScriptActionDetailInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync(final String resourceGroupName, final String clusterName) { + 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 (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName 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(), resourceGroupName, clusterName, 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 ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Promotes the specified ad-hoc script execution to a persisted script. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param scriptExecutionId The script execution Id + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void promote(String resourceGroupName, String clusterName, String scriptExecutionId) { + promoteWithServiceResponseAsync(resourceGroupName, clusterName, scriptExecutionId).toBlocking().single().body(); + } + + /** + * Promotes the specified ad-hoc script execution to a persisted script. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param scriptExecutionId The script execution Id + * @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 promoteAsync(String resourceGroupName, String clusterName, String scriptExecutionId, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(promoteWithServiceResponseAsync(resourceGroupName, clusterName, scriptExecutionId), serviceCallback); + } + + /** + * Promotes the specified ad-hoc script execution to a persisted script. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param scriptExecutionId The script execution Id + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable promoteAsync(String resourceGroupName, String clusterName, String scriptExecutionId) { + return promoteWithServiceResponseAsync(resourceGroupName, clusterName, scriptExecutionId).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Promotes the specified ad-hoc script execution to a persisted script. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param scriptExecutionId The script execution Id + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> promoteWithServiceResponseAsync(String resourceGroupName, String clusterName, String scriptExecutionId) { + 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 (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName is required and cannot be null."); + } + if (scriptExecutionId == null) { + throw new IllegalArgumentException("Parameter scriptExecutionId 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.promote(this.client.subscriptionId(), resourceGroupName, clusterName, scriptExecutionId, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = promoteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse promoteDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Lists all scripts' execution history for the specified cluster. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException 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<RuntimeScriptActionDetailInner> 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 scripts' execution history for the specified cluster. + * + * @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 scripts' execution history for the specified cluster. + * + * @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<RuntimeScriptActionDetailInner> 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 scripts' execution history for the specified cluster. + * + * @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<RuntimeScriptActionDetailInner> 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 scripts' execution history for the specified cluster. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<RuntimeScriptActionDetailInner> 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 ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + +} diff --git a/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/UsagesListResultImpl.java b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/UsagesListResultImpl.java new file mode 100644 index 000000000000..71aba83915c4 --- /dev/null +++ b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/UsagesListResultImpl.java @@ -0,0 +1,33 @@ +/** + * 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.hdinsight.v2015_03_01_preview.implementation; + +import com.microsoft.azure.management.hdinsight.v2015_03_01_preview.UsagesListResult; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import java.util.List; +import com.microsoft.azure.management.hdinsight.v2015_03_01_preview.Usage; + +class UsagesListResultImpl extends WrapperImpl implements UsagesListResult { + private final HDInsightManager manager; + UsagesListResultImpl(UsagesListResultInner inner, HDInsightManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public HDInsightManager manager() { + return this.manager; + } + + @Override + public List value() { + return this.inner().value(); + } + +} diff --git a/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/UsagesListResultInner.java b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/UsagesListResultInner.java new file mode 100644 index 000000000000..e602bd55ae96 --- /dev/null +++ b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/UsagesListResultInner.java @@ -0,0 +1,45 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2015_03_01_preview.implementation; + +import java.util.List; +import com.microsoft.azure.management.hdinsight.v2015_03_01_preview.Usage; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The response for the operation to get regional usages for a subscription. + */ +public class UsagesListResultInner { + /** + * The list of usages. + */ + @JsonProperty(value = "value") + private List value; + + /** + * Get the list of usages. + * + * @return the value value + */ + public List value() { + return this.value; + } + + /** + * Set the list of usages. + * + * @param value the value value to set + * @return the UsagesListResultInner object itself. + */ + public UsagesListResultInner withValue(List value) { + this.value = value; + return this; + } + +} diff --git a/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/package-info.java b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/package-info.java new file mode 100644 index 000000000000..60182e7fdfea --- /dev/null +++ b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/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 HDInsightManagementClient. + * HDInsight Management Client. + */ +package com.microsoft.azure.management.hdinsight.v2015_03_01_preview.implementation; diff --git a/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/package-info.java b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/package-info.java new file mode 100644 index 000000000000..d1cb0bfee0bc --- /dev/null +++ b/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/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 HDInsightManagementClient. + * HDInsight Management Client. + */ +package com.microsoft.azure.management.hdinsight.v2015_03_01_preview; diff --git a/hdinsight/resource-manager/v2018_06_01_preview/pom.xml b/hdinsight/resource-manager/v2018_06_01_preview/pom.xml new file mode 100644 index 000000000000..d2ac1eb29394 --- /dev/null +++ b/hdinsight/resource-manager/v2018_06_01_preview/pom.xml @@ -0,0 +1,133 @@ + + + 4.0.0 + com.microsoft.azure.hdinsight.v2018_06_01_preview + + com.microsoft.azure + azure-arm-parent + 0.0.2-beta + ../../../pom.xml + + azure-mgmt-hdinsight + 1.0.0-beta + jar + Microsoft Azure SDK for HDInsight Management + This package contains Microsoft HDInsight 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/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/Application.java b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/Application.java new file mode 100644 index 000000000000..7fc610fc6eb3 --- /dev/null +++ b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/Application.java @@ -0,0 +1,176 @@ +/** + * 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.hdinsight.v2018_06_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.hdinsight.v2018_06_01_preview.implementation.ApplicationInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.hdinsight.v2018_06_01_preview.implementation.HDInsightManager; +import java.util.Map; + +/** + * Type representing Application. + */ +public interface Application extends HasInner, Indexable, Refreshable, Updatable, HasManager { + /** + * @return the etag value. + */ + String etag(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the properties value. + */ + ApplicationProperties properties(); + + /** + * @return the tags value. + */ + Map tags(); + + /** + * @return the type value. + */ + String type(); + + /** + * The entirety of the Application definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithCluster, DefinitionStages.WithCreate { + } + + /** + * Grouping of Application definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a Application definition. + */ + interface Blank extends WithCluster { + } + + /** + * The stage of the application definition allowing to specify Cluster. + */ + interface WithCluster { + /** + * Specifies resourceGroupName, clusterName. + * @param resourceGroupName The name of the resource group + * @param clusterName The name of the cluster + * @return the next definition stage + */ + WithCreate withExistingCluster(String resourceGroupName, String clusterName); + } + + /** + * The stage of the application definition allowing to specify Etag. + */ + interface WithEtag { + /** + * Specifies etag. + * @param etag The ETag for the application + * @return the next definition stage + */ + WithCreate withEtag(String etag); + } + + /** + * The stage of the application definition allowing to specify Properties. + */ + interface WithProperties { + /** + * Specifies properties. + * @param properties The properties of the application + * @return the next definition stage + */ + WithCreate withProperties(ApplicationProperties properties); + } + + /** + * The stage of the application definition allowing to specify Tags. + */ + interface WithTags { + /** + * Specifies tags. + * @param tags The tags for the application + * @return the next definition stage + */ + WithCreate withTags(Map tags); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, DefinitionStages.WithEtag, DefinitionStages.WithProperties, DefinitionStages.WithTags { + } + } + /** + * The template for a Application update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, UpdateStages.WithEtag, UpdateStages.WithProperties, UpdateStages.WithTags { + } + + /** + * Grouping of Application update stages. + */ + interface UpdateStages { + /** + * The stage of the application update allowing to specify Etag. + */ + interface WithEtag { + /** + * Specifies etag. + * @param etag The ETag for the application + * @return the next update stage + */ + Update withEtag(String etag); + } + + /** + * The stage of the application update allowing to specify Properties. + */ + interface WithProperties { + /** + * Specifies properties. + * @param properties The properties of the application + * @return the next update stage + */ + Update withProperties(ApplicationProperties properties); + } + + /** + * The stage of the application update allowing to specify Tags. + */ + interface WithTags { + /** + * Specifies tags. + * @param tags The tags for the application + * @return the next update stage + */ + Update withTags(Map tags); + } + + } +} diff --git a/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/ApplicationGetEndpoint.java b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/ApplicationGetEndpoint.java new file mode 100644 index 000000000000..a3771c88b931 --- /dev/null +++ b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/ApplicationGetEndpoint.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.hdinsight.v2018_06_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Gets the application SSH endpoint. + */ +public class ApplicationGetEndpoint { + /** + * The location of the endpoint. + */ + @JsonProperty(value = "location") + private String location; + + /** + * The destination port to connect to. + */ + @JsonProperty(value = "destinationPort") + private Integer destinationPort; + + /** + * The public port to connect to. + */ + @JsonProperty(value = "publicPort") + private Integer publicPort; + + /** + * Get the location of the endpoint. + * + * @return the location value + */ + public String location() { + return this.location; + } + + /** + * Set the location of the endpoint. + * + * @param location the location value to set + * @return the ApplicationGetEndpoint object itself. + */ + public ApplicationGetEndpoint withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get the destination port to connect to. + * + * @return the destinationPort value + */ + public Integer destinationPort() { + return this.destinationPort; + } + + /** + * Set the destination port to connect to. + * + * @param destinationPort the destinationPort value to set + * @return the ApplicationGetEndpoint object itself. + */ + public ApplicationGetEndpoint withDestinationPort(Integer destinationPort) { + this.destinationPort = destinationPort; + return this; + } + + /** + * Get the public port to connect to. + * + * @return the publicPort value + */ + public Integer publicPort() { + return this.publicPort; + } + + /** + * Set the public port to connect to. + * + * @param publicPort the publicPort value to set + * @return the ApplicationGetEndpoint object itself. + */ + public ApplicationGetEndpoint withPublicPort(Integer publicPort) { + this.publicPort = publicPort; + return this; + } + +} diff --git a/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/ApplicationGetHttpsEndpoint.java b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/ApplicationGetHttpsEndpoint.java new file mode 100644 index 000000000000..e1b695a18cfa --- /dev/null +++ b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/ApplicationGetHttpsEndpoint.java @@ -0,0 +1,149 @@ +/** + * 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.hdinsight.v2018_06_01_preview; + +import java.util.Map; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Gets the application HTTP endpoints. + */ +public class ApplicationGetHttpsEndpoint { + /** + * Unmatched properties from the message are deserialized this collection. + */ + @JsonProperty(value = "") + private Map additionalProperties; + + /** + * The list of access modes for the application. + */ + @JsonProperty(value = "accessModes") + private List accessModes; + + /** + * The location of the endpoint. + */ + @JsonProperty(value = "location") + private String location; + + /** + * The destination port to connect to. + */ + @JsonProperty(value = "destinationPort") + private Integer destinationPort; + + /** + * The public port to connect to. + */ + @JsonProperty(value = "publicPort") + private Integer publicPort; + + /** + * Get unmatched properties from the message are deserialized this collection. + * + * @return the additionalProperties value + */ + public Map additionalProperties() { + return this.additionalProperties; + } + + /** + * Set unmatched properties from the message are deserialized this collection. + * + * @param additionalProperties the additionalProperties value to set + * @return the ApplicationGetHttpsEndpoint object itself. + */ + public ApplicationGetHttpsEndpoint withAdditionalProperties(Map additionalProperties) { + this.additionalProperties = additionalProperties; + return this; + } + + /** + * Get the list of access modes for the application. + * + * @return the accessModes value + */ + public List accessModes() { + return this.accessModes; + } + + /** + * Set the list of access modes for the application. + * + * @param accessModes the accessModes value to set + * @return the ApplicationGetHttpsEndpoint object itself. + */ + public ApplicationGetHttpsEndpoint withAccessModes(List accessModes) { + this.accessModes = accessModes; + return this; + } + + /** + * Get the location of the endpoint. + * + * @return the location value + */ + public String location() { + return this.location; + } + + /** + * Set the location of the endpoint. + * + * @param location the location value to set + * @return the ApplicationGetHttpsEndpoint object itself. + */ + public ApplicationGetHttpsEndpoint withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get the destination port to connect to. + * + * @return the destinationPort value + */ + public Integer destinationPort() { + return this.destinationPort; + } + + /** + * Set the destination port to connect to. + * + * @param destinationPort the destinationPort value to set + * @return the ApplicationGetHttpsEndpoint object itself. + */ + public ApplicationGetHttpsEndpoint withDestinationPort(Integer destinationPort) { + this.destinationPort = destinationPort; + return this; + } + + /** + * Get the public port to connect to. + * + * @return the publicPort value + */ + public Integer publicPort() { + return this.publicPort; + } + + /** + * Set the public port to connect to. + * + * @param publicPort the publicPort value to set + * @return the ApplicationGetHttpsEndpoint object itself. + */ + public ApplicationGetHttpsEndpoint withPublicPort(Integer publicPort) { + this.publicPort = publicPort; + return this; + } + +} diff --git a/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/ApplicationProperties.java b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/ApplicationProperties.java new file mode 100644 index 000000000000..d972ff281bc8 --- /dev/null +++ b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/ApplicationProperties.java @@ -0,0 +1,286 @@ +/** + * 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.hdinsight.v2018_06_01_preview; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The HDInsight cluster application GET response. + */ +public class ApplicationProperties { + /** + * The list of roles in the cluster. + */ + @JsonProperty(value = "computeProfile") + private ComputeProfile computeProfile; + + /** + * The list of install script actions. + */ + @JsonProperty(value = "installScriptActions") + private List installScriptActions; + + /** + * The list of uninstall script actions. + */ + @JsonProperty(value = "uninstallScriptActions") + private List uninstallScriptActions; + + /** + * The list of application HTTPS endpoints. + */ + @JsonProperty(value = "httpsEndpoints") + private List httpsEndpoints; + + /** + * The list of application SSH endpoints. + */ + @JsonProperty(value = "sshEndpoints") + private List sshEndpoints; + + /** + * The provisioning state of the application. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /** + * The application type. + */ + @JsonProperty(value = "applicationType") + private String applicationType; + + /** + * The application state. + */ + @JsonProperty(value = "applicationState", access = JsonProperty.Access.WRITE_ONLY) + private String applicationState; + + /** + * The list of errors. + */ + @JsonProperty(value = "errors") + private List errors; + + /** + * The application create date time. + */ + @JsonProperty(value = "createdDate", access = JsonProperty.Access.WRITE_ONLY) + private String createdDate; + + /** + * The marketplace identifier. + */ + @JsonProperty(value = "marketplaceIdentifier", access = JsonProperty.Access.WRITE_ONLY) + private String marketplaceIdentifier; + + /** + * The additional properties for application. + */ + @JsonProperty(value = "additionalProperties") + private String additionalProperties; + + /** + * Get the list of roles in the cluster. + * + * @return the computeProfile value + */ + public ComputeProfile computeProfile() { + return this.computeProfile; + } + + /** + * Set the list of roles in the cluster. + * + * @param computeProfile the computeProfile value to set + * @return the ApplicationProperties object itself. + */ + public ApplicationProperties withComputeProfile(ComputeProfile computeProfile) { + this.computeProfile = computeProfile; + return this; + } + + /** + * Get the list of install script actions. + * + * @return the installScriptActions value + */ + public List installScriptActions() { + return this.installScriptActions; + } + + /** + * Set the list of install script actions. + * + * @param installScriptActions the installScriptActions value to set + * @return the ApplicationProperties object itself. + */ + public ApplicationProperties withInstallScriptActions(List installScriptActions) { + this.installScriptActions = installScriptActions; + return this; + } + + /** + * Get the list of uninstall script actions. + * + * @return the uninstallScriptActions value + */ + public List uninstallScriptActions() { + return this.uninstallScriptActions; + } + + /** + * Set the list of uninstall script actions. + * + * @param uninstallScriptActions the uninstallScriptActions value to set + * @return the ApplicationProperties object itself. + */ + public ApplicationProperties withUninstallScriptActions(List uninstallScriptActions) { + this.uninstallScriptActions = uninstallScriptActions; + return this; + } + + /** + * Get the list of application HTTPS endpoints. + * + * @return the httpsEndpoints value + */ + public List httpsEndpoints() { + return this.httpsEndpoints; + } + + /** + * Set the list of application HTTPS endpoints. + * + * @param httpsEndpoints the httpsEndpoints value to set + * @return the ApplicationProperties object itself. + */ + public ApplicationProperties withHttpsEndpoints(List httpsEndpoints) { + this.httpsEndpoints = httpsEndpoints; + return this; + } + + /** + * Get the list of application SSH endpoints. + * + * @return the sshEndpoints value + */ + public List sshEndpoints() { + return this.sshEndpoints; + } + + /** + * Set the list of application SSH endpoints. + * + * @param sshEndpoints the sshEndpoints value to set + * @return the ApplicationProperties object itself. + */ + public ApplicationProperties withSshEndpoints(List sshEndpoints) { + this.sshEndpoints = sshEndpoints; + return this; + } + + /** + * Get the provisioning state of the application. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get the application type. + * + * @return the applicationType value + */ + public String applicationType() { + return this.applicationType; + } + + /** + * Set the application type. + * + * @param applicationType the applicationType value to set + * @return the ApplicationProperties object itself. + */ + public ApplicationProperties withApplicationType(String applicationType) { + this.applicationType = applicationType; + return this; + } + + /** + * Get the application state. + * + * @return the applicationState value + */ + public String applicationState() { + return this.applicationState; + } + + /** + * Get the list of errors. + * + * @return the errors value + */ + public List errors() { + return this.errors; + } + + /** + * Set the list of errors. + * + * @param errors the errors value to set + * @return the ApplicationProperties object itself. + */ + public ApplicationProperties withErrors(List errors) { + this.errors = errors; + return this; + } + + /** + * Get the application create date time. + * + * @return the createdDate value + */ + public String createdDate() { + return this.createdDate; + } + + /** + * Get the marketplace identifier. + * + * @return the marketplaceIdentifier value + */ + public String marketplaceIdentifier() { + return this.marketplaceIdentifier; + } + + /** + * Get the additional properties for application. + * + * @return the additionalProperties value + */ + public String additionalProperties() { + return this.additionalProperties; + } + + /** + * Set the additional properties for application. + * + * @param additionalProperties the additionalProperties value to set + * @return the ApplicationProperties object itself. + */ + public ApplicationProperties withAdditionalProperties(String additionalProperties) { + this.additionalProperties = additionalProperties; + return this; + } + +} diff --git a/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/Applications.java b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/Applications.java new file mode 100644 index 000000000000..27fd20f30e8e --- /dev/null +++ b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/Applications.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.hdinsight.v2018_06_01_preview; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import rx.Completable; +import rx.Observable; +import com.microsoft.azure.management.hdinsight.v2018_06_01_preview.implementation.ApplicationsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing Applications. + */ +public interface Applications extends SupportsCreating, HasInner { + /** + * Gets properties of the specified application. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param applicationName The constant value for the application name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String clusterName, String applicationName); + + /** + * Lists all of the applications for the HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listByClusterAsync(final String resourceGroupName, final String clusterName); + + /** + * Deletes the specified application on the HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param applicationName The constant value for the application name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable deleteAsync(String resourceGroupName, String clusterName, String applicationName); + +} diff --git a/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/AsyncOperationState.java b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/AsyncOperationState.java new file mode 100644 index 000000000000..d15444b92d76 --- /dev/null +++ b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/AsyncOperationState.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.hdinsight.v2018_06_01_preview; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for AsyncOperationState. + */ +public enum AsyncOperationState { + /** Enum value InProgress. */ + IN_PROGRESS("InProgress"), + + /** Enum value Succeeded. */ + SUCCEEDED("Succeeded"), + + /** Enum value Failed. */ + FAILED("Failed"); + + /** The actual serialized value for a AsyncOperationState instance. */ + private String value; + + AsyncOperationState(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a AsyncOperationState instance. + * + * @param value the serialized value to parse. + * @return the parsed AsyncOperationState object, or null if unable to parse. + */ + @JsonCreator + public static AsyncOperationState fromString(String value) { + AsyncOperationState[] items = AsyncOperationState.values(); + for (AsyncOperationState item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/Cluster.java b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/Cluster.java new file mode 100644 index 000000000000..5e864a4aa458 --- /dev/null +++ b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/Cluster.java @@ -0,0 +1,102 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2018_06_01_preview; + +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.hdinsight.v2018_06_01_preview.implementation.HDInsightManager; +import com.microsoft.azure.management.hdinsight.v2018_06_01_preview.implementation.ClusterInner; + +/** + * Type representing Cluster. + */ +public interface Cluster extends HasInner, Resource, GroupableResourceCore, HasResourceGroup, Refreshable, Updatable, HasManager { + /** + * @return the etag value. + */ + String etag(); + + /** + * @return the properties value. + */ + ClusterGetProperties properties(); + + /** + * The entirety of the Cluster definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithGroup, DefinitionStages.WithCreate { + } + + /** + * Grouping of Cluster definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a Cluster definition. + */ + interface Blank extends GroupableResourceCore.DefinitionWithRegion { + } + + /** + * The stage of the Cluster definition allowing to specify the resource group. + */ + interface WithGroup extends GroupableResourceCore.DefinitionStages.WithGroup { + } + + /** + * The stage of the cluster definition allowing to specify Properties. + */ + interface WithProperties { + /** + * Specifies properties. + * @param properties The cluster create parameters + * @return the next definition stage + */ + WithCreate withProperties(ClusterCreateProperties 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.WithProperties { + } + } + /** + * The template for a Cluster update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, Resource.UpdateWithTags, UpdateStages.WithProperties { + } + + /** + * Grouping of Cluster update stages. + */ + interface UpdateStages { + /** + * The stage of the cluster update allowing to specify Properties. + */ + interface WithProperties { + /** + * Specifies properties. + * @param properties The cluster create parameters + * @return the next update stage + */ + Update withProperties(ClusterCreateProperties properties); + } + + } +} diff --git a/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/ClusterCreateParametersExtended.java b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/ClusterCreateParametersExtended.java new file mode 100644 index 000000000000..6306676a11c3 --- /dev/null +++ b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/ClusterCreateParametersExtended.java @@ -0,0 +1,96 @@ +/** + * 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.hdinsight.v2018_06_01_preview; + +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The CreateCluster request parameters. + */ +public class ClusterCreateParametersExtended { + /** + * The location of the cluster. + */ + @JsonProperty(value = "location") + private String location; + + /** + * The resource tags. + */ + @JsonProperty(value = "tags") + private Map tags; + + /** + * The cluster create parameters. + */ + @JsonProperty(value = "properties") + private ClusterCreateProperties properties; + + /** + * Get the location of the cluster. + * + * @return the location value + */ + public String location() { + return this.location; + } + + /** + * Set the location of the cluster. + * + * @param location the location value to set + * @return the ClusterCreateParametersExtended object itself. + */ + public ClusterCreateParametersExtended withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get the resource tags. + * + * @return the tags value + */ + public Map tags() { + return this.tags; + } + + /** + * Set the resource tags. + * + * @param tags the tags value to set + * @return the ClusterCreateParametersExtended object itself. + */ + public ClusterCreateParametersExtended withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Get the cluster create parameters. + * + * @return the properties value + */ + public ClusterCreateProperties properties() { + return this.properties; + } + + /** + * Set the cluster create parameters. + * + * @param properties the properties value to set + * @return the ClusterCreateParametersExtended object itself. + */ + public ClusterCreateParametersExtended withProperties(ClusterCreateProperties properties) { + this.properties = properties; + return this; + } + +} diff --git a/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/ClusterCreateProperties.java b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/ClusterCreateProperties.java new file mode 100644 index 000000000000..f967ee308913 --- /dev/null +++ b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/ClusterCreateProperties.java @@ -0,0 +1,200 @@ +/** + * 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.hdinsight.v2018_06_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The cluster create parameters. + */ +public class ClusterCreateProperties { + /** + * The version of the cluster. + */ + @JsonProperty(value = "clusterVersion") + private String clusterVersion; + + /** + * The type of operating system. Possible values include: 'Windows', + * 'Linux'. + */ + @JsonProperty(value = "osType") + private OSType osType; + + /** + * The cluster tier. Possible values include: 'Standard', 'Premium'. + */ + @JsonProperty(value = "tier") + private Tier tier; + + /** + * The cluster definition. + */ + @JsonProperty(value = "clusterDefinition") + private ClusterDefinition clusterDefinition; + + /** + * The security profile. + */ + @JsonProperty(value = "securityProfile") + private SecurityProfile securityProfile; + + /** + * The compute profile. + */ + @JsonProperty(value = "computeProfile") + private ComputeProfile computeProfile; + + /** + * The storage profile. + */ + @JsonProperty(value = "storageProfile") + private StorageProfile storageProfile; + + /** + * Get the version of the cluster. + * + * @return the clusterVersion value + */ + public String clusterVersion() { + return this.clusterVersion; + } + + /** + * Set the version of the cluster. + * + * @param clusterVersion the clusterVersion value to set + * @return the ClusterCreateProperties object itself. + */ + public ClusterCreateProperties withClusterVersion(String clusterVersion) { + this.clusterVersion = clusterVersion; + return this; + } + + /** + * Get the type of operating system. Possible values include: 'Windows', 'Linux'. + * + * @return the osType value + */ + public OSType osType() { + return this.osType; + } + + /** + * Set the type of operating system. Possible values include: 'Windows', 'Linux'. + * + * @param osType the osType value to set + * @return the ClusterCreateProperties object itself. + */ + public ClusterCreateProperties withOsType(OSType osType) { + this.osType = osType; + return this; + } + + /** + * Get the cluster tier. Possible values include: 'Standard', 'Premium'. + * + * @return the tier value + */ + public Tier tier() { + return this.tier; + } + + /** + * Set the cluster tier. Possible values include: 'Standard', 'Premium'. + * + * @param tier the tier value to set + * @return the ClusterCreateProperties object itself. + */ + public ClusterCreateProperties withTier(Tier tier) { + this.tier = tier; + return this; + } + + /** + * Get the cluster definition. + * + * @return the clusterDefinition value + */ + public ClusterDefinition clusterDefinition() { + return this.clusterDefinition; + } + + /** + * Set the cluster definition. + * + * @param clusterDefinition the clusterDefinition value to set + * @return the ClusterCreateProperties object itself. + */ + public ClusterCreateProperties withClusterDefinition(ClusterDefinition clusterDefinition) { + this.clusterDefinition = clusterDefinition; + return this; + } + + /** + * Get the security profile. + * + * @return the securityProfile value + */ + public SecurityProfile securityProfile() { + return this.securityProfile; + } + + /** + * Set the security profile. + * + * @param securityProfile the securityProfile value to set + * @return the ClusterCreateProperties object itself. + */ + public ClusterCreateProperties withSecurityProfile(SecurityProfile securityProfile) { + this.securityProfile = securityProfile; + return this; + } + + /** + * Get the compute profile. + * + * @return the computeProfile value + */ + public ComputeProfile computeProfile() { + return this.computeProfile; + } + + /** + * Set the compute profile. + * + * @param computeProfile the computeProfile value to set + * @return the ClusterCreateProperties object itself. + */ + public ClusterCreateProperties withComputeProfile(ComputeProfile computeProfile) { + this.computeProfile = computeProfile; + return this; + } + + /** + * Get the storage profile. + * + * @return the storageProfile value + */ + public StorageProfile storageProfile() { + return this.storageProfile; + } + + /** + * Set the storage profile. + * + * @param storageProfile the storageProfile value to set + * @return the ClusterCreateProperties object itself. + */ + public ClusterCreateProperties withStorageProfile(StorageProfile storageProfile) { + this.storageProfile = storageProfile; + return this; + } + +} diff --git a/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/ClusterDefinition.java b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/ClusterDefinition.java new file mode 100644 index 000000000000..48f6fae40d26 --- /dev/null +++ b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/ClusterDefinition.java @@ -0,0 +1,122 @@ +/** + * 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.hdinsight.v2018_06_01_preview; + +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The cluster definition. + */ +public class ClusterDefinition { + /** + * The link to the blueprint. + */ + @JsonProperty(value = "blueprint") + private String blueprint; + + /** + * The type of cluster. + */ + @JsonProperty(value = "kind") + private String kind; + + /** + * The versions of different services in the cluster. + */ + @JsonProperty(value = "componentVersion") + private Map componentVersion; + + /** + * The cluster configurations. + */ + @JsonProperty(value = "configurations") + private Object configurations; + + /** + * Get the link to the blueprint. + * + * @return the blueprint value + */ + public String blueprint() { + return this.blueprint; + } + + /** + * Set the link to the blueprint. + * + * @param blueprint the blueprint value to set + * @return the ClusterDefinition object itself. + */ + public ClusterDefinition withBlueprint(String blueprint) { + this.blueprint = blueprint; + return this; + } + + /** + * Get the type of cluster. + * + * @return the kind value + */ + public String kind() { + return this.kind; + } + + /** + * Set the type of cluster. + * + * @param kind the kind value to set + * @return the ClusterDefinition object itself. + */ + public ClusterDefinition withKind(String kind) { + this.kind = kind; + return this; + } + + /** + * Get the versions of different services in the cluster. + * + * @return the componentVersion value + */ + public Map componentVersion() { + return this.componentVersion; + } + + /** + * Set the versions of different services in the cluster. + * + * @param componentVersion the componentVersion value to set + * @return the ClusterDefinition object itself. + */ + public ClusterDefinition withComponentVersion(Map componentVersion) { + this.componentVersion = componentVersion; + return this; + } + + /** + * Get the cluster configurations. + * + * @return the configurations value + */ + public Object configurations() { + return this.configurations; + } + + /** + * Set the cluster configurations. + * + * @param configurations the configurations value to set + * @return the ClusterDefinition object itself. + */ + public ClusterDefinition withConfigurations(Object configurations) { + this.configurations = configurations; + return this; + } + +} diff --git a/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/ClusterGetProperties.java b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/ClusterGetProperties.java new file mode 100644 index 000000000000..b525caac9090 --- /dev/null +++ b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/ClusterGetProperties.java @@ -0,0 +1,333 @@ +/** + * 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.hdinsight.v2018_06_01_preview; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The properties of cluster. + */ +public class ClusterGetProperties { + /** + * The version of the cluster. + */ + @JsonProperty(value = "clusterVersion") + private String clusterVersion; + + /** + * The type of operating system. Possible values include: 'Windows', + * 'Linux'. + */ + @JsonProperty(value = "osType") + private OSType osType; + + /** + * The cluster tier. Possible values include: 'Standard', 'Premium'. + */ + @JsonProperty(value = "tier") + private Tier tier; + + /** + * The cluster definition. + */ + @JsonProperty(value = "clusterDefinition", required = true) + private ClusterDefinition clusterDefinition; + + /** + * The security profile. + */ + @JsonProperty(value = "securityProfile") + private SecurityProfile securityProfile; + + /** + * The compute profile. + */ + @JsonProperty(value = "computeProfile") + private ComputeProfile computeProfile; + + /** + * The provisioning state, which only appears in the response. Possible + * values include: 'InProgress', 'Failed', 'Succeeded', 'Canceled', + * 'Deleting'. + */ + @JsonProperty(value = "provisioningState") + private HDInsightClusterProvisioningState provisioningState; + + /** + * The date on which the cluster was created. + */ + @JsonProperty(value = "createdDate") + private String createdDate; + + /** + * The state of the cluster. + */ + @JsonProperty(value = "clusterState") + private String clusterState; + + /** + * The quota information. + */ + @JsonProperty(value = "quotaInfo") + private QuotaInfo quotaInfo; + + /** + * The list of errors. + */ + @JsonProperty(value = "errors") + private List errors; + + /** + * The list of connectivity endpoints. + */ + @JsonProperty(value = "connectivityEndpoints") + private List connectivityEndpoints; + + /** + * Get the version of the cluster. + * + * @return the clusterVersion value + */ + public String clusterVersion() { + return this.clusterVersion; + } + + /** + * Set the version of the cluster. + * + * @param clusterVersion the clusterVersion value to set + * @return the ClusterGetProperties object itself. + */ + public ClusterGetProperties withClusterVersion(String clusterVersion) { + this.clusterVersion = clusterVersion; + return this; + } + + /** + * Get the type of operating system. Possible values include: 'Windows', 'Linux'. + * + * @return the osType value + */ + public OSType osType() { + return this.osType; + } + + /** + * Set the type of operating system. Possible values include: 'Windows', 'Linux'. + * + * @param osType the osType value to set + * @return the ClusterGetProperties object itself. + */ + public ClusterGetProperties withOsType(OSType osType) { + this.osType = osType; + return this; + } + + /** + * Get the cluster tier. Possible values include: 'Standard', 'Premium'. + * + * @return the tier value + */ + public Tier tier() { + return this.tier; + } + + /** + * Set the cluster tier. Possible values include: 'Standard', 'Premium'. + * + * @param tier the tier value to set + * @return the ClusterGetProperties object itself. + */ + public ClusterGetProperties withTier(Tier tier) { + this.tier = tier; + return this; + } + + /** + * Get the cluster definition. + * + * @return the clusterDefinition value + */ + public ClusterDefinition clusterDefinition() { + return this.clusterDefinition; + } + + /** + * Set the cluster definition. + * + * @param clusterDefinition the clusterDefinition value to set + * @return the ClusterGetProperties object itself. + */ + public ClusterGetProperties withClusterDefinition(ClusterDefinition clusterDefinition) { + this.clusterDefinition = clusterDefinition; + return this; + } + + /** + * Get the security profile. + * + * @return the securityProfile value + */ + public SecurityProfile securityProfile() { + return this.securityProfile; + } + + /** + * Set the security profile. + * + * @param securityProfile the securityProfile value to set + * @return the ClusterGetProperties object itself. + */ + public ClusterGetProperties withSecurityProfile(SecurityProfile securityProfile) { + this.securityProfile = securityProfile; + return this; + } + + /** + * Get the compute profile. + * + * @return the computeProfile value + */ + public ComputeProfile computeProfile() { + return this.computeProfile; + } + + /** + * Set the compute profile. + * + * @param computeProfile the computeProfile value to set + * @return the ClusterGetProperties object itself. + */ + public ClusterGetProperties withComputeProfile(ComputeProfile computeProfile) { + this.computeProfile = computeProfile; + return this; + } + + /** + * Get the provisioning state, which only appears in the response. Possible values include: 'InProgress', 'Failed', 'Succeeded', 'Canceled', 'Deleting'. + * + * @return the provisioningState value + */ + public HDInsightClusterProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Set the provisioning state, which only appears in the response. Possible values include: 'InProgress', 'Failed', 'Succeeded', 'Canceled', 'Deleting'. + * + * @param provisioningState the provisioningState value to set + * @return the ClusterGetProperties object itself. + */ + public ClusterGetProperties withProvisioningState(HDInsightClusterProvisioningState provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * Get the date on which the cluster was created. + * + * @return the createdDate value + */ + public String createdDate() { + return this.createdDate; + } + + /** + * Set the date on which the cluster was created. + * + * @param createdDate the createdDate value to set + * @return the ClusterGetProperties object itself. + */ + public ClusterGetProperties withCreatedDate(String createdDate) { + this.createdDate = createdDate; + return this; + } + + /** + * Get the state of the cluster. + * + * @return the clusterState value + */ + public String clusterState() { + return this.clusterState; + } + + /** + * Set the state of the cluster. + * + * @param clusterState the clusterState value to set + * @return the ClusterGetProperties object itself. + */ + public ClusterGetProperties withClusterState(String clusterState) { + this.clusterState = clusterState; + return this; + } + + /** + * Get the quota information. + * + * @return the quotaInfo value + */ + public QuotaInfo quotaInfo() { + return this.quotaInfo; + } + + /** + * Set the quota information. + * + * @param quotaInfo the quotaInfo value to set + * @return the ClusterGetProperties object itself. + */ + public ClusterGetProperties withQuotaInfo(QuotaInfo quotaInfo) { + this.quotaInfo = quotaInfo; + return this; + } + + /** + * Get the list of errors. + * + * @return the errors value + */ + public List errors() { + return this.errors; + } + + /** + * Set the list of errors. + * + * @param errors the errors value to set + * @return the ClusterGetProperties object itself. + */ + public ClusterGetProperties withErrors(List errors) { + this.errors = errors; + return this; + } + + /** + * Get the list of connectivity endpoints. + * + * @return the connectivityEndpoints value + */ + public List connectivityEndpoints() { + return this.connectivityEndpoints; + } + + /** + * Set the list of connectivity endpoints. + * + * @param connectivityEndpoints the connectivityEndpoints value to set + * @return the ClusterGetProperties object itself. + */ + public ClusterGetProperties withConnectivityEndpoints(List connectivityEndpoints) { + this.connectivityEndpoints = connectivityEndpoints; + return this; + } + +} diff --git a/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/ClusterListPersistedScriptActionsResult.java b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/ClusterListPersistedScriptActionsResult.java new file mode 100644 index 000000000000..87ab2bcbb8fb --- /dev/null +++ b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/ClusterListPersistedScriptActionsResult.java @@ -0,0 +1,59 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2018_06_01_preview; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The ListPersistedScriptActions operation response. + */ +public class ClusterListPersistedScriptActionsResult { + /** + * The list of Persisted Script Actions. + */ + @JsonProperty(value = "value") + private List value; + + /** + * The link (url) to the next page of results. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get the list of Persisted Script Actions. + * + * @return the value value + */ + public List value() { + return this.value; + } + + /** + * Set the list of Persisted Script Actions. + * + * @param value the value value to set + * @return the ClusterListPersistedScriptActionsResult object itself. + */ + public ClusterListPersistedScriptActionsResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the link (url) to the next page of results. + * + * @return the nextLink value + */ + public String nextLink() { + return this.nextLink; + } + +} diff --git a/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/ClusterListRuntimeScriptActionDetailResult.java b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/ClusterListRuntimeScriptActionDetailResult.java new file mode 100644 index 000000000000..cc0c1a0b7b32 --- /dev/null +++ b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/ClusterListRuntimeScriptActionDetailResult.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. + */ + +package com.microsoft.azure.management.hdinsight.v2018_06_01_preview; + +import java.util.List; +import com.microsoft.azure.management.hdinsight.v2018_06_01_preview.implementation.RuntimeScriptActionDetailInner; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The list runtime script action detail response. + */ +public class ClusterListRuntimeScriptActionDetailResult { + /** + * The list of persisted script action details for the cluster. + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private List value; + + /** + * The link (url) to the next page of results. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get the list of persisted script action details for the cluster. + * + * @return the value value + */ + public List value() { + return this.value; + } + + /** + * Get the link (url) to the next page of results. + * + * @return the nextLink value + */ + public String nextLink() { + return this.nextLink; + } + +} diff --git a/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/ClusterMonitoringRequest.java b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/ClusterMonitoringRequest.java new file mode 100644 index 000000000000..77e27b00f9be --- /dev/null +++ b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/ClusterMonitoringRequest.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.hdinsight.v2018_06_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The Operations Management Suite (OMS) parameters. + */ +public class ClusterMonitoringRequest { + /** + * The Operations Management Suite (OMS) workspace ID. + */ + @JsonProperty(value = "workspaceId") + private String workspaceId; + + /** + * The Operations Management Suite (OMS) workspace key. + */ + @JsonProperty(value = "primaryKey") + private String primaryKey; + + /** + * Get the Operations Management Suite (OMS) workspace ID. + * + * @return the workspaceId value + */ + public String workspaceId() { + return this.workspaceId; + } + + /** + * Set the Operations Management Suite (OMS) workspace ID. + * + * @param workspaceId the workspaceId value to set + * @return the ClusterMonitoringRequest object itself. + */ + public ClusterMonitoringRequest withWorkspaceId(String workspaceId) { + this.workspaceId = workspaceId; + return this; + } + + /** + * Get the Operations Management Suite (OMS) workspace key. + * + * @return the primaryKey value + */ + public String primaryKey() { + return this.primaryKey; + } + + /** + * Set the Operations Management Suite (OMS) workspace key. + * + * @param primaryKey the primaryKey value to set + * @return the ClusterMonitoringRequest object itself. + */ + public ClusterMonitoringRequest withPrimaryKey(String primaryKey) { + this.primaryKey = primaryKey; + return this; + } + +} diff --git a/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/ClusterMonitoringResponse.java b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/ClusterMonitoringResponse.java new file mode 100644 index 000000000000..c6b15526e837 --- /dev/null +++ b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/ClusterMonitoringResponse.java @@ -0,0 +1,30 @@ +/** + * 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.hdinsight.v2018_06_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.hdinsight.v2018_06_01_preview.implementation.HDInsightManager; +import com.microsoft.azure.management.hdinsight.v2018_06_01_preview.implementation.ClusterMonitoringResponseInner; + +/** + * Type representing ClusterMonitoringResponse. + */ +public interface ClusterMonitoringResponse extends HasInner, HasManager { + /** + * @return the clusterMonitoringEnabled value. + */ + Boolean clusterMonitoringEnabled(); + + /** + * @return the workspaceId value. + */ + String workspaceId(); + +} diff --git a/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/ClusterPatchParameters.java b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/ClusterPatchParameters.java new file mode 100644 index 000000000000..30a8276ae0ba --- /dev/null +++ b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/ClusterPatchParameters.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.hdinsight.v2018_06_01_preview; + +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The PatchCluster request parameters. + */ +public class ClusterPatchParameters { + /** + * The resource tags. + */ + @JsonProperty(value = "tags") + private Map tags; + + /** + * Get the resource tags. + * + * @return the tags value + */ + public Map tags() { + return this.tags; + } + + /** + * Set the resource tags. + * + * @param tags the tags value to set + * @return the ClusterPatchParameters object itself. + */ + public ClusterPatchParameters withTags(Map tags) { + this.tags = tags; + return this; + } + +} diff --git a/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/ClusterResizeParameters.java b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/ClusterResizeParameters.java new file mode 100644 index 000000000000..5efc84f3dac7 --- /dev/null +++ b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/ClusterResizeParameters.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.hdinsight.v2018_06_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The Resize Cluster request parameters. + */ +public class ClusterResizeParameters { + /** + * The target instance count for the operation. + */ + @JsonProperty(value = "targetInstanceCount") + private Integer targetInstanceCount; + + /** + * Get the target instance count for the operation. + * + * @return the targetInstanceCount value + */ + public Integer targetInstanceCount() { + return this.targetInstanceCount; + } + + /** + * Set the target instance count for the operation. + * + * @param targetInstanceCount the targetInstanceCount value to set + * @return the ClusterResizeParameters object itself. + */ + public ClusterResizeParameters withTargetInstanceCount(Integer targetInstanceCount) { + this.targetInstanceCount = targetInstanceCount; + return this; + } + +} diff --git a/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/Clusters.java b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/Clusters.java new file mode 100644 index 000000000000..0fad80b77e2e --- /dev/null +++ b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/Clusters.java @@ -0,0 +1,47 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2018_06_01_preview; + +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 rx.Completable; +import com.microsoft.azure.management.hdinsight.v2018_06_01_preview.implementation.ClustersInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing Clusters. + */ +public interface Clusters extends SupportsCreating, SupportsDeletingByResourceGroup, SupportsBatchDeletion, SupportsGettingByResourceGroup, SupportsListingByResourceGroup, SupportsListing, HasInner { + /** + * Executes script actions on the specified HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param parameters The parameters for executing script actions. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable executeScriptActionsAsync(String resourceGroupName, String clusterName, ExecuteScriptActionParameters parameters); + + /** + * Resizes the specified HDInsight cluster to the specified size. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable resizeAsync(String resourceGroupName, String clusterName); + +} diff --git a/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/ComputeProfile.java b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/ComputeProfile.java new file mode 100644 index 000000000000..ce0cf6674e13 --- /dev/null +++ b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/ComputeProfile.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.hdinsight.v2018_06_01_preview; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Describes the compute profile. + */ +public class ComputeProfile { + /** + * The list of roles in the cluster. + */ + @JsonProperty(value = "roles") + private List roles; + + /** + * Get the list of roles in the cluster. + * + * @return the roles value + */ + public List roles() { + return this.roles; + } + + /** + * Set the list of roles in the cluster. + * + * @param roles the roles value to set + * @return the ComputeProfile object itself. + */ + public ComputeProfile withRoles(List roles) { + this.roles = roles; + return this; + } + +} diff --git a/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/Configurations.java b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/Configurations.java new file mode 100644 index 000000000000..f27abe392cf7 --- /dev/null +++ b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/Configurations.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.hdinsight.v2018_06_01_preview; + +import rx.Completable; +import rx.Observable; +import java.util.Map; +import com.microsoft.azure.management.hdinsight.v2018_06_01_preview.implementation.ConfigurationsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing Configurations. + */ +public interface Configurations extends HasInner { + /** + * Configures the configuration on the specified cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param configurationName The name of the cluster configuration. + * @param parameters The cluster configurations. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable updateAsync(String resourceGroupName, String clusterName, String configurationName, Map parameters); + + /** + * The configuration object for the specified cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param configurationName The name of the cluster configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable> getAsync(String resourceGroupName, String clusterName, String configurationName); + +} diff --git a/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/ConnectivityEndpoint.java b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/ConnectivityEndpoint.java new file mode 100644 index 000000000000..7cb964559116 --- /dev/null +++ b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/ConnectivityEndpoint.java @@ -0,0 +1,121 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2018_06_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The connectivity properties. + */ +public class ConnectivityEndpoint { + /** + * The name of the endpoint. + */ + @JsonProperty(value = "name") + private String name; + + /** + * The protocol of the endpoint. + */ + @JsonProperty(value = "protocol") + private String protocol; + + /** + * The location of the endpoint. + */ + @JsonProperty(value = "location") + private String location; + + /** + * The port to connect to. + */ + @JsonProperty(value = "port") + private Integer port; + + /** + * Get the name of the endpoint. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name of the endpoint. + * + * @param name the name value to set + * @return the ConnectivityEndpoint object itself. + */ + public ConnectivityEndpoint withName(String name) { + this.name = name; + return this; + } + + /** + * Get the protocol of the endpoint. + * + * @return the protocol value + */ + public String protocol() { + return this.protocol; + } + + /** + * Set the protocol of the endpoint. + * + * @param protocol the protocol value to set + * @return the ConnectivityEndpoint object itself. + */ + public ConnectivityEndpoint withProtocol(String protocol) { + this.protocol = protocol; + return this; + } + + /** + * Get the location of the endpoint. + * + * @return the location value + */ + public String location() { + return this.location; + } + + /** + * Set the location of the endpoint. + * + * @param location the location value to set + * @return the ConnectivityEndpoint object itself. + */ + public ConnectivityEndpoint withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get the port to connect to. + * + * @return the port value + */ + public Integer port() { + return this.port; + } + + /** + * Set the port to connect to. + * + * @param port the port value to set + * @return the ConnectivityEndpoint object itself. + */ + public ConnectivityEndpoint withPort(Integer port) { + this.port = port; + return this; + } + +} diff --git a/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/DataDisksGroups.java b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/DataDisksGroups.java new file mode 100644 index 000000000000..f975761fdd8c --- /dev/null +++ b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/DataDisksGroups.java @@ -0,0 +1,73 @@ +/** + * 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.hdinsight.v2018_06_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The data disks groups for the role. + */ +public class DataDisksGroups { + /** + * The number of disks per node. + */ + @JsonProperty(value = "disksPerNode") + private Integer disksPerNode; + + /** + * ReadOnly. The storage account type. Do not set this value. + */ + @JsonProperty(value = "storageAccountType", access = JsonProperty.Access.WRITE_ONLY) + private String storageAccountType; + + /** + * ReadOnly. The DiskSize in GB. Do not set this value. + */ + @JsonProperty(value = "diskSizeGB", access = JsonProperty.Access.WRITE_ONLY) + private Integer diskSizeGB; + + /** + * Get the number of disks per node. + * + * @return the disksPerNode value + */ + public Integer disksPerNode() { + return this.disksPerNode; + } + + /** + * Set the number of disks per node. + * + * @param disksPerNode the disksPerNode value to set + * @return the DataDisksGroups object itself. + */ + public DataDisksGroups withDisksPerNode(Integer disksPerNode) { + this.disksPerNode = disksPerNode; + return this; + } + + /** + * Get readOnly. The storage account type. Do not set this value. + * + * @return the storageAccountType value + */ + public String storageAccountType() { + return this.storageAccountType; + } + + /** + * Get readOnly. The DiskSize in GB. Do not set this value. + * + * @return the diskSizeGB value + */ + public Integer diskSizeGB() { + return this.diskSizeGB; + } + +} diff --git a/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/DirectoryType.java b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/DirectoryType.java new file mode 100644 index 000000000000..0597245dec98 --- /dev/null +++ b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/DirectoryType.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.hdinsight.v2018_06_01_preview; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for DirectoryType. + */ +public enum DirectoryType { + /** Enum value ActiveDirectory. */ + ACTIVE_DIRECTORY("ActiveDirectory"); + + /** The actual serialized value for a DirectoryType instance. */ + private String value; + + DirectoryType(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a DirectoryType instance. + * + * @param value the serialized value to parse. + * @return the parsed DirectoryType object, or null if unable to parse. + */ + @JsonCreator + public static DirectoryType fromString(String value) { + DirectoryType[] items = DirectoryType.values(); + for (DirectoryType item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/ErrorResponse.java b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/ErrorResponse.java new file mode 100644 index 000000000000..2b6507868aa0 --- /dev/null +++ b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/ErrorResponse.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.hdinsight.v2018_06_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Describes the format of Error response. + */ +public class ErrorResponse { + /** + * Error code. + */ + @JsonProperty(value = "code") + private String code; + + /** + * Error message indicating why the operation failed. + */ + @JsonProperty(value = "message") + private String message; + + /** + * Get error code. + * + * @return the code value + */ + public String code() { + return this.code; + } + + /** + * Set error code. + * + * @param code the code value to set + * @return the ErrorResponse object itself. + */ + public ErrorResponse withCode(String code) { + this.code = code; + return this; + } + + /** + * Get error message indicating why the operation failed. + * + * @return the message value + */ + public String message() { + return this.message; + } + + /** + * Set error message indicating why the operation failed. + * + * @param message the message value to set + * @return the ErrorResponse object itself. + */ + public ErrorResponse withMessage(String message) { + this.message = message; + return this; + } + +} diff --git a/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/ErrorResponseException.java b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/ErrorResponseException.java new file mode 100644 index 000000000000..6772ecfd0e0c --- /dev/null +++ b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/ErrorResponseException.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.hdinsight.v2018_06_01_preview; + +import com.microsoft.rest.RestException; +import okhttp3.ResponseBody; +import retrofit2.Response; + +/** + * Exception thrown for an invalid response with ErrorResponse information. + */ +public class ErrorResponseException extends RestException { + /** + * Initializes a new instance of the ErrorResponseException class. + * + * @param message the exception message or the response content if a message is not available + * @param response the HTTP response + */ + public ErrorResponseException(final String message, final Response response) { + super(message, response); + } + + /** + * Initializes a new instance of the ErrorResponseException 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 ErrorResponseException(final String message, final Response response, final ErrorResponse body) { + super(message, response, body); + } + + @Override + public ErrorResponse body() { + return (ErrorResponse) super.body(); + } +} diff --git a/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/Errors.java b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/Errors.java new file mode 100644 index 000000000000..522a027ccc3d --- /dev/null +++ b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/Errors.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.hdinsight.v2018_06_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The error message associated with the cluster creation. + */ +public class Errors { + /** + * The error code. + */ + @JsonProperty(value = "code") + private String code; + + /** + * The error message. + */ + @JsonProperty(value = "message") + private String message; + + /** + * Get the error code. + * + * @return the code value + */ + public String code() { + return this.code; + } + + /** + * Set the error code. + * + * @param code the code value to set + * @return the Errors object itself. + */ + public Errors withCode(String code) { + this.code = code; + return this; + } + + /** + * Get the error message. + * + * @return the message value + */ + public String message() { + return this.message; + } + + /** + * Set the error message. + * + * @param message the message value to set + * @return the Errors object itself. + */ + public Errors withMessage(String message) { + this.message = message; + return this; + } + +} diff --git a/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/ExecuteScriptActionParameters.java b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/ExecuteScriptActionParameters.java new file mode 100644 index 000000000000..26bd5a20fbe2 --- /dev/null +++ b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/ExecuteScriptActionParameters.java @@ -0,0 +1,70 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2018_06_01_preview; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The parameters for the script actions to execute on a running cluster. + */ +public class ExecuteScriptActionParameters { + /** + * The list of run time script actions. + */ + @JsonProperty(value = "scriptActions") + private List scriptActions; + + /** + * Gets or sets if the scripts needs to be persisted. + */ + @JsonProperty(value = "persistOnSuccess", required = true) + private boolean persistOnSuccess; + + /** + * Get the list of run time script actions. + * + * @return the scriptActions value + */ + public List scriptActions() { + return this.scriptActions; + } + + /** + * Set the list of run time script actions. + * + * @param scriptActions the scriptActions value to set + * @return the ExecuteScriptActionParameters object itself. + */ + public ExecuteScriptActionParameters withScriptActions(List scriptActions) { + this.scriptActions = scriptActions; + return this; + } + + /** + * Get gets or sets if the scripts needs to be persisted. + * + * @return the persistOnSuccess value + */ + public boolean persistOnSuccess() { + return this.persistOnSuccess; + } + + /** + * Set gets or sets if the scripts needs to be persisted. + * + * @param persistOnSuccess the persistOnSuccess value to set + * @return the ExecuteScriptActionParameters object itself. + */ + public ExecuteScriptActionParameters withPersistOnSuccess(boolean persistOnSuccess) { + this.persistOnSuccess = persistOnSuccess; + return this; + } + +} diff --git a/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/Extension.java b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/Extension.java new file mode 100644 index 000000000000..90af69d8daaa --- /dev/null +++ b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/Extension.java @@ -0,0 +1,30 @@ +/** + * 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.hdinsight.v2018_06_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.hdinsight.v2018_06_01_preview.implementation.ExtensionInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.hdinsight.v2018_06_01_preview.implementation.HDInsightManager; + +/** + * Type representing Extension. + */ +public interface Extension extends HasInner, HasManager { + /** + * @return the primaryKey value. + */ + String primaryKey(); + + /** + * @return the workspaceId value. + */ + String workspaceId(); + +} diff --git a/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/Extensions.java b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/Extensions.java new file mode 100644 index 000000000000..ec2c5d25793e --- /dev/null +++ b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/Extensions.java @@ -0,0 +1,86 @@ +/** + * 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.hdinsight.v2018_06_01_preview; + +import rx.Completable; +import rx.Observable; +import com.microsoft.azure.management.hdinsight.v2018_06_01_preview.implementation.ExtensionsInner; +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.hdinsight.v2018_06_01_preview.implementation.ExtensionInner; + +/** + * Type representing Extensions. + */ +public interface Extensions extends HasInner { + /** + * Gets the status of Operations Management Suite (OMS) on the HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getMonitoringStatusAsync(String resourceGroupName, String clusterName); + + /** + * Disables the Operations Management Suite (OMS) on the HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable disableMonitoringAsync(String resourceGroupName, String clusterName); + + /** + * Gets the extension properties for the specified HDInsight cluster extension. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param extensionName The name of the cluster extension. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String clusterName, String extensionName); + + /** + * Deletes the specified extension for HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param extensionName The name of the cluster extension. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable deleteAsync(String resourceGroupName, String clusterName, String extensionName); + + /** + * Enables the Operations Management Suite (OMS) on the HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param parameters The Operations Management Suite (OMS) workspace parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable enableMonitoringAsync(String resourceGroupName, String clusterName, ClusterMonitoringRequest parameters); + + /** + * Creates an HDInsight cluster extension. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param extensionName The name of the cluster extension. + * @param parameters The cluster extensions create request. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable createAsync(String resourceGroupName, String clusterName, String extensionName, ExtensionInner parameters); + +} diff --git a/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/HDInsightClusterProvisioningState.java b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/HDInsightClusterProvisioningState.java new file mode 100644 index 000000000000..0f507416b60d --- /dev/null +++ b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/HDInsightClusterProvisioningState.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.hdinsight.v2018_06_01_preview; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for HDInsightClusterProvisioningState. + */ +public enum HDInsightClusterProvisioningState { + /** Enum value InProgress. */ + IN_PROGRESS("InProgress"), + + /** Enum value Failed. */ + FAILED("Failed"), + + /** Enum value Succeeded. */ + SUCCEEDED("Succeeded"), + + /** Enum value Canceled. */ + CANCELED("Canceled"), + + /** Enum value Deleting. */ + DELETING("Deleting"); + + /** The actual serialized value for a HDInsightClusterProvisioningState instance. */ + private String value; + + HDInsightClusterProvisioningState(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a HDInsightClusterProvisioningState instance. + * + * @param value the serialized value to parse. + * @return the parsed HDInsightClusterProvisioningState object, or null if unable to parse. + */ + @JsonCreator + public static HDInsightClusterProvisioningState fromString(String value) { + HDInsightClusterProvisioningState[] items = HDInsightClusterProvisioningState.values(); + for (HDInsightClusterProvisioningState item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/HardwareProfile.java b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/HardwareProfile.java new file mode 100644 index 000000000000..ceb871e9b137 --- /dev/null +++ b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/HardwareProfile.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.hdinsight.v2018_06_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The hardware profile. + */ +public class HardwareProfile { + /** + * The size of the VM. + */ + @JsonProperty(value = "vmSize") + private String vmSize; + + /** + * Get the size of the VM. + * + * @return the vmSize value + */ + public String vmSize() { + return this.vmSize; + } + + /** + * Set the size of the VM. + * + * @param vmSize the vmSize value to set + * @return the HardwareProfile object itself. + */ + public HardwareProfile withVmSize(String vmSize) { + this.vmSize = vmSize; + return this; + } + +} diff --git a/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/LinuxOperatingSystemProfile.java b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/LinuxOperatingSystemProfile.java new file mode 100644 index 000000000000..85b16147dc44 --- /dev/null +++ b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/LinuxOperatingSystemProfile.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.hdinsight.v2018_06_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The ssh username, password, and ssh public key. + */ +public class LinuxOperatingSystemProfile { + /** + * The username. + */ + @JsonProperty(value = "username") + private String username; + + /** + * The password. + */ + @JsonProperty(value = "password") + private String password; + + /** + * The SSH profile. + */ + @JsonProperty(value = "sshProfile") + private SshProfile sshProfile; + + /** + * Get the username. + * + * @return the username value + */ + public String username() { + return this.username; + } + + /** + * Set the username. + * + * @param username the username value to set + * @return the LinuxOperatingSystemProfile object itself. + */ + public LinuxOperatingSystemProfile withUsername(String username) { + this.username = username; + return this; + } + + /** + * Get the password. + * + * @return the password value + */ + public String password() { + return this.password; + } + + /** + * Set the password. + * + * @param password the password value to set + * @return the LinuxOperatingSystemProfile object itself. + */ + public LinuxOperatingSystemProfile withPassword(String password) { + this.password = password; + return this; + } + + /** + * Get the SSH profile. + * + * @return the sshProfile value + */ + public SshProfile sshProfile() { + return this.sshProfile; + } + + /** + * Set the SSH profile. + * + * @param sshProfile the sshProfile value to set + * @return the LinuxOperatingSystemProfile object itself. + */ + public LinuxOperatingSystemProfile withSshProfile(SshProfile sshProfile) { + this.sshProfile = sshProfile; + return this; + } + +} diff --git a/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/LocalizedName.java b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/LocalizedName.java new file mode 100644 index 000000000000..1d9b8802e35f --- /dev/null +++ b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/LocalizedName.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.hdinsight.v2018_06_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The details about the localizable name of a type of usage. + */ +public class LocalizedName { + /** + * The name of the used resource. + */ + @JsonProperty(value = "value") + private String value; + + /** + * The localized name of the used resource. + */ + @JsonProperty(value = "localizedValue") + private String localizedValue; + + /** + * Get the name of the used resource. + * + * @return the value value + */ + public String value() { + return this.value; + } + + /** + * Set the name of the used resource. + * + * @param value the value value to set + * @return the LocalizedName object itself. + */ + public LocalizedName withValue(String value) { + this.value = value; + return this; + } + + /** + * Get the localized name of the used resource. + * + * @return the localizedValue value + */ + public String localizedValue() { + return this.localizedValue; + } + + /** + * Set the localized name of the used resource. + * + * @param localizedValue the localizedValue value to set + * @return the LocalizedName object itself. + */ + public LocalizedName withLocalizedValue(String localizedValue) { + this.localizedValue = localizedValue; + return this; + } + +} diff --git a/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/Locations.java b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/Locations.java new file mode 100644 index 000000000000..9bd76b3ec75c --- /dev/null +++ b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/Locations.java @@ -0,0 +1,26 @@ +/** + * 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.hdinsight.v2018_06_01_preview; + +import rx.Observable; + +/** + * Type representing Locations. + */ +public interface Locations { + /** + * Lists the usages for the specified location. + * + * @param location The location to get capabilities for. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listUsagesAsync(String location); + +} diff --git a/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/OSType.java b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/OSType.java new file mode 100644 index 000000000000..f2659f272e9a --- /dev/null +++ b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/OSType.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.hdinsight.v2018_06_01_preview; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for OSType. + */ +public enum OSType { + /** Enum value Windows. */ + WINDOWS("Windows"), + + /** Enum value Linux. */ + LINUX("Linux"); + + /** The actual serialized value for a OSType instance. */ + private String value; + + OSType(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a OSType instance. + * + * @param value the serialized value to parse. + * @return the parsed OSType object, or null if unable to parse. + */ + @JsonCreator + public static OSType fromString(String value) { + OSType[] items = OSType.values(); + for (OSType item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/Operation.java b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/Operation.java new file mode 100644 index 000000000000..9ac10da1efcb --- /dev/null +++ b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/Operation.java @@ -0,0 +1,30 @@ +/** + * 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.hdinsight.v2018_06_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.hdinsight.v2018_06_01_preview.implementation.HDInsightManager; +import com.microsoft.azure.management.hdinsight.v2018_06_01_preview.implementation.OperationInner; + +/** + * Type representing Operation. + */ +public interface Operation extends HasInner, HasManager { + /** + * @return the display value. + */ + OperationDisplay display(); + + /** + * @return the name value. + */ + String name(); + +} diff --git a/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/OperationDisplay.java b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/OperationDisplay.java new file mode 100644 index 000000000000..d6495bbda005 --- /dev/null +++ b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/OperationDisplay.java @@ -0,0 +1,96 @@ +/** + * 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.hdinsight.v2018_06_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The object that represents the operation. + */ +public class OperationDisplay { + /** + * The service provider: Microsoft.HDInsight. + */ + @JsonProperty(value = "provider") + private String provider; + + /** + * The resource on which the operation is performed: Cluster, Applications, + * etc. + */ + @JsonProperty(value = "resource") + private String resource; + + /** + * The operation type: read, write, delete, etc. + */ + @JsonProperty(value = "operation") + private String operation; + + /** + * Get the service provider: Microsoft.HDInsight. + * + * @return the provider value + */ + public String provider() { + return this.provider; + } + + /** + * Set the service provider: Microsoft.HDInsight. + * + * @param provider the provider value to set + * @return the OperationDisplay object itself. + */ + public OperationDisplay withProvider(String provider) { + this.provider = provider; + return this; + } + + /** + * Get the resource on which the operation is performed: Cluster, Applications, etc. + * + * @return the resource value + */ + public String resource() { + return this.resource; + } + + /** + * Set the resource on which the operation is performed: Cluster, Applications, etc. + * + * @param resource the resource value to set + * @return the OperationDisplay object itself. + */ + public OperationDisplay withResource(String resource) { + this.resource = resource; + return this; + } + + /** + * Get the operation type: read, write, delete, etc. + * + * @return the operation value + */ + public String operation() { + return this.operation; + } + + /** + * Set the operation type: read, write, delete, etc. + * + * @param operation the operation value to set + * @return the OperationDisplay object itself. + */ + public OperationDisplay withOperation(String operation) { + this.operation = operation; + return this; + } + +} diff --git a/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/OperationResource.java b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/OperationResource.java new file mode 100644 index 000000000000..2dcce02c9385 --- /dev/null +++ b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/OperationResource.java @@ -0,0 +1,70 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2018_06_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The azure async operation response. + */ +public class OperationResource { + /** + * The async operation state. Possible values include: 'InProgress', + * 'Succeeded', 'Failed'. + */ + @JsonProperty(value = "status") + private AsyncOperationState status; + + /** + * The operation error information. + */ + @JsonProperty(value = "error") + private Errors error; + + /** + * Get the async operation state. Possible values include: 'InProgress', 'Succeeded', 'Failed'. + * + * @return the status value + */ + public AsyncOperationState status() { + return this.status; + } + + /** + * Set the async operation state. Possible values include: 'InProgress', 'Succeeded', 'Failed'. + * + * @param status the status value to set + * @return the OperationResource object itself. + */ + public OperationResource withStatus(AsyncOperationState status) { + this.status = status; + return this; + } + + /** + * Get the operation error information. + * + * @return the error value + */ + public Errors error() { + return this.error; + } + + /** + * Set the operation error information. + * + * @param error the error value to set + * @return the OperationResource object itself. + */ + public OperationResource withError(Errors error) { + this.error = error; + return this; + } + +} diff --git a/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/Operations.java b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/Operations.java new file mode 100644 index 000000000000..ed0e1b039e0a --- /dev/null +++ b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/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.hdinsight.v2018_06_01_preview; + +import rx.Observable; +import com.microsoft.azure.management.hdinsight.v2018_06_01_preview.implementation.OperationsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing Operations. + */ +public interface Operations extends HasInner { + /** + * Lists all of the available HDInsight REST API operations. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(); + +} diff --git a/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/OsProfile.java b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/OsProfile.java new file mode 100644 index 000000000000..350bb586520f --- /dev/null +++ b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/OsProfile.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.hdinsight.v2018_06_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The Linux operation systems profile. + */ +public class OsProfile { + /** + * The Linux OS profile. + */ + @JsonProperty(value = "linuxOperatingSystemProfile") + private LinuxOperatingSystemProfile linuxOperatingSystemProfile; + + /** + * Get the Linux OS profile. + * + * @return the linuxOperatingSystemProfile value + */ + public LinuxOperatingSystemProfile linuxOperatingSystemProfile() { + return this.linuxOperatingSystemProfile; + } + + /** + * Set the Linux OS profile. + * + * @param linuxOperatingSystemProfile the linuxOperatingSystemProfile value to set + * @return the OsProfile object itself. + */ + public OsProfile withLinuxOperatingSystemProfile(LinuxOperatingSystemProfile linuxOperatingSystemProfile) { + this.linuxOperatingSystemProfile = linuxOperatingSystemProfile; + return this; + } + +} diff --git a/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/QuotaInfo.java b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/QuotaInfo.java new file mode 100644 index 000000000000..ad4c2597ce3b --- /dev/null +++ b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/QuotaInfo.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.hdinsight.v2018_06_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The quota properties for the cluster. + */ +public class QuotaInfo { + /** + * The cores used by the cluster. + */ + @JsonProperty(value = "coresUsed") + private Integer coresUsed; + + /** + * Get the cores used by the cluster. + * + * @return the coresUsed value + */ + public Integer coresUsed() { + return this.coresUsed; + } + + /** + * Set the cores used by the cluster. + * + * @param coresUsed the coresUsed value to set + * @return the QuotaInfo object itself. + */ + public QuotaInfo withCoresUsed(Integer coresUsed) { + this.coresUsed = coresUsed; + return this; + } + +} diff --git a/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/Role.java b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/Role.java new file mode 100644 index 000000000000..069ad311501d --- /dev/null +++ b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/Role.java @@ -0,0 +1,227 @@ +/** + * 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.hdinsight.v2018_06_01_preview; + +import java.util.List; +import com.microsoft.azure.management.hdinsight.v2018_06_01_preview.implementation.ScriptActionInner; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Describes a role on the cluster. + */ +public class Role { + /** + * The name of the role. + */ + @JsonProperty(value = "name") + private String name; + + /** + * The minimum instance count of the cluster. + */ + @JsonProperty(value = "minInstanceCount") + private Integer minInstanceCount; + + /** + * The instance count of the cluster. + */ + @JsonProperty(value = "targetInstanceCount") + private Integer targetInstanceCount; + + /** + * The hardware profile. + */ + @JsonProperty(value = "hardwareProfile") + private HardwareProfile hardwareProfile; + + /** + * The operating system profile. + */ + @JsonProperty(value = "osProfile") + private OsProfile osProfile; + + /** + * The virtual network profile. + */ + @JsonProperty(value = "virtualNetworkProfile") + private VirtualNetworkProfile virtualNetworkProfile; + + /** + * The data disks groups for the role. + */ + @JsonProperty(value = "dataDisksGroups") + private List dataDisksGroups; + + /** + * The list of script actions on the role. + */ + @JsonProperty(value = "scriptActions") + private List scriptActions; + + /** + * Get the name of the role. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name of the role. + * + * @param name the name value to set + * @return the Role object itself. + */ + public Role withName(String name) { + this.name = name; + return this; + } + + /** + * Get the minimum instance count of the cluster. + * + * @return the minInstanceCount value + */ + public Integer minInstanceCount() { + return this.minInstanceCount; + } + + /** + * Set the minimum instance count of the cluster. + * + * @param minInstanceCount the minInstanceCount value to set + * @return the Role object itself. + */ + public Role withMinInstanceCount(Integer minInstanceCount) { + this.minInstanceCount = minInstanceCount; + return this; + } + + /** + * Get the instance count of the cluster. + * + * @return the targetInstanceCount value + */ + public Integer targetInstanceCount() { + return this.targetInstanceCount; + } + + /** + * Set the instance count of the cluster. + * + * @param targetInstanceCount the targetInstanceCount value to set + * @return the Role object itself. + */ + public Role withTargetInstanceCount(Integer targetInstanceCount) { + this.targetInstanceCount = targetInstanceCount; + return this; + } + + /** + * Get the hardware profile. + * + * @return the hardwareProfile value + */ + public HardwareProfile hardwareProfile() { + return this.hardwareProfile; + } + + /** + * Set the hardware profile. + * + * @param hardwareProfile the hardwareProfile value to set + * @return the Role object itself. + */ + public Role withHardwareProfile(HardwareProfile hardwareProfile) { + this.hardwareProfile = hardwareProfile; + return this; + } + + /** + * Get the operating system profile. + * + * @return the osProfile value + */ + public OsProfile osProfile() { + return this.osProfile; + } + + /** + * Set the operating system profile. + * + * @param osProfile the osProfile value to set + * @return the Role object itself. + */ + public Role withOsProfile(OsProfile osProfile) { + this.osProfile = osProfile; + return this; + } + + /** + * Get the virtual network profile. + * + * @return the virtualNetworkProfile value + */ + public VirtualNetworkProfile virtualNetworkProfile() { + return this.virtualNetworkProfile; + } + + /** + * Set the virtual network profile. + * + * @param virtualNetworkProfile the virtualNetworkProfile value to set + * @return the Role object itself. + */ + public Role withVirtualNetworkProfile(VirtualNetworkProfile virtualNetworkProfile) { + this.virtualNetworkProfile = virtualNetworkProfile; + return this; + } + + /** + * Get the data disks groups for the role. + * + * @return the dataDisksGroups value + */ + public List dataDisksGroups() { + return this.dataDisksGroups; + } + + /** + * Set the data disks groups for the role. + * + * @param dataDisksGroups the dataDisksGroups value to set + * @return the Role object itself. + */ + public Role withDataDisksGroups(List dataDisksGroups) { + this.dataDisksGroups = dataDisksGroups; + return this; + } + + /** + * Get the list of script actions on the role. + * + * @return the scriptActions value + */ + public List scriptActions() { + return this.scriptActions; + } + + /** + * Set the list of script actions on the role. + * + * @param scriptActions the scriptActions value to set + * @return the Role object itself. + */ + public Role withScriptActions(List scriptActions) { + this.scriptActions = scriptActions; + return this; + } + +} diff --git a/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/RuntimeScriptAction.java b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/RuntimeScriptAction.java new file mode 100644 index 000000000000..5261fd0ee0db --- /dev/null +++ b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/RuntimeScriptAction.java @@ -0,0 +1,137 @@ +/** + * 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.hdinsight.v2018_06_01_preview; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Describes a script action on a running cluster. + */ +public class RuntimeScriptAction { + /** + * The name of the script action. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /** + * The URI to the script. + */ + @JsonProperty(value = "uri", required = true) + private String uri; + + /** + * The parameters for the script. + */ + @JsonProperty(value = "parameters") + private String parameters; + + /** + * The list of roles where script will be executed. + */ + @JsonProperty(value = "roles", required = true) + private List roles; + + /** + * The application name of the script action, if any. + */ + @JsonProperty(value = "applicationName", access = JsonProperty.Access.WRITE_ONLY) + private String applicationName; + + /** + * Get the name of the script action. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name of the script action. + * + * @param name the name value to set + * @return the RuntimeScriptAction object itself. + */ + public RuntimeScriptAction withName(String name) { + this.name = name; + return this; + } + + /** + * Get the URI to the script. + * + * @return the uri value + */ + public String uri() { + return this.uri; + } + + /** + * Set the URI to the script. + * + * @param uri the uri value to set + * @return the RuntimeScriptAction object itself. + */ + public RuntimeScriptAction withUri(String uri) { + this.uri = uri; + return this; + } + + /** + * Get the parameters for the script. + * + * @return the parameters value + */ + public String parameters() { + return this.parameters; + } + + /** + * Set the parameters for the script. + * + * @param parameters the parameters value to set + * @return the RuntimeScriptAction object itself. + */ + public RuntimeScriptAction withParameters(String parameters) { + this.parameters = parameters; + return this; + } + + /** + * Get the list of roles where script will be executed. + * + * @return the roles value + */ + public List roles() { + return this.roles; + } + + /** + * Set the list of roles where script will be executed. + * + * @param roles the roles value to set + * @return the RuntimeScriptAction object itself. + */ + public RuntimeScriptAction withRoles(List roles) { + this.roles = roles; + return this; + } + + /** + * Get the application name of the script action, if any. + * + * @return the applicationName value + */ + public String applicationName() { + return this.applicationName; + } + +} diff --git a/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/RuntimeScriptActionDetail.java b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/RuntimeScriptActionDetail.java new file mode 100644 index 000000000000..65b7112448a0 --- /dev/null +++ b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/RuntimeScriptActionDetail.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.hdinsight.v2018_06_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.hdinsight.v2018_06_01_preview.implementation.RuntimeScriptActionDetailInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.hdinsight.v2018_06_01_preview.implementation.HDInsightManager; +import java.util.List; + +/** + * Type representing RuntimeScriptActionDetail. + */ +public interface RuntimeScriptActionDetail extends HasInner, HasManager { + /** + * @return the applicationName value. + */ + String applicationName(); + + /** + * @return the debugInformation value. + */ + String debugInformation(); + + /** + * @return the endTime value. + */ + String endTime(); + + /** + * @return the executionSummary value. + */ + List executionSummary(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the operation value. + */ + String operation(); + + /** + * @return the parameters value. + */ + String parameters(); + + /** + * @return the roles value. + */ + List roles(); + + /** + * @return the scriptExecutionId value. + */ + Long scriptExecutionId(); + + /** + * @return the startTime value. + */ + String startTime(); + + /** + * @return the status value. + */ + String status(); + + /** + * @return the uri value. + */ + String uri(); + +} diff --git a/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/ScriptActionExecutionSummary.java b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/ScriptActionExecutionSummary.java new file mode 100644 index 000000000000..086e42212c57 --- /dev/null +++ b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/ScriptActionExecutionSummary.java @@ -0,0 +1,47 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2018_06_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The execution summary of a script action. + */ +public class ScriptActionExecutionSummary { + /** + * The status of script action execution. + */ + @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY) + private String status; + + /** + * The instance count for a given script action execution status. + */ + @JsonProperty(value = "instanceCount", access = JsonProperty.Access.WRITE_ONLY) + private Integer instanceCount; + + /** + * Get the status of script action execution. + * + * @return the status value + */ + public String status() { + return this.status; + } + + /** + * Get the instance count for a given script action execution status. + * + * @return the instanceCount value + */ + public Integer instanceCount() { + return this.instanceCount; + } + +} diff --git a/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/ScriptActionPersistedGetResponseSpec.java b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/ScriptActionPersistedGetResponseSpec.java new file mode 100644 index 000000000000..6daaf7d88afa --- /dev/null +++ b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/ScriptActionPersistedGetResponseSpec.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.hdinsight.v2018_06_01_preview; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The persisted script action for cluster. + */ +public class ScriptActionPersistedGetResponseSpec { + /** + * The name of script action. + */ + @JsonProperty(value = "name") + private String name; + + /** + * The URI to the script. + */ + @JsonProperty(value = "uri") + private String uri; + + /** + * The parameters for the script provided. + */ + @JsonProperty(value = "parameters") + private String parameters; + + /** + * The list of roles where script will be executed. + */ + @JsonProperty(value = "roles") + private List roles; + + /** + * The application name for the script action. + */ + @JsonProperty(value = "applicationName") + private String applicationName; + + /** + * Get the name of script action. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name of script action. + * + * @param name the name value to set + * @return the ScriptActionPersistedGetResponseSpec object itself. + */ + public ScriptActionPersistedGetResponseSpec withName(String name) { + this.name = name; + return this; + } + + /** + * Get the URI to the script. + * + * @return the uri value + */ + public String uri() { + return this.uri; + } + + /** + * Set the URI to the script. + * + * @param uri the uri value to set + * @return the ScriptActionPersistedGetResponseSpec object itself. + */ + public ScriptActionPersistedGetResponseSpec withUri(String uri) { + this.uri = uri; + return this; + } + + /** + * Get the parameters for the script provided. + * + * @return the parameters value + */ + public String parameters() { + return this.parameters; + } + + /** + * Set the parameters for the script provided. + * + * @param parameters the parameters value to set + * @return the ScriptActionPersistedGetResponseSpec object itself. + */ + public ScriptActionPersistedGetResponseSpec withParameters(String parameters) { + this.parameters = parameters; + return this; + } + + /** + * Get the list of roles where script will be executed. + * + * @return the roles value + */ + public List roles() { + return this.roles; + } + + /** + * Set the list of roles where script will be executed. + * + * @param roles the roles value to set + * @return the ScriptActionPersistedGetResponseSpec object itself. + */ + public ScriptActionPersistedGetResponseSpec withRoles(List roles) { + this.roles = roles; + return this; + } + + /** + * Get the application name for the script action. + * + * @return the applicationName value + */ + public String applicationName() { + return this.applicationName; + } + + /** + * Set the application name for the script action. + * + * @param applicationName the applicationName value to set + * @return the ScriptActionPersistedGetResponseSpec object itself. + */ + public ScriptActionPersistedGetResponseSpec withApplicationName(String applicationName) { + this.applicationName = applicationName; + return this; + } + +} diff --git a/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/ScriptActions.java b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/ScriptActions.java new file mode 100644 index 000000000000..d66041489187 --- /dev/null +++ b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/ScriptActions.java @@ -0,0 +1,52 @@ +/** + * 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.hdinsight.v2018_06_01_preview; + +import rx.Completable; +import rx.Observable; +import com.microsoft.azure.management.hdinsight.v2018_06_01_preview.implementation.ScriptActionsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing ScriptActions. + */ +public interface ScriptActions extends HasInner { + /** + * Lists all the persisted script actions for the specified cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listByClusterAsync(final String resourceGroupName, final String clusterName); + + /** + * Deletes a specified persisted script action of the cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param scriptName The name of the script. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable deleteAsync(String resourceGroupName, String clusterName, String scriptName); + + /** + * Gets the script execution detail for the given script execution ID. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param scriptExecutionId The script execution Id + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getExecutionDetailAsync(String resourceGroupName, String clusterName, String scriptExecutionId); + +} diff --git a/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/ScriptExecutionHistorys.java b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/ScriptExecutionHistorys.java new file mode 100644 index 000000000000..019ef2004928 --- /dev/null +++ b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/ScriptExecutionHistorys.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2018_06_01_preview; + +import rx.Completable; +import rx.Observable; +import com.microsoft.azure.management.hdinsight.v2018_06_01_preview.implementation.ScriptExecutionHistorysInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing ScriptExecutionHistorys. + */ +public interface ScriptExecutionHistorys extends HasInner { + /** + * Lists all scripts' execution history for the specified cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listByClusterAsync(final String resourceGroupName, final String clusterName); + + /** + * Promotes the specified ad-hoc script execution to a persisted script. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param scriptExecutionId The script execution Id + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable promoteAsync(String resourceGroupName, String clusterName, String scriptExecutionId); + +} diff --git a/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/SecurityProfile.java b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/SecurityProfile.java new file mode 100644 index 000000000000..c993b8c7357c --- /dev/null +++ b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/SecurityProfile.java @@ -0,0 +1,202 @@ +/** + * 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.hdinsight.v2018_06_01_preview; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The security profile which contains Ssh public key for the HDInsight + * cluster. + */ +public class SecurityProfile { + /** + * The directory type. Possible values include: 'ActiveDirectory'. + */ + @JsonProperty(value = "directoryType") + private DirectoryType directoryType; + + /** + * The organization's active directory domain. + */ + @JsonProperty(value = "domain") + private String domain; + + /** + * The organizational unit within the Active Directory to place the cluster + * and service accounts. + */ + @JsonProperty(value = "organizationalUnitDN") + private String organizationalUnitDN; + + /** + * The LDAPS protocol URLs to communicate with the Active Directory. + */ + @JsonProperty(value = "ldapsUrls") + private List ldapsUrls; + + /** + * The domain user account that will have admin privileges on the cluster. + */ + @JsonProperty(value = "domainUsername") + private String domainUsername; + + /** + * The domain admin password. + */ + @JsonProperty(value = "domainUserPassword") + private String domainUserPassword; + + /** + * Optional. The Distinguished Names for cluster user groups. + */ + @JsonProperty(value = "clusterUsersGroupDNs") + private List clusterUsersGroupDNs; + + /** + * Get the directory type. Possible values include: 'ActiveDirectory'. + * + * @return the directoryType value + */ + public DirectoryType directoryType() { + return this.directoryType; + } + + /** + * Set the directory type. Possible values include: 'ActiveDirectory'. + * + * @param directoryType the directoryType value to set + * @return the SecurityProfile object itself. + */ + public SecurityProfile withDirectoryType(DirectoryType directoryType) { + this.directoryType = directoryType; + return this; + } + + /** + * Get the organization's active directory domain. + * + * @return the domain value + */ + public String domain() { + return this.domain; + } + + /** + * Set the organization's active directory domain. + * + * @param domain the domain value to set + * @return the SecurityProfile object itself. + */ + public SecurityProfile withDomain(String domain) { + this.domain = domain; + return this; + } + + /** + * Get the organizational unit within the Active Directory to place the cluster and service accounts. + * + * @return the organizationalUnitDN value + */ + public String organizationalUnitDN() { + return this.organizationalUnitDN; + } + + /** + * Set the organizational unit within the Active Directory to place the cluster and service accounts. + * + * @param organizationalUnitDN the organizationalUnitDN value to set + * @return the SecurityProfile object itself. + */ + public SecurityProfile withOrganizationalUnitDN(String organizationalUnitDN) { + this.organizationalUnitDN = organizationalUnitDN; + return this; + } + + /** + * Get the LDAPS protocol URLs to communicate with the Active Directory. + * + * @return the ldapsUrls value + */ + public List ldapsUrls() { + return this.ldapsUrls; + } + + /** + * Set the LDAPS protocol URLs to communicate with the Active Directory. + * + * @param ldapsUrls the ldapsUrls value to set + * @return the SecurityProfile object itself. + */ + public SecurityProfile withLdapsUrls(List ldapsUrls) { + this.ldapsUrls = ldapsUrls; + return this; + } + + /** + * Get the domain user account that will have admin privileges on the cluster. + * + * @return the domainUsername value + */ + public String domainUsername() { + return this.domainUsername; + } + + /** + * Set the domain user account that will have admin privileges on the cluster. + * + * @param domainUsername the domainUsername value to set + * @return the SecurityProfile object itself. + */ + public SecurityProfile withDomainUsername(String domainUsername) { + this.domainUsername = domainUsername; + return this; + } + + /** + * Get the domain admin password. + * + * @return the domainUserPassword value + */ + public String domainUserPassword() { + return this.domainUserPassword; + } + + /** + * Set the domain admin password. + * + * @param domainUserPassword the domainUserPassword value to set + * @return the SecurityProfile object itself. + */ + public SecurityProfile withDomainUserPassword(String domainUserPassword) { + this.domainUserPassword = domainUserPassword; + return this; + } + + /** + * Get optional. The Distinguished Names for cluster user groups. + * + * @return the clusterUsersGroupDNs value + */ + public List clusterUsersGroupDNs() { + return this.clusterUsersGroupDNs; + } + + /** + * Set optional. The Distinguished Names for cluster user groups. + * + * @param clusterUsersGroupDNs the clusterUsersGroupDNs value to set + * @return the SecurityProfile object itself. + */ + public SecurityProfile withClusterUsersGroupDNs(List clusterUsersGroupDNs) { + this.clusterUsersGroupDNs = clusterUsersGroupDNs; + return this; + } + +} diff --git a/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/SshProfile.java b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/SshProfile.java new file mode 100644 index 000000000000..2f4542e900ad --- /dev/null +++ b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/SshProfile.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.hdinsight.v2018_06_01_preview; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The list of SSH public keys. + */ +public class SshProfile { + /** + * The list of SSH public keys. + */ + @JsonProperty(value = "publicKeys") + private List publicKeys; + + /** + * Get the list of SSH public keys. + * + * @return the publicKeys value + */ + public List publicKeys() { + return this.publicKeys; + } + + /** + * Set the list of SSH public keys. + * + * @param publicKeys the publicKeys value to set + * @return the SshProfile object itself. + */ + public SshProfile withPublicKeys(List publicKeys) { + this.publicKeys = publicKeys; + return this; + } + +} diff --git a/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/SshPublicKey.java b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/SshPublicKey.java new file mode 100644 index 000000000000..d2b63a87cd18 --- /dev/null +++ b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/SshPublicKey.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.hdinsight.v2018_06_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The SSH public key for the cluster nodes. + */ +public class SshPublicKey { + /** + * The certificate for SSH. + */ + @JsonProperty(value = "certificateData") + private String certificateData; + + /** + * Get the certificate for SSH. + * + * @return the certificateData value + */ + public String certificateData() { + return this.certificateData; + } + + /** + * Set the certificate for SSH. + * + * @param certificateData the certificateData value to set + * @return the SshPublicKey object itself. + */ + public SshPublicKey withCertificateData(String certificateData) { + this.certificateData = certificateData; + return this; + } + +} diff --git a/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/StorageAccount.java b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/StorageAccount.java new file mode 100644 index 000000000000..99ca4fa2ba19 --- /dev/null +++ b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/StorageAccount.java @@ -0,0 +1,149 @@ +/** + * 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.hdinsight.v2018_06_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The storage Account. + */ +public class StorageAccount { + /** + * The name of the storage account. + */ + @JsonProperty(value = "name") + private String name; + + /** + * Whether or not the storage account is the default storage account. + */ + @JsonProperty(value = "isDefault") + private Boolean isDefault; + + /** + * The container in the storage account, only to be specified for WASB + * storage accounts. + */ + @JsonProperty(value = "container") + private String container; + + /** + * The filesystem, only to be specified for Azure Data Lake Storage type + * Gen 2. + */ + @JsonProperty(value = "fileSystem") + private String fileSystem; + + /** + * The storage account access key. + */ + @JsonProperty(value = "key") + private String key; + + /** + * Get the name of the storage account. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name of the storage account. + * + * @param name the name value to set + * @return the StorageAccount object itself. + */ + public StorageAccount withName(String name) { + this.name = name; + return this; + } + + /** + * Get whether or not the storage account is the default storage account. + * + * @return the isDefault value + */ + public Boolean isDefault() { + return this.isDefault; + } + + /** + * Set whether or not the storage account is the default storage account. + * + * @param isDefault the isDefault value to set + * @return the StorageAccount object itself. + */ + public StorageAccount withIsDefault(Boolean isDefault) { + this.isDefault = isDefault; + return this; + } + + /** + * Get the container in the storage account, only to be specified for WASB storage accounts. + * + * @return the container value + */ + public String container() { + return this.container; + } + + /** + * Set the container in the storage account, only to be specified for WASB storage accounts. + * + * @param container the container value to set + * @return the StorageAccount object itself. + */ + public StorageAccount withContainer(String container) { + this.container = container; + return this; + } + + /** + * Get the filesystem, only to be specified for Azure Data Lake Storage type Gen 2. + * + * @return the fileSystem value + */ + public String fileSystem() { + return this.fileSystem; + } + + /** + * Set the filesystem, only to be specified for Azure Data Lake Storage type Gen 2. + * + * @param fileSystem the fileSystem value to set + * @return the StorageAccount object itself. + */ + public StorageAccount withFileSystem(String fileSystem) { + this.fileSystem = fileSystem; + return this; + } + + /** + * Get the storage account access key. + * + * @return the key value + */ + public String key() { + return this.key; + } + + /** + * Set the storage account access key. + * + * @param key the key value to set + * @return the StorageAccount object itself. + */ + public StorageAccount withKey(String key) { + this.key = key; + return this; + } + +} diff --git a/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/StorageProfile.java b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/StorageProfile.java new file mode 100644 index 000000000000..ffca8a6461d8 --- /dev/null +++ b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/StorageProfile.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.hdinsight.v2018_06_01_preview; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The storage profile. + */ +public class StorageProfile { + /** + * The list of storage accounts in the cluster. + */ + @JsonProperty(value = "storageaccounts") + private List storageaccounts; + + /** + * Get the list of storage accounts in the cluster. + * + * @return the storageaccounts value + */ + public List storageaccounts() { + return this.storageaccounts; + } + + /** + * Set the list of storage accounts in the cluster. + * + * @param storageaccounts the storageaccounts value to set + * @return the StorageProfile object itself. + */ + public StorageProfile withStorageaccounts(List storageaccounts) { + this.storageaccounts = storageaccounts; + return this; + } + +} diff --git a/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/Tier.java b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/Tier.java new file mode 100644 index 000000000000..64667c2b97f3 --- /dev/null +++ b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/Tier.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.hdinsight.v2018_06_01_preview; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for Tier. + */ +public enum Tier { + /** Enum value Standard. */ + STANDARD("Standard"), + + /** Enum value Premium. */ + PREMIUM("Premium"); + + /** The actual serialized value for a Tier instance. */ + private String value; + + Tier(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a Tier instance. + * + * @param value the serialized value to parse. + * @return the parsed Tier object, or null if unable to parse. + */ + @JsonCreator + public static Tier fromString(String value) { + Tier[] items = Tier.values(); + for (Tier item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/Usage.java b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/Usage.java new file mode 100644 index 000000000000..40bb0dbec7ff --- /dev/null +++ b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/Usage.java @@ -0,0 +1,121 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2018_06_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The details about the usage of a particular limited resource. + */ +public class Usage { + /** + * The type of measurement for usage. + */ + @JsonProperty(value = "unit") + private String unit; + + /** + * The current usage. + */ + @JsonProperty(value = "currentValue") + private Integer currentValue; + + /** + * The maximum allowed usage. + */ + @JsonProperty(value = "limit") + private Integer limit; + + /** + * The details about the localizable name of the used resource. + */ + @JsonProperty(value = "name") + private LocalizedName name; + + /** + * Get the type of measurement for usage. + * + * @return the unit value + */ + public String unit() { + return this.unit; + } + + /** + * Set the type of measurement for usage. + * + * @param unit the unit value to set + * @return the Usage object itself. + */ + public Usage withUnit(String unit) { + this.unit = unit; + return this; + } + + /** + * Get the current usage. + * + * @return the currentValue value + */ + public Integer currentValue() { + return this.currentValue; + } + + /** + * Set the current usage. + * + * @param currentValue the currentValue value to set + * @return the Usage object itself. + */ + public Usage withCurrentValue(Integer currentValue) { + this.currentValue = currentValue; + return this; + } + + /** + * Get the maximum allowed usage. + * + * @return the limit value + */ + public Integer limit() { + return this.limit; + } + + /** + * Set the maximum allowed usage. + * + * @param limit the limit value to set + * @return the Usage object itself. + */ + public Usage withLimit(Integer limit) { + this.limit = limit; + return this; + } + + /** + * Get the details about the localizable name of the used resource. + * + * @return the name value + */ + public LocalizedName name() { + return this.name; + } + + /** + * Set the details about the localizable name of the used resource. + * + * @param name the name value to set + * @return the Usage object itself. + */ + public Usage withName(LocalizedName name) { + this.name = name; + return this; + } + +} diff --git a/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/UsagesListResult.java b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/UsagesListResult.java new file mode 100644 index 000000000000..e6535a67c6e0 --- /dev/null +++ b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/UsagesListResult.java @@ -0,0 +1,26 @@ +/** + * 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.hdinsight.v2018_06_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.hdinsight.v2018_06_01_preview.implementation.HDInsightManager; +import com.microsoft.azure.management.hdinsight.v2018_06_01_preview.implementation.UsagesListResultInner; +import java.util.List; + +/** + * Type representing UsagesListResult. + */ +public interface UsagesListResult extends HasInner, HasManager { + /** + * @return the value value. + */ + List value(); + +} diff --git a/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/VirtualNetworkProfile.java b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/VirtualNetworkProfile.java new file mode 100644 index 000000000000..02f928a4eff3 --- /dev/null +++ b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/VirtualNetworkProfile.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.hdinsight.v2018_06_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The virtual network properties. + */ +public class VirtualNetworkProfile { + /** + * The ID of the virtual network. + */ + @JsonProperty(value = "id") + private String id; + + /** + * The name of the subnet. + */ + @JsonProperty(value = "subnet") + private String subnet; + + /** + * Get the ID of the virtual network. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set the ID of the virtual network. + * + * @param id the id value to set + * @return the VirtualNetworkProfile object itself. + */ + public VirtualNetworkProfile withId(String id) { + this.id = id; + return this; + } + + /** + * Get the name of the subnet. + * + * @return the subnet value + */ + public String subnet() { + return this.subnet; + } + + /** + * Set the name of the subnet. + * + * @param subnet the subnet value to set + * @return the VirtualNetworkProfile object itself. + */ + public VirtualNetworkProfile withSubnet(String subnet) { + this.subnet = subnet; + return this; + } + +} diff --git a/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/implementation/ApplicationImpl.java b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/implementation/ApplicationImpl.java new file mode 100644 index 000000000000..b02a8e669738 --- /dev/null +++ b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/implementation/ApplicationImpl.java @@ -0,0 +1,129 @@ +/** + * 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.hdinsight.v2018_06_01_preview.implementation; + +import com.microsoft.azure.management.hdinsight.v2018_06_01_preview.Application; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import java.util.Map; +import com.microsoft.azure.management.hdinsight.v2018_06_01_preview.ApplicationProperties; + +class ApplicationImpl extends CreatableUpdatableImpl implements Application, Application.Definition, Application.Update { + private final HDInsightManager manager; + private String resourceGroupName; + private String clusterName; + private String applicationName; + + ApplicationImpl(String name, HDInsightManager manager) { + super(name, new ApplicationInner()); + this.manager = manager; + // Set resource name + this.applicationName = name; + // + } + + ApplicationImpl(ApplicationInner inner, HDInsightManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.applicationName = inner.name(); + // resource ancestor names + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.clusterName = IdParsingUtils.getValueFromIdByName(inner.id(), "clusters"); + this.applicationName = IdParsingUtils.getValueFromIdByName(inner.id(), "applications"); + // + } + + @Override + public HDInsightManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + ApplicationsInner client = this.manager().inner().applications(); + return client.createAsync(this.resourceGroupName, this.clusterName, this.applicationName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + ApplicationsInner client = this.manager().inner().applications(); + return client.createAsync(this.resourceGroupName, this.clusterName, this.applicationName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + ApplicationsInner client = this.manager().inner().applications(); + return client.getAsync(this.resourceGroupName, this.clusterName, this.applicationName); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public String etag() { + return this.inner().etag(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public ApplicationProperties properties() { + return this.inner().properties(); + } + + @Override + public Map tags() { + return this.inner().tags(); + } + + @Override + public String type() { + return this.inner().type(); + } + + @Override + public ApplicationImpl withExistingCluster(String resourceGroupName, String clusterName) { + this.resourceGroupName = resourceGroupName; + this.clusterName = clusterName; + return this; + } + + @Override + public ApplicationImpl withEtag(String etag) { + this.inner().withEtag(etag); + return this; + } + + @Override + public ApplicationImpl withProperties(ApplicationProperties properties) { + this.inner().withProperties(properties); + return this; + } + + @Override + public ApplicationImpl withTags(Map tags) { + this.inner().withTags(tags); + return this; + } + +} diff --git a/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/implementation/ApplicationInner.java b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/implementation/ApplicationInner.java new file mode 100644 index 000000000000..e492ddd3b308 --- /dev/null +++ b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/implementation/ApplicationInner.java @@ -0,0 +1,98 @@ +/** + * 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.hdinsight.v2018_06_01_preview.implementation; + +import java.util.Map; +import com.microsoft.azure.management.hdinsight.v2018_06_01_preview.ApplicationProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.azure.ProxyResource; + +/** + * The HDInsight cluster application. + */ +public class ApplicationInner extends ProxyResource { + /** + * The ETag for the application. + */ + @JsonProperty(value = "etag") + private String etag; + + /** + * The tags for the application. + */ + @JsonProperty(value = "tags") + private Map tags; + + /** + * The properties of the application. + */ + @JsonProperty(value = "properties") + private ApplicationProperties properties; + + /** + * Get the ETag for the application. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + + /** + * Set the ETag for the application. + * + * @param etag the etag value to set + * @return the ApplicationInner object itself. + */ + public ApplicationInner withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Get the tags for the application. + * + * @return the tags value + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags for the application. + * + * @param tags the tags value to set + * @return the ApplicationInner object itself. + */ + public ApplicationInner withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Get the properties of the application. + * + * @return the properties value + */ + public ApplicationProperties properties() { + return this.properties; + } + + /** + * Set the properties of the application. + * + * @param properties the properties value to set + * @return the ApplicationInner object itself. + */ + public ApplicationInner withProperties(ApplicationProperties properties) { + this.properties = properties; + return this; + } + +} diff --git a/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/implementation/ApplicationsImpl.java b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/implementation/ApplicationsImpl.java new file mode 100644 index 000000000000..6a1aadd83275 --- /dev/null +++ b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/implementation/ApplicationsImpl.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.hdinsight.v2018_06_01_preview.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.hdinsight.v2018_06_01_preview.Applications; +import rx.Completable; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.hdinsight.v2018_06_01_preview.Application; + +class ApplicationsImpl extends WrapperImpl implements Applications { + private final HDInsightManager manager; + + ApplicationsImpl(HDInsightManager manager) { + super(manager.inner().applications()); + this.manager = manager; + } + + public HDInsightManager manager() { + return this.manager; + } + + @Override + public ApplicationImpl define(String name) { + return wrapModel(name); + } + + private ApplicationImpl wrapModel(ApplicationInner inner) { + return new ApplicationImpl(inner, manager()); + } + + private ApplicationImpl wrapModel(String name) { + return new ApplicationImpl(name, this.manager()); + } + + @Override + public Observable listByClusterAsync(final String resourceGroupName, final String clusterName) { + ApplicationsInner client = this.inner(); + return client.listByClusterAsync(resourceGroupName, clusterName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public Application call(ApplicationInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Observable getAsync(String resourceGroupName, String clusterName, String applicationName) { + ApplicationsInner client = this.inner(); + return client.getAsync(resourceGroupName, clusterName, applicationName) + .map(new Func1() { + @Override + public Application call(ApplicationInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Completable deleteAsync(String resourceGroupName, String clusterName, String applicationName) { + ApplicationsInner client = this.inner(); + return client.deleteAsync(resourceGroupName, clusterName, applicationName).toCompletable(); + } + +} diff --git a/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/implementation/ApplicationsInner.java b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/implementation/ApplicationsInner.java new file mode 100644 index 000000000000..5bf8f1ba335c --- /dev/null +++ b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/implementation/ApplicationsInner.java @@ -0,0 +1,774 @@ +/** + * 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.hdinsight.v2018_06_01_preview.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.hdinsight.v2018_06_01_preview.ErrorResponseException; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.Path; +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 Applications. + */ +public class ApplicationsInner { + /** The Retrofit service to perform REST calls. */ + private ApplicationsService service; + /** The service client containing this operation class. */ + private HDInsightManagementClientImpl client; + + /** + * Initializes an instance of ApplicationsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public ApplicationsInner(Retrofit retrofit, HDInsightManagementClientImpl client) { + this.service = retrofit.create(ApplicationsService.class); + this.client = client; + } + + /** + * The interface defining all the services for Applications to be + * used by Retrofit to perform actually REST calls. + */ + interface ApplicationsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.hdinsight.v2018_06_01_preview.Applications listByCluster" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/applications") + Observable> listByCluster(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @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.hdinsight.v2018_06_01_preview.Applications get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/applications/{applicationName}") + Observable> get(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Path("applicationName") String applicationName, @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.hdinsight.v2018_06_01_preview.Applications create" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/applications/{applicationName}") + Observable> create(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Path("applicationName") String applicationName, @Query("api-version") String apiVersion, @Body ApplicationInner parameters, @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.hdinsight.v2018_06_01_preview.Applications beginCreate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/applications/{applicationName}") + Observable> beginCreate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Path("applicationName") String applicationName, @Query("api-version") String apiVersion, @Body ApplicationInner parameters, @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.hdinsight.v2018_06_01_preview.Applications delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/applications/{applicationName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Path("applicationName") String applicationName, @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.hdinsight.v2018_06_01_preview.Applications beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/applications/{applicationName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Path("applicationName") String applicationName, @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.hdinsight.v2018_06_01_preview.Applications listByClusterNext" }) + @GET + Observable> listByClusterNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Lists all of the applications for the HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException 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<ApplicationInner> object if successful. + */ + public PagedList listByCluster(final String resourceGroupName, final String clusterName) { + ServiceResponse> response = listByClusterSinglePageAsync(resourceGroupName, clusterName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByClusterNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all of the applications for the HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @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> listByClusterAsync(final String resourceGroupName, final String clusterName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByClusterSinglePageAsync(resourceGroupName, clusterName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByClusterNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all of the applications for the HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ApplicationInner> object + */ + public Observable> listByClusterAsync(final String resourceGroupName, final String clusterName) { + return listByClusterWithServiceResponseAsync(resourceGroupName, clusterName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all of the applications for the HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ApplicationInner> object + */ + public Observable>> listByClusterWithServiceResponseAsync(final String resourceGroupName, final String clusterName) { + return listByClusterSinglePageAsync(resourceGroupName, clusterName) + .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(listByClusterNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all of the applications for the HDInsight cluster. + * + ServiceResponse> * @param resourceGroupName The name of the resource group. + ServiceResponse> * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ApplicationInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByClusterSinglePageAsync(final String resourceGroupName, final String clusterName) { + 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 (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName 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.listByCluster(this.client.subscriptionId(), resourceGroupName, clusterName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByClusterDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByClusterDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Gets properties of the specified application. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param applicationName The constant value for the application name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ApplicationInner object if successful. + */ + public ApplicationInner get(String resourceGroupName, String clusterName, String applicationName) { + return getWithServiceResponseAsync(resourceGroupName, clusterName, applicationName).toBlocking().single().body(); + } + + /** + * Gets properties of the specified application. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param applicationName The constant value for the application name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String resourceGroupName, String clusterName, String applicationName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, clusterName, applicationName), serviceCallback); + } + + /** + * Gets properties of the specified application. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param applicationName The constant value for the application name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ApplicationInner object + */ + public Observable getAsync(String resourceGroupName, String clusterName, String applicationName) { + return getWithServiceResponseAsync(resourceGroupName, clusterName, applicationName).map(new Func1, ApplicationInner>() { + @Override + public ApplicationInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets properties of the specified application. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param applicationName The constant value for the application name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ApplicationInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String clusterName, String applicationName) { + 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 (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName is required and cannot be null."); + } + if (applicationName == null) { + throw new IllegalArgumentException("Parameter applicationName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.get(this.client.subscriptionId(), resourceGroupName, clusterName, applicationName, 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 ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Creates applications for the HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param applicationName The constant value for the application name. + * @param parameters The application create request. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ApplicationInner object if successful. + */ + public ApplicationInner create(String resourceGroupName, String clusterName, String applicationName, ApplicationInner parameters) { + return createWithServiceResponseAsync(resourceGroupName, clusterName, applicationName, parameters).toBlocking().last().body(); + } + + /** + * Creates applications for the HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param applicationName The constant value for the application name. + * @param parameters The application create request. + * @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 createAsync(String resourceGroupName, String clusterName, String applicationName, ApplicationInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createWithServiceResponseAsync(resourceGroupName, clusterName, applicationName, parameters), serviceCallback); + } + + /** + * Creates applications for the HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param applicationName The constant value for the application name. + * @param parameters The application create request. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createAsync(String resourceGroupName, String clusterName, String applicationName, ApplicationInner parameters) { + return createWithServiceResponseAsync(resourceGroupName, clusterName, applicationName, parameters).map(new Func1, ApplicationInner>() { + @Override + public ApplicationInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates applications for the HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param applicationName The constant value for the application name. + * @param parameters The application create request. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createWithServiceResponseAsync(String resourceGroupName, String clusterName, String applicationName, ApplicationInner parameters) { + 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 (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName is required and cannot be null."); + } + if (applicationName == null) { + throw new IllegalArgumentException("Parameter applicationName 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 (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + Observable> observable = service.create(this.client.subscriptionId(), resourceGroupName, clusterName, applicationName, this.client.apiVersion(), parameters, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Creates applications for the HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param applicationName The constant value for the application name. + * @param parameters The application create request. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ApplicationInner object if successful. + */ + public ApplicationInner beginCreate(String resourceGroupName, String clusterName, String applicationName, ApplicationInner parameters) { + return beginCreateWithServiceResponseAsync(resourceGroupName, clusterName, applicationName, parameters).toBlocking().single().body(); + } + + /** + * Creates applications for the HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param applicationName The constant value for the application name. + * @param parameters The application create request. + * @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 beginCreateAsync(String resourceGroupName, String clusterName, String applicationName, ApplicationInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateWithServiceResponseAsync(resourceGroupName, clusterName, applicationName, parameters), serviceCallback); + } + + /** + * Creates applications for the HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param applicationName The constant value for the application name. + * @param parameters The application create request. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ApplicationInner object + */ + public Observable beginCreateAsync(String resourceGroupName, String clusterName, String applicationName, ApplicationInner parameters) { + return beginCreateWithServiceResponseAsync(resourceGroupName, clusterName, applicationName, parameters).map(new Func1, ApplicationInner>() { + @Override + public ApplicationInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates applications for the HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param applicationName The constant value for the application name. + * @param parameters The application create request. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ApplicationInner object + */ + public Observable> beginCreateWithServiceResponseAsync(String resourceGroupName, String clusterName, String applicationName, ApplicationInner parameters) { + 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 (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName is required and cannot be null."); + } + if (applicationName == null) { + throw new IllegalArgumentException("Parameter applicationName 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 (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + return service.beginCreate(this.client.subscriptionId(), resourceGroupName, clusterName, applicationName, this.client.apiVersion(), parameters, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Deletes the specified application on the HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param applicationName The constant value for the application name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException 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 clusterName, String applicationName) { + deleteWithServiceResponseAsync(resourceGroupName, clusterName, applicationName).toBlocking().last().body(); + } + + /** + * Deletes the specified application on the HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param applicationName The constant value for the application name. + * @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 clusterName, String applicationName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, clusterName, applicationName), serviceCallback); + } + + /** + * Deletes the specified application on the HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param applicationName The constant value for the application name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String clusterName, String applicationName) { + return deleteWithServiceResponseAsync(resourceGroupName, clusterName, applicationName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the specified application on the HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param applicationName The constant value for the application name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String clusterName, String applicationName) { + 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 (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName is required and cannot be null."); + } + if (applicationName == null) { + throw new IllegalArgumentException("Parameter applicationName 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, clusterName, applicationName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Deletes the specified application on the HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param applicationName The constant value for the application name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException 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 clusterName, String applicationName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, clusterName, applicationName).toBlocking().single().body(); + } + + /** + * Deletes the specified application on the HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param applicationName The constant value for the application name. + * @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 clusterName, String applicationName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, clusterName, applicationName), serviceCallback); + } + + /** + * Deletes the specified application on the HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param applicationName The constant value for the application name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String clusterName, String applicationName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, clusterName, applicationName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the specified application on the HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param applicationName The constant value for the application name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String clusterName, String applicationName) { + 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 (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName is required and cannot be null."); + } + if (applicationName == null) { + throw new IllegalArgumentException("Parameter applicationName 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, clusterName, applicationName, 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 ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Lists all of the applications for the HDInsight cluster. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException 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<ApplicationInner> object if successful. + */ + public PagedList listByClusterNext(final String nextPageLink) { + ServiceResponse> response = listByClusterNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByClusterNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all of the applications for the HDInsight cluster. + * + * @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> listByClusterNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByClusterNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByClusterNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all of the applications for the HDInsight cluster. + * + * @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<ApplicationInner> object + */ + public Observable> listByClusterNextAsync(final String nextPageLink) { + return listByClusterNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all of the applications for the HDInsight cluster. + * + * @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<ApplicationInner> object + */ + public Observable>> listByClusterNextWithServiceResponseAsync(final String nextPageLink) { + return listByClusterNextSinglePageAsync(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(listByClusterNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all of the applications for the HDInsight cluster. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ApplicationInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByClusterNextSinglePageAsync(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.listByClusterNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByClusterNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByClusterNextDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + +} diff --git a/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/implementation/ClusterImpl.java b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/implementation/ClusterImpl.java new file mode 100644 index 000000000000..5e53684da1a0 --- /dev/null +++ b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/implementation/ClusterImpl.java @@ -0,0 +1,87 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2018_06_01_preview.implementation; + +import com.microsoft.azure.arm.resources.models.implementation.GroupableResourceCoreImpl; +import com.microsoft.azure.management.hdinsight.v2018_06_01_preview.Cluster; +import rx.Observable; +import com.microsoft.azure.management.hdinsight.v2018_06_01_preview.ClusterCreateParametersExtended; +import com.microsoft.azure.management.hdinsight.v2018_06_01_preview.ClusterGetProperties; +import com.microsoft.azure.management.hdinsight.v2018_06_01_preview.ClusterCreateProperties; +import rx.functions.Func1; + +class ClusterImpl extends GroupableResourceCoreImpl implements Cluster, Cluster.Definition, Cluster.Update { + private ClusterCreateParametersExtended createOrUpdateParameter; + ClusterImpl(String name, ClusterInner inner, HDInsightManager manager) { + super(name, inner, manager); + this.createOrUpdateParameter = new ClusterCreateParametersExtended(); + } + + @Override + public Observable createResourceAsync() { + ClustersInner client = this.manager().inner().clusters(); + this.createOrUpdateParameter.withLocation(inner().location()); + this.createOrUpdateParameter.withTags(inner().getTags()); + return client.createAsync(this.resourceGroupName(), this.name(), this.createOrUpdateParameter) + .map(new Func1() { + @Override + public ClusterInner call(ClusterInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + ClustersInner client = this.manager().inner().clusters(); + return client.createAsync(this.resourceGroupName(), this.name(), this.createOrUpdateParameter) + .map(new Func1() { + @Override + public ClusterInner call(ClusterInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + ClustersInner client = this.manager().inner().clusters(); + return client.getByResourceGroupAsync(this.resourceGroupName(), this.name()); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + private void resetCreateUpdateParameters() { + this.createOrUpdateParameter = new ClusterCreateParametersExtended(); + } + + @Override + public String etag() { + return this.inner().etag(); + } + + @Override + public ClusterGetProperties properties() { + return this.inner().properties(); + } + + @Override + public ClusterImpl withProperties(ClusterCreateProperties properties) { + this.createOrUpdateParameter.withProperties(properties); + return this; + } + +} diff --git a/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/implementation/ClusterInner.java b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/implementation/ClusterInner.java new file mode 100644 index 000000000000..0f7ac44c8356 --- /dev/null +++ b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/implementation/ClusterInner.java @@ -0,0 +1,73 @@ +/** + * 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.hdinsight.v2018_06_01_preview.implementation; + +import com.microsoft.azure.management.hdinsight.v2018_06_01_preview.ClusterGetProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.SkipParentValidation; +import com.microsoft.azure.Resource; + +/** + * The HDInsight cluster. + */ +@SkipParentValidation +public class ClusterInner extends Resource { + /** + * The ETag for the resource. + */ + @JsonProperty(value = "etag") + private String etag; + + /** + * The properties of the cluster. + */ + @JsonProperty(value = "properties") + private ClusterGetProperties properties; + + /** + * Get the ETag for the resource. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + + /** + * Set the ETag for the resource. + * + * @param etag the etag value to set + * @return the ClusterInner object itself. + */ + public ClusterInner withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Get the properties of the cluster. + * + * @return the properties value + */ + public ClusterGetProperties properties() { + return this.properties; + } + + /** + * Set the properties of the cluster. + * + * @param properties the properties value to set + * @return the ClusterInner object itself. + */ + public ClusterInner withProperties(ClusterGetProperties properties) { + this.properties = properties; + return this; + } + +} diff --git a/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/implementation/ClusterMonitoringResponseImpl.java b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/implementation/ClusterMonitoringResponseImpl.java new file mode 100644 index 000000000000..b10558098c4f --- /dev/null +++ b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/implementation/ClusterMonitoringResponseImpl.java @@ -0,0 +1,36 @@ +/** + * 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.hdinsight.v2018_06_01_preview.implementation; + +import com.microsoft.azure.management.hdinsight.v2018_06_01_preview.ClusterMonitoringResponse; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; + +class ClusterMonitoringResponseImpl extends WrapperImpl implements ClusterMonitoringResponse { + private final HDInsightManager manager; + ClusterMonitoringResponseImpl(ClusterMonitoringResponseInner inner, HDInsightManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public HDInsightManager manager() { + return this.manager; + } + + @Override + public Boolean clusterMonitoringEnabled() { + return this.inner().clusterMonitoringEnabled(); + } + + @Override + public String workspaceId() { + return this.inner().workspaceId(); + } + +} diff --git a/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/implementation/ClusterMonitoringResponseInner.java b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/implementation/ClusterMonitoringResponseInner.java new file mode 100644 index 000000000000..8245ecb9e250 --- /dev/null +++ b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/implementation/ClusterMonitoringResponseInner.java @@ -0,0 +1,71 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2018_06_01_preview.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The Operations Management Suite (OMS) status response. + */ +public class ClusterMonitoringResponseInner { + /** + * The status of the Operations Management Suite (OMS) on the HDInsight + * cluster. + */ + @JsonProperty(value = "clusterMonitoringEnabled") + private Boolean clusterMonitoringEnabled; + + /** + * The workspace ID of the Operations Management Suite (OMS) on the + * HDInsight cluster. + */ + @JsonProperty(value = "workspaceId") + private String workspaceId; + + /** + * Get the status of the Operations Management Suite (OMS) on the HDInsight cluster. + * + * @return the clusterMonitoringEnabled value + */ + public Boolean clusterMonitoringEnabled() { + return this.clusterMonitoringEnabled; + } + + /** + * Set the status of the Operations Management Suite (OMS) on the HDInsight cluster. + * + * @param clusterMonitoringEnabled the clusterMonitoringEnabled value to set + * @return the ClusterMonitoringResponseInner object itself. + */ + public ClusterMonitoringResponseInner withClusterMonitoringEnabled(Boolean clusterMonitoringEnabled) { + this.clusterMonitoringEnabled = clusterMonitoringEnabled; + return this; + } + + /** + * Get the workspace ID of the Operations Management Suite (OMS) on the HDInsight cluster. + * + * @return the workspaceId value + */ + public String workspaceId() { + return this.workspaceId; + } + + /** + * Set the workspace ID of the Operations Management Suite (OMS) on the HDInsight cluster. + * + * @param workspaceId the workspaceId value to set + * @return the ClusterMonitoringResponseInner object itself. + */ + public ClusterMonitoringResponseInner withWorkspaceId(String workspaceId) { + this.workspaceId = workspaceId; + return this; + } + +} diff --git a/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/implementation/ClustersImpl.java b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/implementation/ClustersImpl.java new file mode 100644 index 000000000000..22cb91adc291 --- /dev/null +++ b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/implementation/ClustersImpl.java @@ -0,0 +1,151 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * def + */ + +package com.microsoft.azure.management.hdinsight.v2018_06_01_preview.implementation; + +import com.microsoft.azure.arm.resources.collection.implementation.GroupableResourcesCoreImpl; +import com.microsoft.azure.management.hdinsight.v2018_06_01_preview.Clusters; +import com.microsoft.azure.management.hdinsight.v2018_06_01_preview.Cluster; +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.hdinsight.v2018_06_01_preview.ExecuteScriptActionParameters; + +class ClustersImpl extends GroupableResourcesCoreImpl implements Clusters { + protected ClustersImpl(HDInsightManager manager) { + super(manager.inner().clusters(), manager); + } + + @Override + protected Observable getInnerAsync(String resourceGroupName, String name) { + ClustersInner client = this.inner(); + return client.getByResourceGroupAsync(resourceGroupName, name); + } + + @Override + protected Completable deleteInnerAsync(String resourceGroupName, String name) { + ClustersInner 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) { + ClustersInner client = this.inner(); + return this.wrapList(client.listByResourceGroup(resourceGroupName)); + } + + @Override + public Observable listByResourceGroupAsync(String resourceGroupName) { + ClustersInner 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 Cluster call(ClusterInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public PagedList list() { + ClustersInner client = this.inner(); + return this.wrapList(client.list()); + } + + @Override + public Observable listAsync() { + ClustersInner client = this.inner(); + return client.listAsync() + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public Cluster call(ClusterInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public ClusterImpl define(String name) { + return wrapModel(name); + } + + @Override + public Completable executeScriptActionsAsync(String resourceGroupName, String clusterName, ExecuteScriptActionParameters parameters) { + ClustersInner client = this.inner(); + return client.executeScriptActionsAsync(resourceGroupName, clusterName, parameters).toCompletable(); + } + + @Override + protected ClusterImpl wrapModel(ClusterInner inner) { + return new ClusterImpl(inner.name(), inner, manager()); + } + + @Override + protected ClusterImpl wrapModel(String name) { + return new ClusterImpl(name, new ClusterInner(), this.manager()); + } + + @Override + public Completable resizeAsync(String resourceGroupName, String clusterName) { + ClustersInner client = this.inner(); + return client.resizeAsync(resourceGroupName, clusterName).toCompletable(); + } + +} diff --git a/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/implementation/ClustersInner.java b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/implementation/ClustersInner.java new file mode 100644 index 000000000000..250355e95795 --- /dev/null +++ b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/implementation/ClustersInner.java @@ -0,0 +1,1653 @@ +/** + * 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.hdinsight.v2018_06_01_preview.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.hdinsight.v2018_06_01_preview.ClusterCreateParametersExtended; +import com.microsoft.azure.management.hdinsight.v2018_06_01_preview.ClusterPatchParameters; +import com.microsoft.azure.management.hdinsight.v2018_06_01_preview.ClusterResizeParameters; +import com.microsoft.azure.management.hdinsight.v2018_06_01_preview.ErrorResponseException; +import com.microsoft.azure.management.hdinsight.v2018_06_01_preview.ExecuteScriptActionParameters; +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 Clusters. + */ +public class ClustersInner implements InnerSupportsGet, InnerSupportsDelete, InnerSupportsListing { + /** The Retrofit service to perform REST calls. */ + private ClustersService service; + /** The service client containing this operation class. */ + private HDInsightManagementClientImpl client; + + /** + * Initializes an instance of ClustersInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public ClustersInner(Retrofit retrofit, HDInsightManagementClientImpl client) { + this.service = retrofit.create(ClustersService.class); + this.client = client; + } + + /** + * The interface defining all the services for Clusters to be + * used by Retrofit to perform actually REST calls. + */ + interface ClustersService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.hdinsight.v2018_06_01_preview.Clusters create" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}") + Observable> create(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Query("api-version") String apiVersion, @Body ClusterCreateParametersExtended parameters, @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.hdinsight.v2018_06_01_preview.Clusters beginCreate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}") + Observable> beginCreate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Query("api-version") String apiVersion, @Body ClusterCreateParametersExtended parameters, @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.hdinsight.v2018_06_01_preview.Clusters update" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}") + Observable> update(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body ClusterPatchParameters parameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.hdinsight.v2018_06_01_preview.Clusters delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @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.hdinsight.v2018_06_01_preview.Clusters beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @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.hdinsight.v2018_06_01_preview.Clusters getByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}") + Observable> getByResourceGroup(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @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.hdinsight.v2018_06_01_preview.Clusters listByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters") + 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.hdinsight.v2018_06_01_preview.Clusters resize" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/roles/{roleName}/resize") + Observable> resize(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Path("roleName") String roleName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body ClusterResizeParameters parameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.hdinsight.v2018_06_01_preview.Clusters beginResize" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/roles/{roleName}/resize") + Observable> beginResize(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Path("roleName") String roleName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body ClusterResizeParameters parameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.hdinsight.v2018_06_01_preview.Clusters list" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.HDInsight/clusters") + 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.hdinsight.v2018_06_01_preview.Clusters executeScriptActions" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/executeScriptActions") + Observable> executeScriptActions(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Query("api-version") String apiVersion, @Body ExecuteScriptActionParameters parameters, @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.hdinsight.v2018_06_01_preview.Clusters beginExecuteScriptActions" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/executeScriptActions") + Observable> beginExecuteScriptActions(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Query("api-version") String apiVersion, @Body ExecuteScriptActionParameters parameters, @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.hdinsight.v2018_06_01_preview.Clusters listByResourceGroupNext" }) + @GET + Observable> listByResourceGroupNext(@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.hdinsight.v2018_06_01_preview.Clusters listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Creates a new HDInsight cluster with the specified parameters. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param parameters The cluster create request. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ClusterInner object if successful. + */ + public ClusterInner create(String resourceGroupName, String clusterName, ClusterCreateParametersExtended parameters) { + return createWithServiceResponseAsync(resourceGroupName, clusterName, parameters).toBlocking().last().body(); + } + + /** + * Creates a new HDInsight cluster with the specified parameters. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param parameters The cluster create request. + * @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 createAsync(String resourceGroupName, String clusterName, ClusterCreateParametersExtended parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createWithServiceResponseAsync(resourceGroupName, clusterName, parameters), serviceCallback); + } + + /** + * Creates a new HDInsight cluster with the specified parameters. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param parameters The cluster create request. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createAsync(String resourceGroupName, String clusterName, ClusterCreateParametersExtended parameters) { + return createWithServiceResponseAsync(resourceGroupName, clusterName, parameters).map(new Func1, ClusterInner>() { + @Override + public ClusterInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates a new HDInsight cluster with the specified parameters. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param parameters The cluster create request. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createWithServiceResponseAsync(String resourceGroupName, String clusterName, ClusterCreateParametersExtended parameters) { + 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 (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName 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 (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + Observable> observable = service.create(this.client.subscriptionId(), resourceGroupName, clusterName, this.client.apiVersion(), parameters, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Creates a new HDInsight cluster with the specified parameters. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param parameters The cluster create request. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ClusterInner object if successful. + */ + public ClusterInner beginCreate(String resourceGroupName, String clusterName, ClusterCreateParametersExtended parameters) { + return beginCreateWithServiceResponseAsync(resourceGroupName, clusterName, parameters).toBlocking().single().body(); + } + + /** + * Creates a new HDInsight cluster with the specified parameters. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param parameters The cluster create request. + * @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 beginCreateAsync(String resourceGroupName, String clusterName, ClusterCreateParametersExtended parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateWithServiceResponseAsync(resourceGroupName, clusterName, parameters), serviceCallback); + } + + /** + * Creates a new HDInsight cluster with the specified parameters. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param parameters The cluster create request. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ClusterInner object + */ + public Observable beginCreateAsync(String resourceGroupName, String clusterName, ClusterCreateParametersExtended parameters) { + return beginCreateWithServiceResponseAsync(resourceGroupName, clusterName, parameters).map(new Func1, ClusterInner>() { + @Override + public ClusterInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates a new HDInsight cluster with the specified parameters. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param parameters The cluster create request. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ClusterInner object + */ + public Observable> beginCreateWithServiceResponseAsync(String resourceGroupName, String clusterName, ClusterCreateParametersExtended parameters) { + 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 (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName 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 (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + return service.beginCreate(this.client.subscriptionId(), resourceGroupName, clusterName, this.client.apiVersion(), parameters, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Patch HDInsight cluster with the specified parameters. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ClusterInner object if successful. + */ + public ClusterInner update(String resourceGroupName, String clusterName) { + return updateWithServiceResponseAsync(resourceGroupName, clusterName).toBlocking().single().body(); + } + + /** + * Patch HDInsight cluster with the specified parameters. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @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 clusterName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, clusterName), serviceCallback); + } + + /** + * Patch HDInsight cluster with the specified parameters. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ClusterInner object + */ + public Observable updateAsync(String resourceGroupName, String clusterName) { + return updateWithServiceResponseAsync(resourceGroupName, clusterName).map(new Func1, ClusterInner>() { + @Override + public ClusterInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Patch HDInsight cluster with the specified parameters. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ClusterInner object + */ + public Observable> updateWithServiceResponseAsync(String resourceGroupName, String clusterName) { + 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 (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName 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; + ClusterPatchParameters parameters = new ClusterPatchParameters(); + parameters.withTags(null); + return service.update(this.client.subscriptionId(), resourceGroupName, clusterName, this.client.apiVersion(), this.client.acceptLanguage(), parameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = updateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Patch HDInsight cluster with the specified parameters. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param tags The resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ClusterInner object if successful. + */ + public ClusterInner update(String resourceGroupName, String clusterName, Map tags) { + return updateWithServiceResponseAsync(resourceGroupName, clusterName, tags).toBlocking().single().body(); + } + + /** + * Patch HDInsight cluster with the specified parameters. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param tags The resource 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 clusterName, Map tags, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, clusterName, tags), serviceCallback); + } + + /** + * Patch HDInsight cluster with the specified parameters. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param tags The resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ClusterInner object + */ + public Observable updateAsync(String resourceGroupName, String clusterName, Map tags) { + return updateWithServiceResponseAsync(resourceGroupName, clusterName, tags).map(new Func1, ClusterInner>() { + @Override + public ClusterInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Patch HDInsight cluster with the specified parameters. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param tags The resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ClusterInner object + */ + public Observable> updateWithServiceResponseAsync(String resourceGroupName, String clusterName, 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 (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName 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); + ClusterPatchParameters parameters = new ClusterPatchParameters(); + parameters.withTags(tags); + return service.update(this.client.subscriptionId(), resourceGroupName, clusterName, this.client.apiVersion(), this.client.acceptLanguage(), parameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = updateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse updateDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Deletes the specified HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException 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 clusterName) { + deleteWithServiceResponseAsync(resourceGroupName, clusterName).toBlocking().last().body(); + } + + /** + * Deletes the specified HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @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 clusterName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, clusterName), serviceCallback); + } + + /** + * Deletes the specified HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String clusterName) { + return deleteWithServiceResponseAsync(resourceGroupName, clusterName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the specified HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String clusterName) { + 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 (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName 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, clusterName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Deletes the specified HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException 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 clusterName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, clusterName).toBlocking().single().body(); + } + + /** + * Deletes the specified HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @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 clusterName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, clusterName), serviceCallback); + } + + /** + * Deletes the specified HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String clusterName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, clusterName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the specified HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String clusterName) { + 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 (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName 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, clusterName, 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 ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Gets the specified cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ClusterInner object if successful. + */ + public ClusterInner getByResourceGroup(String resourceGroupName, String clusterName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, clusterName).toBlocking().single().body(); + } + + /** + * Gets the specified cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @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 clusterName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getByResourceGroupWithServiceResponseAsync(resourceGroupName, clusterName), serviceCallback); + } + + /** + * Gets the specified cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ClusterInner object + */ + public Observable getByResourceGroupAsync(String resourceGroupName, String clusterName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, clusterName).map(new Func1, ClusterInner>() { + @Override + public ClusterInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the specified cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ClusterInner object + */ + public Observable> getByResourceGroupWithServiceResponseAsync(String resourceGroupName, String clusterName) { + 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 (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName 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, clusterName, 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 ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Lists the HDInsight clusters in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException 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<ClusterInner> 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(); + } + }; + } + + /** + * Lists the HDInsight clusters in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupAsync(final String resourceGroupName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupSinglePageAsync(resourceGroupName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists the HDInsight clusters in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ClusterInner> object + */ + public Observable> listByResourceGroupAsync(final String resourceGroupName) { + return listByResourceGroupWithServiceResponseAsync(resourceGroupName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists the HDInsight clusters in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ClusterInner> 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)); + } + }); + } + + /** + * Lists the HDInsight clusters in a resource group. + * + ServiceResponse> * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ClusterInner> 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 ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Resizes the specified HDInsight cluster to the specified size. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void resize(String resourceGroupName, String clusterName) { + resizeWithServiceResponseAsync(resourceGroupName, clusterName).toBlocking().last().body(); + } + + /** + * Resizes the specified HDInsight cluster to the specified size. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @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 resizeAsync(String resourceGroupName, String clusterName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(resizeWithServiceResponseAsync(resourceGroupName, clusterName), serviceCallback); + } + + /** + * Resizes the specified HDInsight cluster to the specified size. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable resizeAsync(String resourceGroupName, String clusterName) { + return resizeWithServiceResponseAsync(resourceGroupName, clusterName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Resizes the specified HDInsight cluster to the specified size. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> resizeWithServiceResponseAsync(String resourceGroupName, String clusterName) { + 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 (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName 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 String roleName = "workernode"; + final Integer targetInstanceCount = null; + ClusterResizeParameters parameters = new ClusterResizeParameters(); + parameters.withTargetInstanceCount(null); + Observable> observable = service.resize(this.client.subscriptionId(), resourceGroupName, clusterName, roleName, this.client.apiVersion(), this.client.acceptLanguage(), parameters, this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + /** + * Resizes the specified HDInsight cluster to the specified size. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param targetInstanceCount The target instance count for the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void resize(String resourceGroupName, String clusterName, Integer targetInstanceCount) { + resizeWithServiceResponseAsync(resourceGroupName, clusterName, targetInstanceCount).toBlocking().last().body(); + } + + /** + * Resizes the specified HDInsight cluster to the specified size. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param targetInstanceCount The target instance count for the operation. + * @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 resizeAsync(String resourceGroupName, String clusterName, Integer targetInstanceCount, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(resizeWithServiceResponseAsync(resourceGroupName, clusterName, targetInstanceCount), serviceCallback); + } + + /** + * Resizes the specified HDInsight cluster to the specified size. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param targetInstanceCount The target instance count for the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable resizeAsync(String resourceGroupName, String clusterName, Integer targetInstanceCount) { + return resizeWithServiceResponseAsync(resourceGroupName, clusterName, targetInstanceCount).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Resizes the specified HDInsight cluster to the specified size. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param targetInstanceCount The target instance count for the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> resizeWithServiceResponseAsync(String resourceGroupName, String clusterName, Integer targetInstanceCount) { + 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 (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName 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 String roleName = "workernode"; + ClusterResizeParameters parameters = new ClusterResizeParameters(); + parameters.withTargetInstanceCount(targetInstanceCount); + Observable> observable = service.resize(this.client.subscriptionId(), resourceGroupName, clusterName, roleName, this.client.apiVersion(), this.client.acceptLanguage(), parameters, this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Resizes the specified HDInsight cluster to the specified size. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginResize(String resourceGroupName, String clusterName) { + beginResizeWithServiceResponseAsync(resourceGroupName, clusterName).toBlocking().single().body(); + } + + /** + * Resizes the specified HDInsight cluster to the specified size. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @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 beginResizeAsync(String resourceGroupName, String clusterName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginResizeWithServiceResponseAsync(resourceGroupName, clusterName), serviceCallback); + } + + /** + * Resizes the specified HDInsight cluster to the specified size. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginResizeAsync(String resourceGroupName, String clusterName) { + return beginResizeWithServiceResponseAsync(resourceGroupName, clusterName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Resizes the specified HDInsight cluster to the specified size. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginResizeWithServiceResponseAsync(String resourceGroupName, String clusterName) { + 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 (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName 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 String roleName = "workernode"; + final Integer targetInstanceCount = null; + ClusterResizeParameters parameters = new ClusterResizeParameters(); + parameters.withTargetInstanceCount(null); + return service.beginResize(this.client.subscriptionId(), resourceGroupName, clusterName, roleName, this.client.apiVersion(), this.client.acceptLanguage(), parameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginResizeDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Resizes the specified HDInsight cluster to the specified size. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param targetInstanceCount The target instance count for the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginResize(String resourceGroupName, String clusterName, Integer targetInstanceCount) { + beginResizeWithServiceResponseAsync(resourceGroupName, clusterName, targetInstanceCount).toBlocking().single().body(); + } + + /** + * Resizes the specified HDInsight cluster to the specified size. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param targetInstanceCount The target instance count for the operation. + * @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 beginResizeAsync(String resourceGroupName, String clusterName, Integer targetInstanceCount, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginResizeWithServiceResponseAsync(resourceGroupName, clusterName, targetInstanceCount), serviceCallback); + } + + /** + * Resizes the specified HDInsight cluster to the specified size. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param targetInstanceCount The target instance count for the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginResizeAsync(String resourceGroupName, String clusterName, Integer targetInstanceCount) { + return beginResizeWithServiceResponseAsync(resourceGroupName, clusterName, targetInstanceCount).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Resizes the specified HDInsight cluster to the specified size. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param targetInstanceCount The target instance count for the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginResizeWithServiceResponseAsync(String resourceGroupName, String clusterName, Integer targetInstanceCount) { + 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 (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName 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 String roleName = "workernode"; + ClusterResizeParameters parameters = new ClusterResizeParameters(); + parameters.withTargetInstanceCount(targetInstanceCount); + return service.beginResize(this.client.subscriptionId(), resourceGroupName, clusterName, roleName, this.client.apiVersion(), this.client.acceptLanguage(), parameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginResizeDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginResizeDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Lists all the HDInsight clusters under the subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException 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<ClusterInner> 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 the HDInsight clusters under the 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); + } + + /** + * Lists all the HDInsight clusters under the subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ClusterInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all the HDInsight clusters under the subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ClusterInner> 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 the HDInsight clusters under the subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ClusterInner> 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 ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Executes script actions on the specified HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param parameters The parameters for executing script actions. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void executeScriptActions(String resourceGroupName, String clusterName, ExecuteScriptActionParameters parameters) { + executeScriptActionsWithServiceResponseAsync(resourceGroupName, clusterName, parameters).toBlocking().last().body(); + } + + /** + * Executes script actions on the specified HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param parameters The parameters for executing script actions. + * @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 executeScriptActionsAsync(String resourceGroupName, String clusterName, ExecuteScriptActionParameters parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(executeScriptActionsWithServiceResponseAsync(resourceGroupName, clusterName, parameters), serviceCallback); + } + + /** + * Executes script actions on the specified HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param parameters The parameters for executing script actions. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable executeScriptActionsAsync(String resourceGroupName, String clusterName, ExecuteScriptActionParameters parameters) { + return executeScriptActionsWithServiceResponseAsync(resourceGroupName, clusterName, parameters).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Executes script actions on the specified HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param parameters The parameters for executing script actions. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> executeScriptActionsWithServiceResponseAsync(String resourceGroupName, String clusterName, ExecuteScriptActionParameters parameters) { + 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 (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName 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 (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + Observable> observable = service.executeScriptActions(this.client.subscriptionId(), resourceGroupName, clusterName, this.client.apiVersion(), parameters, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Executes script actions on the specified HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param parameters The parameters for executing script actions. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginExecuteScriptActions(String resourceGroupName, String clusterName, ExecuteScriptActionParameters parameters) { + beginExecuteScriptActionsWithServiceResponseAsync(resourceGroupName, clusterName, parameters).toBlocking().single().body(); + } + + /** + * Executes script actions on the specified HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param parameters The parameters for executing script actions. + * @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 beginExecuteScriptActionsAsync(String resourceGroupName, String clusterName, ExecuteScriptActionParameters parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginExecuteScriptActionsWithServiceResponseAsync(resourceGroupName, clusterName, parameters), serviceCallback); + } + + /** + * Executes script actions on the specified HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param parameters The parameters for executing script actions. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginExecuteScriptActionsAsync(String resourceGroupName, String clusterName, ExecuteScriptActionParameters parameters) { + return beginExecuteScriptActionsWithServiceResponseAsync(resourceGroupName, clusterName, parameters).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Executes script actions on the specified HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param parameters The parameters for executing script actions. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginExecuteScriptActionsWithServiceResponseAsync(String resourceGroupName, String clusterName, ExecuteScriptActionParameters parameters) { + 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 (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName 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 (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + return service.beginExecuteScriptActions(this.client.subscriptionId(), resourceGroupName, clusterName, this.client.apiVersion(), parameters, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginExecuteScriptActionsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginExecuteScriptActionsDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Lists the HDInsight clusters 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 ErrorResponseException 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<ClusterInner> 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(); + } + }; + } + + /** + * Lists the HDInsight clusters 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); + } + + /** + * Lists the HDInsight clusters 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<ClusterInner> object + */ + public Observable> listByResourceGroupNextAsync(final String nextPageLink) { + return listByResourceGroupNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists the HDInsight clusters 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<ClusterInner> 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)); + } + }); + } + + /** + * Lists the HDInsight clusters 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<ClusterInner> 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 ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Lists all the HDInsight clusters under the subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException 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<ClusterInner> 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 the HDInsight clusters under the 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); + } + + /** + * Lists all the HDInsight clusters under the 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<ClusterInner> 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 the HDInsight clusters under the 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<ClusterInner> 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 the HDInsight clusters under the 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<ClusterInner> 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 ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + +} diff --git a/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/implementation/ConfigurationsImpl.java b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/implementation/ConfigurationsImpl.java new file mode 100644 index 000000000000..971b89020a94 --- /dev/null +++ b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/implementation/ConfigurationsImpl.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. + * abc + */ + +package com.microsoft.azure.management.hdinsight.v2018_06_01_preview.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.hdinsight.v2018_06_01_preview.Configurations; +import rx.Completable; +import rx.functions.Func1; +import rx.Observable; +import java.util.Map; + +class ConfigurationsImpl extends WrapperImpl implements Configurations { + private final HDInsightManager manager; + + ConfigurationsImpl(HDInsightManager manager) { + super(manager.inner().configurations()); + this.manager = manager; + } + + public HDInsightManager manager() { + return this.manager; + } + + @Override + public Completable updateAsync(String resourceGroupName, String clusterName, String configurationName, Map parameters) { + ConfigurationsInner client = this.inner(); + return client.updateAsync(resourceGroupName, clusterName, configurationName, parameters).toCompletable(); + } + + @Override + public Observable> getAsync(String resourceGroupName, String clusterName, String configurationName) { + ConfigurationsInner client = this.inner(); + return client.getAsync(resourceGroupName, clusterName, configurationName) + ;} + +} diff --git a/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/implementation/ConfigurationsInner.java b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/implementation/ConfigurationsInner.java new file mode 100644 index 000000000000..3a640c76aa9e --- /dev/null +++ b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/implementation/ConfigurationsInner.java @@ -0,0 +1,350 @@ +/** + * 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.hdinsight.v2018_06_01_preview.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.management.hdinsight.v2018_06_01_preview.ErrorResponseException; +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.Map; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Path; +import retrofit2.http.POST; +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 Configurations. + */ +public class ConfigurationsInner { + /** The Retrofit service to perform REST calls. */ + private ConfigurationsService service; + /** The service client containing this operation class. */ + private HDInsightManagementClientImpl client; + + /** + * Initializes an instance of ConfigurationsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public ConfigurationsInner(Retrofit retrofit, HDInsightManagementClientImpl client) { + this.service = retrofit.create(ConfigurationsService.class); + this.client = client; + } + + /** + * The interface defining all the services for Configurations to be + * used by Retrofit to perform actually REST calls. + */ + interface ConfigurationsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.hdinsight.v2018_06_01_preview.Configurations update" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/configurations/{configurationName}") + Observable> update(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Path("configurationName") String configurationName, @Query("api-version") String apiVersion, @Body Map parameters, @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.hdinsight.v2018_06_01_preview.Configurations beginUpdate" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/configurations/{configurationName}") + Observable> beginUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Path("configurationName") String configurationName, @Query("api-version") String apiVersion, @Body Map parameters, @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.hdinsight.v2018_06_01_preview.Configurations get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/configurations/{configurationName}") + Observable> get(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Path("configurationName") String configurationName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Configures the configuration on the specified cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param configurationName The name of the cluster configuration. + * @param parameters The cluster configurations. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void update(String resourceGroupName, String clusterName, String configurationName, Map parameters) { + updateWithServiceResponseAsync(resourceGroupName, clusterName, configurationName, parameters).toBlocking().last().body(); + } + + /** + * Configures the configuration on the specified cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param configurationName The name of the cluster configuration. + * @param parameters The cluster configurations. + * @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 clusterName, String configurationName, Map parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, clusterName, configurationName, parameters), serviceCallback); + } + + /** + * Configures the configuration on the specified cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param configurationName The name of the cluster configuration. + * @param parameters The cluster configurations. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable updateAsync(String resourceGroupName, String clusterName, String configurationName, Map parameters) { + return updateWithServiceResponseAsync(resourceGroupName, clusterName, configurationName, parameters).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Configures the configuration on the specified cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param configurationName The name of the cluster configuration. + * @param parameters The cluster configurations. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> updateWithServiceResponseAsync(String resourceGroupName, String clusterName, String configurationName, Map parameters) { + 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 (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName is required and cannot be null."); + } + if (configurationName == null) { + throw new IllegalArgumentException("Parameter configurationName 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 (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + Observable> observable = service.update(this.client.subscriptionId(), resourceGroupName, clusterName, configurationName, this.client.apiVersion(), parameters, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Configures the configuration on the specified cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param configurationName The name of the cluster configuration. + * @param parameters The cluster configurations. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginUpdate(String resourceGroupName, String clusterName, String configurationName, Map parameters) { + beginUpdateWithServiceResponseAsync(resourceGroupName, clusterName, configurationName, parameters).toBlocking().single().body(); + } + + /** + * Configures the configuration on the specified cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param configurationName The name of the cluster configuration. + * @param parameters The cluster configurations. + * @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 clusterName, String configurationName, Map parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateWithServiceResponseAsync(resourceGroupName, clusterName, configurationName, parameters), serviceCallback); + } + + /** + * Configures the configuration on the specified cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param configurationName The name of the cluster configuration. + * @param parameters The cluster configurations. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginUpdateAsync(String resourceGroupName, String clusterName, String configurationName, Map parameters) { + return beginUpdateWithServiceResponseAsync(resourceGroupName, clusterName, configurationName, parameters).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Configures the configuration on the specified cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param configurationName The name of the cluster configuration. + * @param parameters The cluster configurations. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginUpdateWithServiceResponseAsync(String resourceGroupName, String clusterName, String configurationName, Map parameters) { + 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 (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName is required and cannot be null."); + } + if (configurationName == null) { + throw new IllegalArgumentException("Parameter configurationName 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 (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + return service.beginUpdate(this.client.subscriptionId(), resourceGroupName, clusterName, configurationName, this.client.apiVersion(), parameters, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginUpdateDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * The configuration object for the specified cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param configurationName The name of the cluster configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Map<String, String> object if successful. + */ + public Map get(String resourceGroupName, String clusterName, String configurationName) { + return getWithServiceResponseAsync(resourceGroupName, clusterName, configurationName).toBlocking().single().body(); + } + + /** + * The configuration object for the specified cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param configurationName The name of the cluster configuration. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> getAsync(String resourceGroupName, String clusterName, String configurationName, final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, clusterName, configurationName), serviceCallback); + } + + /** + * The configuration object for the specified cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param configurationName The name of the cluster configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Map<String, String> object + */ + public Observable> getAsync(String resourceGroupName, String clusterName, String configurationName) { + return getWithServiceResponseAsync(resourceGroupName, clusterName, configurationName).map(new Func1>, Map>() { + @Override + public Map call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * The configuration object for the specified cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param configurationName The name of the cluster configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Map<String, String> object + */ + public Observable>> getWithServiceResponseAsync(String resourceGroupName, String clusterName, String configurationName) { + 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 (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName is required and cannot be null."); + } + if (configurationName == null) { + throw new IllegalArgumentException("Parameter configurationName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.get(this.client.subscriptionId(), resourceGroupName, clusterName, configurationName, 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 ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + +} diff --git a/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/implementation/ExtensionImpl.java b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/implementation/ExtensionImpl.java new file mode 100644 index 000000000000..481b76829068 --- /dev/null +++ b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/implementation/ExtensionImpl.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.hdinsight.v2018_06_01_preview.implementation; + +import com.microsoft.azure.management.hdinsight.v2018_06_01_preview.Extension; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import rx.Observable; + +class ExtensionImpl extends WrapperImpl implements Extension { + private final HDInsightManager manager; + private String resourceGroupName; + private String clusterName; + private String extensionName; + + ExtensionImpl(ExtensionInner inner, HDInsightManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public HDInsightManager manager() { + return this.manager; + } + + + + @Override + public String primaryKey() { + return this.inner().primaryKey(); + } + + @Override + public String workspaceId() { + return this.inner().workspaceId(); + } + +} diff --git a/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/implementation/ExtensionInner.java b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/implementation/ExtensionInner.java new file mode 100644 index 000000000000..d8dd27791b89 --- /dev/null +++ b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/implementation/ExtensionInner.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.hdinsight.v2018_06_01_preview.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Cluster monitoring extensions. + */ +public class ExtensionInner { + /** + * The workspace ID for the cluster monitoring extension. + */ + @JsonProperty(value = "workspaceId") + private String workspaceId; + + /** + * The certificate for the cluster monitoring extensions. + */ + @JsonProperty(value = "primaryKey") + private String primaryKey; + + /** + * Get the workspace ID for the cluster monitoring extension. + * + * @return the workspaceId value + */ + public String workspaceId() { + return this.workspaceId; + } + + /** + * Set the workspace ID for the cluster monitoring extension. + * + * @param workspaceId the workspaceId value to set + * @return the ExtensionInner object itself. + */ + public ExtensionInner withWorkspaceId(String workspaceId) { + this.workspaceId = workspaceId; + return this; + } + + /** + * Get the certificate for the cluster monitoring extensions. + * + * @return the primaryKey value + */ + public String primaryKey() { + return this.primaryKey; + } + + /** + * Set the certificate for the cluster monitoring extensions. + * + * @param primaryKey the primaryKey value to set + * @return the ExtensionInner object itself. + */ + public ExtensionInner withPrimaryKey(String primaryKey) { + this.primaryKey = primaryKey; + return this; + } + +} diff --git a/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/implementation/ExtensionsImpl.java b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/implementation/ExtensionsImpl.java new file mode 100644 index 000000000000..e4a1db3fe5ae --- /dev/null +++ b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/implementation/ExtensionsImpl.java @@ -0,0 +1,85 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * + */ + +package com.microsoft.azure.management.hdinsight.v2018_06_01_preview.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.hdinsight.v2018_06_01_preview.Extensions; +import rx.Completable; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.management.hdinsight.v2018_06_01_preview.ClusterMonitoringResponse; +import com.microsoft.azure.management.hdinsight.v2018_06_01_preview.Extension; +import com.microsoft.azure.management.hdinsight.v2018_06_01_preview.ClusterMonitoringRequest; + +class ExtensionsImpl extends WrapperImpl implements Extensions { + private final HDInsightManager manager; + + ExtensionsImpl(HDInsightManager manager) { + super(manager.inner().extensions()); + this.manager = manager; + } + + public HDInsightManager manager() { + return this.manager; + } + + private ExtensionImpl wrapModel(ExtensionInner inner) { + return new ExtensionImpl(inner, manager()); + } + + @Override + public Observable getMonitoringStatusAsync(String resourceGroupName, String clusterName) { + ExtensionsInner client = this.inner(); + return client.getMonitoringStatusAsync(resourceGroupName, clusterName) + .map(new Func1() { + @Override + public ClusterMonitoringResponse call(ClusterMonitoringResponseInner inner) { + return new ClusterMonitoringResponseImpl(inner, manager()); + } + }); + } + + @Override + public Completable disableMonitoringAsync(String resourceGroupName, String clusterName) { + ExtensionsInner client = this.inner(); + return client.disableMonitoringAsync(resourceGroupName, clusterName).toCompletable(); + } + + @Override + public Observable getAsync(String resourceGroupName, String clusterName, String extensionName) { + ExtensionsInner client = this.inner(); + return client.getAsync(resourceGroupName, clusterName, extensionName) + .map(new Func1() { + @Override + public Extension call(ExtensionInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Completable deleteAsync(String resourceGroupName, String clusterName, String extensionName) { + ExtensionsInner client = this.inner(); + return client.deleteAsync(resourceGroupName, clusterName, extensionName).toCompletable(); + } + + @Override + public Completable enableMonitoringAsync(String resourceGroupName, String clusterName, ClusterMonitoringRequest parameters) { + ExtensionsInner client = this.inner(); + return client.enableMonitoringAsync(resourceGroupName, clusterName, parameters).toCompletable(); + } + + @Override + public Completable createAsync(String resourceGroupName, String clusterName, String extensionName, ExtensionInner parameters) { + ExtensionsInner client = this.inner(); + return client.createAsync(resourceGroupName, clusterName, extensionName, parameters).toCompletable(); + } + +} diff --git a/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/implementation/ExtensionsInner.java b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/implementation/ExtensionsInner.java new file mode 100644 index 000000000000..c9f8ed736064 --- /dev/null +++ b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/implementation/ExtensionsInner.java @@ -0,0 +1,956 @@ +/** + * 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.hdinsight.v2018_06_01_preview.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.management.hdinsight.v2018_06_01_preview.ClusterMonitoringRequest; +import com.microsoft.azure.management.hdinsight.v2018_06_01_preview.ErrorResponseException; +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 okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.Path; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Extensions. + */ +public class ExtensionsInner { + /** The Retrofit service to perform REST calls. */ + private ExtensionsService service; + /** The service client containing this operation class. */ + private HDInsightManagementClientImpl client; + + /** + * Initializes an instance of ExtensionsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public ExtensionsInner(Retrofit retrofit, HDInsightManagementClientImpl client) { + this.service = retrofit.create(ExtensionsService.class); + this.client = client; + } + + /** + * The interface defining all the services for Extensions to be + * used by Retrofit to perform actually REST calls. + */ + interface ExtensionsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.hdinsight.v2018_06_01_preview.Extensions enableMonitoring" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/extensions/clustermonitoring") + Observable> enableMonitoring(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Query("api-version") String apiVersion, @Body ClusterMonitoringRequest parameters, @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.hdinsight.v2018_06_01_preview.Extensions beginEnableMonitoring" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/extensions/clustermonitoring") + Observable> beginEnableMonitoring(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Query("api-version") String apiVersion, @Body ClusterMonitoringRequest parameters, @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.hdinsight.v2018_06_01_preview.Extensions getMonitoringStatus" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/extensions/clustermonitoring") + Observable> getMonitoringStatus(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @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.hdinsight.v2018_06_01_preview.Extensions disableMonitoring" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/extensions/clustermonitoring", method = "DELETE", hasBody = true) + Observable> disableMonitoring(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @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.hdinsight.v2018_06_01_preview.Extensions beginDisableMonitoring" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/extensions/clustermonitoring", method = "DELETE", hasBody = true) + Observable> beginDisableMonitoring(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @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.hdinsight.v2018_06_01_preview.Extensions create" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/extensions/{extensionName}") + Observable> create(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Path("extensionName") String extensionName, @Query("api-version") String apiVersion, @Body ExtensionInner parameters, @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.hdinsight.v2018_06_01_preview.Extensions beginCreate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/extensions/{extensionName}") + Observable> beginCreate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Path("extensionName") String extensionName, @Query("api-version") String apiVersion, @Body ExtensionInner parameters, @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.hdinsight.v2018_06_01_preview.Extensions get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/extensions/{extensionName}") + Observable> get(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Path("extensionName") String extensionName, @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.hdinsight.v2018_06_01_preview.Extensions delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/extensions/{extensionName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Path("extensionName") String extensionName, @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.hdinsight.v2018_06_01_preview.Extensions beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/extensions/{extensionName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Path("extensionName") String extensionName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Enables the Operations Management Suite (OMS) on the HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param parameters The Operations Management Suite (OMS) workspace parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void enableMonitoring(String resourceGroupName, String clusterName, ClusterMonitoringRequest parameters) { + enableMonitoringWithServiceResponseAsync(resourceGroupName, clusterName, parameters).toBlocking().last().body(); + } + + /** + * Enables the Operations Management Suite (OMS) on the HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param parameters The Operations Management Suite (OMS) workspace parameters. + * @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 enableMonitoringAsync(String resourceGroupName, String clusterName, ClusterMonitoringRequest parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(enableMonitoringWithServiceResponseAsync(resourceGroupName, clusterName, parameters), serviceCallback); + } + + /** + * Enables the Operations Management Suite (OMS) on the HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param parameters The Operations Management Suite (OMS) workspace parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable enableMonitoringAsync(String resourceGroupName, String clusterName, ClusterMonitoringRequest parameters) { + return enableMonitoringWithServiceResponseAsync(resourceGroupName, clusterName, parameters).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Enables the Operations Management Suite (OMS) on the HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param parameters The Operations Management Suite (OMS) workspace parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> enableMonitoringWithServiceResponseAsync(String resourceGroupName, String clusterName, ClusterMonitoringRequest parameters) { + 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 (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName 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 (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + Observable> observable = service.enableMonitoring(this.client.subscriptionId(), resourceGroupName, clusterName, this.client.apiVersion(), parameters, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Enables the Operations Management Suite (OMS) on the HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param parameters The Operations Management Suite (OMS) workspace parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginEnableMonitoring(String resourceGroupName, String clusterName, ClusterMonitoringRequest parameters) { + beginEnableMonitoringWithServiceResponseAsync(resourceGroupName, clusterName, parameters).toBlocking().single().body(); + } + + /** + * Enables the Operations Management Suite (OMS) on the HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param parameters The Operations Management Suite (OMS) workspace parameters. + * @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 beginEnableMonitoringAsync(String resourceGroupName, String clusterName, ClusterMonitoringRequest parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginEnableMonitoringWithServiceResponseAsync(resourceGroupName, clusterName, parameters), serviceCallback); + } + + /** + * Enables the Operations Management Suite (OMS) on the HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param parameters The Operations Management Suite (OMS) workspace parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginEnableMonitoringAsync(String resourceGroupName, String clusterName, ClusterMonitoringRequest parameters) { + return beginEnableMonitoringWithServiceResponseAsync(resourceGroupName, clusterName, parameters).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Enables the Operations Management Suite (OMS) on the HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param parameters The Operations Management Suite (OMS) workspace parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginEnableMonitoringWithServiceResponseAsync(String resourceGroupName, String clusterName, ClusterMonitoringRequest parameters) { + 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 (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName 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 (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + return service.beginEnableMonitoring(this.client.subscriptionId(), resourceGroupName, clusterName, this.client.apiVersion(), parameters, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginEnableMonitoringDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginEnableMonitoringDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Gets the status of Operations Management Suite (OMS) on the HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ClusterMonitoringResponseInner object if successful. + */ + public ClusterMonitoringResponseInner getMonitoringStatus(String resourceGroupName, String clusterName) { + return getMonitoringStatusWithServiceResponseAsync(resourceGroupName, clusterName).toBlocking().single().body(); + } + + /** + * Gets the status of Operations Management Suite (OMS) on the HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @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 getMonitoringStatusAsync(String resourceGroupName, String clusterName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getMonitoringStatusWithServiceResponseAsync(resourceGroupName, clusterName), serviceCallback); + } + + /** + * Gets the status of Operations Management Suite (OMS) on the HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ClusterMonitoringResponseInner object + */ + public Observable getMonitoringStatusAsync(String resourceGroupName, String clusterName) { + return getMonitoringStatusWithServiceResponseAsync(resourceGroupName, clusterName).map(new Func1, ClusterMonitoringResponseInner>() { + @Override + public ClusterMonitoringResponseInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the status of Operations Management Suite (OMS) on the HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ClusterMonitoringResponseInner object + */ + public Observable> getMonitoringStatusWithServiceResponseAsync(String resourceGroupName, String clusterName) { + 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 (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName 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.getMonitoringStatus(this.client.subscriptionId(), resourceGroupName, clusterName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getMonitoringStatusDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getMonitoringStatusDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Disables the Operations Management Suite (OMS) on the HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void disableMonitoring(String resourceGroupName, String clusterName) { + disableMonitoringWithServiceResponseAsync(resourceGroupName, clusterName).toBlocking().last().body(); + } + + /** + * Disables the Operations Management Suite (OMS) on the HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @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 disableMonitoringAsync(String resourceGroupName, String clusterName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(disableMonitoringWithServiceResponseAsync(resourceGroupName, clusterName), serviceCallback); + } + + /** + * Disables the Operations Management Suite (OMS) on the HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable disableMonitoringAsync(String resourceGroupName, String clusterName) { + return disableMonitoringWithServiceResponseAsync(resourceGroupName, clusterName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Disables the Operations Management Suite (OMS) on the HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> disableMonitoringWithServiceResponseAsync(String resourceGroupName, String clusterName) { + 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 (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName 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.disableMonitoring(this.client.subscriptionId(), resourceGroupName, clusterName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Disables the Operations Management Suite (OMS) on the HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDisableMonitoring(String resourceGroupName, String clusterName) { + beginDisableMonitoringWithServiceResponseAsync(resourceGroupName, clusterName).toBlocking().single().body(); + } + + /** + * Disables the Operations Management Suite (OMS) on the HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @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 beginDisableMonitoringAsync(String resourceGroupName, String clusterName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDisableMonitoringWithServiceResponseAsync(resourceGroupName, clusterName), serviceCallback); + } + + /** + * Disables the Operations Management Suite (OMS) on the HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDisableMonitoringAsync(String resourceGroupName, String clusterName) { + return beginDisableMonitoringWithServiceResponseAsync(resourceGroupName, clusterName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Disables the Operations Management Suite (OMS) on the HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDisableMonitoringWithServiceResponseAsync(String resourceGroupName, String clusterName) { + 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 (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName 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.beginDisableMonitoring(this.client.subscriptionId(), resourceGroupName, clusterName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDisableMonitoringDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDisableMonitoringDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Creates an HDInsight cluster extension. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param extensionName The name of the cluster extension. + * @param parameters The cluster extensions create request. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void create(String resourceGroupName, String clusterName, String extensionName, ExtensionInner parameters) { + createWithServiceResponseAsync(resourceGroupName, clusterName, extensionName, parameters).toBlocking().last().body(); + } + + /** + * Creates an HDInsight cluster extension. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param extensionName The name of the cluster extension. + * @param parameters The cluster extensions create request. + * @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 createAsync(String resourceGroupName, String clusterName, String extensionName, ExtensionInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createWithServiceResponseAsync(resourceGroupName, clusterName, extensionName, parameters), serviceCallback); + } + + /** + * Creates an HDInsight cluster extension. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param extensionName The name of the cluster extension. + * @param parameters The cluster extensions create request. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createAsync(String resourceGroupName, String clusterName, String extensionName, ExtensionInner parameters) { + return createWithServiceResponseAsync(resourceGroupName, clusterName, extensionName, parameters).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates an HDInsight cluster extension. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param extensionName The name of the cluster extension. + * @param parameters The cluster extensions create request. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createWithServiceResponseAsync(String resourceGroupName, String clusterName, String extensionName, ExtensionInner parameters) { + 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 (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName is required and cannot be null."); + } + if (extensionName == null) { + throw new IllegalArgumentException("Parameter extensionName 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 (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + Observable> observable = service.create(this.client.subscriptionId(), resourceGroupName, clusterName, extensionName, this.client.apiVersion(), parameters, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Creates an HDInsight cluster extension. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param extensionName The name of the cluster extension. + * @param parameters The cluster extensions create request. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginCreate(String resourceGroupName, String clusterName, String extensionName, ExtensionInner parameters) { + beginCreateWithServiceResponseAsync(resourceGroupName, clusterName, extensionName, parameters).toBlocking().single().body(); + } + + /** + * Creates an HDInsight cluster extension. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param extensionName The name of the cluster extension. + * @param parameters The cluster extensions create request. + * @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 beginCreateAsync(String resourceGroupName, String clusterName, String extensionName, ExtensionInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateWithServiceResponseAsync(resourceGroupName, clusterName, extensionName, parameters), serviceCallback); + } + + /** + * Creates an HDInsight cluster extension. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param extensionName The name of the cluster extension. + * @param parameters The cluster extensions create request. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginCreateAsync(String resourceGroupName, String clusterName, String extensionName, ExtensionInner parameters) { + return beginCreateWithServiceResponseAsync(resourceGroupName, clusterName, extensionName, parameters).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates an HDInsight cluster extension. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param extensionName The name of the cluster extension. + * @param parameters The cluster extensions create request. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginCreateWithServiceResponseAsync(String resourceGroupName, String clusterName, String extensionName, ExtensionInner parameters) { + 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 (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName is required and cannot be null."); + } + if (extensionName == null) { + throw new IllegalArgumentException("Parameter extensionName 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 (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + return service.beginCreate(this.client.subscriptionId(), resourceGroupName, clusterName, extensionName, this.client.apiVersion(), parameters, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Gets the extension properties for the specified HDInsight cluster extension. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param extensionName The name of the cluster extension. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ExtensionInner object if successful. + */ + public ExtensionInner get(String resourceGroupName, String clusterName, String extensionName) { + return getWithServiceResponseAsync(resourceGroupName, clusterName, extensionName).toBlocking().single().body(); + } + + /** + * Gets the extension properties for the specified HDInsight cluster extension. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param extensionName The name of the cluster extension. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String resourceGroupName, String clusterName, String extensionName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, clusterName, extensionName), serviceCallback); + } + + /** + * Gets the extension properties for the specified HDInsight cluster extension. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param extensionName The name of the cluster extension. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ExtensionInner object + */ + public Observable getAsync(String resourceGroupName, String clusterName, String extensionName) { + return getWithServiceResponseAsync(resourceGroupName, clusterName, extensionName).map(new Func1, ExtensionInner>() { + @Override + public ExtensionInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the extension properties for the specified HDInsight cluster extension. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param extensionName The name of the cluster extension. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ExtensionInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String clusterName, String extensionName) { + 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 (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName is required and cannot be null."); + } + if (extensionName == null) { + throw new IllegalArgumentException("Parameter extensionName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.get(this.client.subscriptionId(), resourceGroupName, clusterName, extensionName, 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 ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Deletes the specified extension for HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param extensionName The name of the cluster extension. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException 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 clusterName, String extensionName) { + deleteWithServiceResponseAsync(resourceGroupName, clusterName, extensionName).toBlocking().last().body(); + } + + /** + * Deletes the specified extension for HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param extensionName The name of the cluster extension. + * @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 clusterName, String extensionName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, clusterName, extensionName), serviceCallback); + } + + /** + * Deletes the specified extension for HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param extensionName The name of the cluster extension. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String clusterName, String extensionName) { + return deleteWithServiceResponseAsync(resourceGroupName, clusterName, extensionName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the specified extension for HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param extensionName The name of the cluster extension. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String clusterName, String extensionName) { + 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 (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName is required and cannot be null."); + } + if (extensionName == null) { + throw new IllegalArgumentException("Parameter extensionName 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, clusterName, extensionName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Deletes the specified extension for HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param extensionName The name of the cluster extension. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException 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 clusterName, String extensionName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, clusterName, extensionName).toBlocking().single().body(); + } + + /** + * Deletes the specified extension for HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param extensionName The name of the cluster extension. + * @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 clusterName, String extensionName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, clusterName, extensionName), serviceCallback); + } + + /** + * Deletes the specified extension for HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param extensionName The name of the cluster extension. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String clusterName, String extensionName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, clusterName, extensionName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the specified extension for HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param extensionName The name of the cluster extension. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String clusterName, String extensionName) { + 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 (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName is required and cannot be null."); + } + if (extensionName == null) { + throw new IllegalArgumentException("Parameter extensionName 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, clusterName, extensionName, 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 ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + +} diff --git a/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/implementation/HDInsightManagementClientImpl.java b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/implementation/HDInsightManagementClientImpl.java new file mode 100644 index 000000000000..969d8f76cf06 --- /dev/null +++ b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/implementation/HDInsightManagementClientImpl.java @@ -0,0 +1,294 @@ +/** + * 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.hdinsight.v2018_06_01_preview.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 HDInsightManagementClientImpl class. + */ +public class HDInsightManagementClientImpl 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 credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. */ + private String subscriptionId; + + /** + * Gets The subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + * + * @return the subscriptionId value. + */ + public String subscriptionId() { + return this.subscriptionId; + } + + /** + * Sets The subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + * + * @param subscriptionId the subscriptionId value. + * @return the service client itself + */ + public HDInsightManagementClientImpl withSubscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; + return this; + } + + /** The HDInsight client API Version. */ + private String apiVersion; + + /** + * Gets The HDInsight client API Version. + * + * @return the apiVersion value. + */ + public String apiVersion() { + return this.apiVersion; + } + + /** The preferred language for the response. */ + private String acceptLanguage; + + /** + * Gets The preferred language for the response. + * + * @return the acceptLanguage value. + */ + public String acceptLanguage() { + return this.acceptLanguage; + } + + /** + * Sets The preferred language for the response. + * + * @param acceptLanguage the acceptLanguage value. + * @return the service client itself + */ + public HDInsightManagementClientImpl 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 HDInsightManagementClientImpl 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 HDInsightManagementClientImpl withGenerateClientRequestId(boolean generateClientRequestId) { + this.generateClientRequestId = generateClientRequestId; + return this; + } + + /** + * The ClustersInner object to access its operations. + */ + private ClustersInner clusters; + + /** + * Gets the ClustersInner object to access its operations. + * @return the ClustersInner object. + */ + public ClustersInner clusters() { + return this.clusters; + } + + /** + * The ApplicationsInner object to access its operations. + */ + private ApplicationsInner applications; + + /** + * Gets the ApplicationsInner object to access its operations. + * @return the ApplicationsInner object. + */ + public ApplicationsInner applications() { + return this.applications; + } + + /** + * The LocationsInner object to access its operations. + */ + private LocationsInner locations; + + /** + * Gets the LocationsInner object to access its operations. + * @return the LocationsInner object. + */ + public LocationsInner locations() { + return this.locations; + } + + /** + * The ConfigurationsInner object to access its operations. + */ + private ConfigurationsInner configurations; + + /** + * Gets the ConfigurationsInner object to access its operations. + * @return the ConfigurationsInner object. + */ + public ConfigurationsInner configurations() { + return this.configurations; + } + + /** + * The ExtensionsInner object to access its operations. + */ + private ExtensionsInner extensions; + + /** + * Gets the ExtensionsInner object to access its operations. + * @return the ExtensionsInner object. + */ + public ExtensionsInner extensions() { + return this.extensions; + } + + /** + * The ScriptActionsInner object to access its operations. + */ + private ScriptActionsInner scriptActions; + + /** + * Gets the ScriptActionsInner object to access its operations. + * @return the ScriptActionsInner object. + */ + public ScriptActionsInner scriptActions() { + return this.scriptActions; + } + + /** + * The ScriptExecutionHistorysInner object to access its operations. + */ + private ScriptExecutionHistorysInner scriptExecutionHistorys; + + /** + * Gets the ScriptExecutionHistorysInner object to access its operations. + * @return the ScriptExecutionHistorysInner object. + */ + public ScriptExecutionHistorysInner scriptExecutionHistorys() { + return this.scriptExecutionHistorys; + } + + /** + * 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; + } + + /** + * Initializes an instance of HDInsightManagementClient client. + * + * @param credentials the management credentials for Azure + */ + public HDInsightManagementClientImpl(ServiceClientCredentials credentials) { + this("https://management.azure.com", credentials); + } + + /** + * Initializes an instance of HDInsightManagementClient client. + * + * @param baseUrl the base URL of the host + * @param credentials the management credentials for Azure + */ + public HDInsightManagementClientImpl(String baseUrl, ServiceClientCredentials credentials) { + super(baseUrl, credentials); + initialize(); + } + + /** + * Initializes an instance of HDInsightManagementClient client. + * + * @param restClient the REST client to connect to Azure. + */ + public HDInsightManagementClientImpl(RestClient restClient) { + super(restClient); + initialize(); + } + + protected void initialize() { + this.apiVersion = "2018-06-01-preview"; + this.acceptLanguage = "en-US"; + this.longRunningOperationRetryTimeout = 30; + this.generateClientRequestId = true; + this.clusters = new ClustersInner(restClient().retrofit(), this); + this.applications = new ApplicationsInner(restClient().retrofit(), this); + this.locations = new LocationsInner(restClient().retrofit(), this); + this.configurations = new ConfigurationsInner(restClient().retrofit(), this); + this.extensions = new ExtensionsInner(restClient().retrofit(), this); + this.scriptActions = new ScriptActionsInner(restClient().retrofit(), this); + this.scriptExecutionHistorys = new ScriptExecutionHistorysInner(restClient().retrofit(), this); + this.operations = new OperationsInner(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(), "HDInsightManagementClient", "2018-06-01-preview"); + } +} diff --git a/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/implementation/HDInsightManager.java b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/implementation/HDInsightManager.java new file mode 100644 index 000000000000..ce22fb29a768 --- /dev/null +++ b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/implementation/HDInsightManager.java @@ -0,0 +1,183 @@ +/** + * 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.hdinsight.v2018_06_01_preview.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.hdinsight.v2018_06_01_preview.Clusters; +import com.microsoft.azure.management.hdinsight.v2018_06_01_preview.Applications; +import com.microsoft.azure.management.hdinsight.v2018_06_01_preview.Locations; +import com.microsoft.azure.management.hdinsight.v2018_06_01_preview.Configurations; +import com.microsoft.azure.management.hdinsight.v2018_06_01_preview.Extensions; +import com.microsoft.azure.management.hdinsight.v2018_06_01_preview.ScriptActions; +import com.microsoft.azure.management.hdinsight.v2018_06_01_preview.ScriptExecutionHistorys; +import com.microsoft.azure.management.hdinsight.v2018_06_01_preview.Operations; +import com.microsoft.azure.arm.resources.implementation.AzureConfigurableCoreImpl; +import com.microsoft.azure.arm.resources.implementation.ManagerCore; + +/** + * Entry point to Azure HDInsight resource management. + */ +public final class HDInsightManager extends ManagerCore { + private Clusters clusters; + private Applications applications; + private Locations locations; + private Configurations configurations; + private Extensions extensions; + private ScriptActions scriptActions; + private ScriptExecutionHistorys scriptExecutionHistorys; + private Operations operations; + /** + * Get a Configurable instance that can be used to create HDInsightManager with optional configuration. + * + * @return the instance allowing configurations + */ + public static Configurable configure() { + return new HDInsightManager.ConfigurableImpl(); + } + /** + * Creates an instance of HDInsightManager that exposes HDInsight resource management API entry points. + * + * @param credentials the credentials to use + * @param subscriptionId the subscription UUID + * @return the HDInsightManager + */ + public static HDInsightManager authenticate(AzureTokenCredentials credentials, String subscriptionId) { + return new HDInsightManager(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 HDInsightManager that exposes HDInsight resource management API entry points. + * + * @param restClient the RestClient to be used for API calls. + * @param subscriptionId the subscription UUID + * @return the HDInsightManager + */ + public static HDInsightManager authenticate(RestClient restClient, String subscriptionId) { + return new HDInsightManager(restClient, subscriptionId); + } + /** + * The interface allowing configurations to be set. + */ + public interface Configurable extends AzureConfigurable { + /** + * Creates an instance of HDInsightManager that exposes HDInsight management API entry points. + * + * @param credentials the credentials to use + * @param subscriptionId the subscription UUID + * @return the interface exposing HDInsight management API entry points that work across subscriptions + */ + HDInsightManager authenticate(AzureTokenCredentials credentials, String subscriptionId); + } + + /** + * @return Entry point to manage Clusters. + */ + public Clusters clusters() { + if (this.clusters == null) { + this.clusters = new ClustersImpl(this); + } + return this.clusters; + } + + /** + * @return Entry point to manage Applications. + */ + public Applications applications() { + if (this.applications == null) { + this.applications = new ApplicationsImpl(this); + } + return this.applications; + } + + /** + * @return Entry point to manage Locations. + */ + public Locations locations() { + if (this.locations == null) { + this.locations = new LocationsImpl(this); + } + return this.locations; + } + + /** + * @return Entry point to manage Configurations. + */ + public Configurations configurations() { + if (this.configurations == null) { + this.configurations = new ConfigurationsImpl(this); + } + return this.configurations; + } + + /** + * @return Entry point to manage Extensions. + */ + public Extensions extensions() { + if (this.extensions == null) { + this.extensions = new ExtensionsImpl(this); + } + return this.extensions; + } + + /** + * @return Entry point to manage ScriptActions. + */ + public ScriptActions scriptActions() { + if (this.scriptActions == null) { + this.scriptActions = new ScriptActionsImpl(this); + } + return this.scriptActions; + } + + /** + * @return Entry point to manage ScriptExecutionHistorys. + */ + public ScriptExecutionHistorys scriptExecutionHistorys() { + if (this.scriptExecutionHistorys == null) { + this.scriptExecutionHistorys = new ScriptExecutionHistorysImpl(this); + } + return this.scriptExecutionHistorys; + } + + /** + * @return Entry point to manage Operations. + */ + public Operations operations() { + if (this.operations == null) { + this.operations = new OperationsImpl(this); + } + return this.operations; + } + + /** + * The implementation for Configurable interface. + */ + private static final class ConfigurableImpl extends AzureConfigurableCoreImpl implements Configurable { + public HDInsightManager authenticate(AzureTokenCredentials credentials, String subscriptionId) { + return HDInsightManager.authenticate(buildRestClient(credentials), subscriptionId); + } + } + private HDInsightManager(RestClient restClient, String subscriptionId) { + super( + restClient, + subscriptionId, + new HDInsightManagementClientImpl(restClient).withSubscriptionId(subscriptionId)); + } +} diff --git a/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/implementation/IdParsingUtils.java b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/implementation/IdParsingUtils.java new file mode 100644 index 000000000000..d50eda2932c1 --- /dev/null +++ b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/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.hdinsight.v2018_06_01_preview.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/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/implementation/LocationsImpl.java b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/implementation/LocationsImpl.java new file mode 100644 index 000000000000..7dfe32719674 --- /dev/null +++ b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/implementation/LocationsImpl.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. + * abc + */ + +package com.microsoft.azure.management.hdinsight.v2018_06_01_preview.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.hdinsight.v2018_06_01_preview.Locations; +import rx.functions.Func1; +import rx.Observable; +import com.microsoft.azure.management.hdinsight.v2018_06_01_preview.UsagesListResult; + +class LocationsImpl extends WrapperImpl implements Locations { + private final HDInsightManager manager; + + LocationsImpl(HDInsightManager manager) { + super(manager.inner().locations()); + this.manager = manager; + } + + public HDInsightManager manager() { + return this.manager; + } + + @Override + public Observable listUsagesAsync(String location) { + LocationsInner client = this.inner(); + return client.listUsagesAsync(location) + .map(new Func1() { + @Override + public UsagesListResult call(UsagesListResultInner inner) { + return new UsagesListResultImpl(inner, manager()); + } + }); + } + +} diff --git a/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/implementation/LocationsInner.java b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/implementation/LocationsInner.java new file mode 100644 index 000000000000..f3ccae61412e --- /dev/null +++ b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/implementation/LocationsInner.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.hdinsight.v2018_06_01_preview.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.management.hdinsight.v2018_06_01_preview.ErrorResponseException; +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 Locations. + */ +public class LocationsInner { + /** The Retrofit service to perform REST calls. */ + private LocationsService service; + /** The service client containing this operation class. */ + private HDInsightManagementClientImpl client; + + /** + * Initializes an instance of LocationsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public LocationsInner(Retrofit retrofit, HDInsightManagementClientImpl client) { + this.service = retrofit.create(LocationsService.class); + this.client = client; + } + + /** + * The interface defining all the services for Locations to be + * used by Retrofit to perform actually REST calls. + */ + interface LocationsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.hdinsight.v2018_06_01_preview.Locations listUsages" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.HDInsight/locations/{location}/usages") + Observable> listUsages(@Path("subscriptionId") String subscriptionId, @Path("location") String location, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Lists the usages for the specified location. + * + * @param location The location to get capabilities for. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the UsagesListResultInner object if successful. + */ + public UsagesListResultInner listUsages(String location) { + return listUsagesWithServiceResponseAsync(location).toBlocking().single().body(); + } + + /** + * Lists the usages for the specified location. + * + * @param location The location to get capabilities for. + * @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 listUsagesAsync(String location, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(listUsagesWithServiceResponseAsync(location), serviceCallback); + } + + /** + * Lists the usages for the specified location. + * + * @param location The location to get capabilities for. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the UsagesListResultInner object + */ + public Observable listUsagesAsync(String location) { + return listUsagesWithServiceResponseAsync(location).map(new Func1, UsagesListResultInner>() { + @Override + public UsagesListResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Lists the usages for the specified location. + * + * @param location The location to get capabilities for. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the UsagesListResultInner object + */ + public Observable> listUsagesWithServiceResponseAsync(String location) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (location == null) { + throw new IllegalArgumentException("Parameter location 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.listUsages(this.client.subscriptionId(), location, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = listUsagesDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse listUsagesDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + +} diff --git a/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/implementation/OperationImpl.java b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/implementation/OperationImpl.java new file mode 100644 index 000000000000..1a26cab65fea --- /dev/null +++ b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/implementation/OperationImpl.java @@ -0,0 +1,37 @@ +/** + * 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.hdinsight.v2018_06_01_preview.implementation; + +import com.microsoft.azure.management.hdinsight.v2018_06_01_preview.Operation; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.hdinsight.v2018_06_01_preview.OperationDisplay; + +class OperationImpl extends WrapperImpl implements Operation { + private final HDInsightManager manager; + OperationImpl(OperationInner inner, HDInsightManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public HDInsightManager manager() { + return this.manager; + } + + @Override + public OperationDisplay display() { + return this.inner().display(); + } + + @Override + public String name() { + return this.inner().name(); + } + +} diff --git a/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/implementation/OperationInner.java b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/implementation/OperationInner.java new file mode 100644 index 000000000000..1baadaf05877 --- /dev/null +++ b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/implementation/OperationInner.java @@ -0,0 +1,70 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2018_06_01_preview.implementation; + +import com.microsoft.azure.management.hdinsight.v2018_06_01_preview.OperationDisplay; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The HDInsight REST API operation. + */ +public class OperationInner { + /** + * The operation name: {provider}/{resource}/{operation}. + */ + @JsonProperty(value = "name") + private String name; + + /** + * The object that represents the operation. + */ + @JsonProperty(value = "display") + private OperationDisplay display; + + /** + * Get the operation name: {provider}/{resource}/{operation}. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the operation name: {provider}/{resource}/{operation}. + * + * @param name the name value to set + * @return the OperationInner object itself. + */ + public OperationInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get the object that represents the operation. + * + * @return the display value + */ + public OperationDisplay display() { + return this.display; + } + + /** + * Set the object that represents 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/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/implementation/OperationsImpl.java b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/implementation/OperationsImpl.java new file mode 100644 index 000000000000..721dcb81d25f --- /dev/null +++ b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/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.hdinsight.v2018_06_01_preview.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.hdinsight.v2018_06_01_preview.Operations; +import rx.functions.Func1; +import rx.Observable; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.hdinsight.v2018_06_01_preview.Operation; + +class OperationsImpl extends WrapperImpl implements Operations { + private final HDInsightManager manager; + + OperationsImpl(HDInsightManager manager) { + super(manager.inner().operations()); + this.manager = manager; + } + + public HDInsightManager 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/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/implementation/OperationsInner.java b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/implementation/OperationsInner.java new file mode 100644 index 000000000000..35baf46abc0f --- /dev/null +++ b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/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.hdinsight.v2018_06_01_preview.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.hdinsight.v2018_06_01_preview.ErrorResponseException; +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 HDInsightManagementClientImpl 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, HDInsightManagementClientImpl 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.hdinsight.v2018_06_01_preview.Operations list" }) + @GET("providers/Microsoft.HDInsight/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.hdinsight.v2018_06_01_preview.Operations listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Lists all of the available HDInsight REST API operations. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException 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 HDInsight 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 HDInsight 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 HDInsight 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 HDInsight 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 ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Lists all of the available HDInsight REST API operations. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException 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 HDInsight 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 HDInsight 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 HDInsight 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 HDInsight 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 ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + +} diff --git a/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/implementation/PageImpl.java b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/implementation/PageImpl.java new file mode 100644 index 000000000000..7e193ceda3eb --- /dev/null +++ b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/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.hdinsight.v2018_06_01_preview.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/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/implementation/RuntimeScriptActionDetailImpl.java b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/implementation/RuntimeScriptActionDetailImpl.java new file mode 100644 index 000000000000..8b1a15732022 --- /dev/null +++ b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/implementation/RuntimeScriptActionDetailImpl.java @@ -0,0 +1,92 @@ +/** + * 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.hdinsight.v2018_06_01_preview.implementation; + +import com.microsoft.azure.management.hdinsight.v2018_06_01_preview.RuntimeScriptActionDetail; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import rx.Observable; +import java.util.List; +import com.microsoft.azure.management.hdinsight.v2018_06_01_preview.ScriptActionExecutionSummary; + +class RuntimeScriptActionDetailImpl extends WrapperImpl implements RuntimeScriptActionDetail { + private final HDInsightManager manager; + + RuntimeScriptActionDetailImpl(RuntimeScriptActionDetailInner inner, HDInsightManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public HDInsightManager manager() { + return this.manager; + } + + + + @Override + public String applicationName() { + return this.inner().applicationName(); + } + + @Override + public String debugInformation() { + return this.inner().debugInformation(); + } + + @Override + public String endTime() { + return this.inner().endTime(); + } + + @Override + public List executionSummary() { + return this.inner().executionSummary(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public String operation() { + return this.inner().operation(); + } + + @Override + public String parameters() { + return this.inner().parameters(); + } + + @Override + public List roles() { + return this.inner().roles(); + } + + @Override + public Long scriptExecutionId() { + return this.inner().scriptExecutionId(); + } + + @Override + public String startTime() { + return this.inner().startTime(); + } + + @Override + public String status() { + return this.inner().status(); + } + + @Override + public String uri() { + return this.inner().uri(); + } + +} diff --git a/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/implementation/RuntimeScriptActionDetailInner.java b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/implementation/RuntimeScriptActionDetailInner.java new file mode 100644 index 000000000000..c66040876e6a --- /dev/null +++ b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/implementation/RuntimeScriptActionDetailInner.java @@ -0,0 +1,125 @@ +/** + * 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.hdinsight.v2018_06_01_preview.implementation; + +import java.util.List; +import com.microsoft.azure.management.hdinsight.v2018_06_01_preview.ScriptActionExecutionSummary; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.azure.management.hdinsight.v2018_06_01_preview.RuntimeScriptAction; + +/** + * The execution details of a script action. + */ +public class RuntimeScriptActionDetailInner extends RuntimeScriptAction { + /** + * The execution id of the script action. + */ + @JsonProperty(value = "scriptExecutionId", access = JsonProperty.Access.WRITE_ONLY) + private Long scriptExecutionId; + + /** + * The start time of script action execution. + */ + @JsonProperty(value = "startTime", access = JsonProperty.Access.WRITE_ONLY) + private String startTime; + + /** + * The end time of script action execution. + */ + @JsonProperty(value = "endTime", access = JsonProperty.Access.WRITE_ONLY) + private String endTime; + + /** + * The current execution status of the script action. + */ + @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY) + private String status; + + /** + * The reason why the script action was executed. + */ + @JsonProperty(value = "operation", access = JsonProperty.Access.WRITE_ONLY) + private String operation; + + /** + * The summary of script action execution result. + */ + @JsonProperty(value = "executionSummary", access = JsonProperty.Access.WRITE_ONLY) + private List executionSummary; + + /** + * The script action execution debug information. + */ + @JsonProperty(value = "debugInformation", access = JsonProperty.Access.WRITE_ONLY) + private String debugInformation; + + /** + * Get the execution id of the script action. + * + * @return the scriptExecutionId value + */ + public Long scriptExecutionId() { + return this.scriptExecutionId; + } + + /** + * Get the start time of script action execution. + * + * @return the startTime value + */ + public String startTime() { + return this.startTime; + } + + /** + * Get the end time of script action execution. + * + * @return the endTime value + */ + public String endTime() { + return this.endTime; + } + + /** + * Get the current execution status of the script action. + * + * @return the status value + */ + public String status() { + return this.status; + } + + /** + * Get the reason why the script action was executed. + * + * @return the operation value + */ + public String operation() { + return this.operation; + } + + /** + * Get the summary of script action execution result. + * + * @return the executionSummary value + */ + public List executionSummary() { + return this.executionSummary; + } + + /** + * Get the script action execution debug information. + * + * @return the debugInformation value + */ + public String debugInformation() { + return this.debugInformation; + } + +} diff --git a/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/implementation/ScriptActionInner.java b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/implementation/ScriptActionInner.java new file mode 100644 index 000000000000..6ea155237e2e --- /dev/null +++ b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/implementation/ScriptActionInner.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.hdinsight.v2018_06_01_preview.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Describes a script action on role on the cluster. + */ +public class ScriptActionInner { + /** + * The name of the script action. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /** + * The URI to the script. + */ + @JsonProperty(value = "uri", required = true) + private String uri; + + /** + * The parameters for the script provided. + */ + @JsonProperty(value = "parameters", required = true) + private String parameters; + + /** + * Get the name of the script action. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name of the script action. + * + * @param name the name value to set + * @return the ScriptActionInner object itself. + */ + public ScriptActionInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get the URI to the script. + * + * @return the uri value + */ + public String uri() { + return this.uri; + } + + /** + * Set the URI to the script. + * + * @param uri the uri value to set + * @return the ScriptActionInner object itself. + */ + public ScriptActionInner withUri(String uri) { + this.uri = uri; + return this; + } + + /** + * Get the parameters for the script provided. + * + * @return the parameters value + */ + public String parameters() { + return this.parameters; + } + + /** + * Set the parameters for the script provided. + * + * @param parameters the parameters value to set + * @return the ScriptActionInner object itself. + */ + public ScriptActionInner withParameters(String parameters) { + this.parameters = parameters; + return this; + } + +} diff --git a/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/implementation/ScriptActionsImpl.java b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/implementation/ScriptActionsImpl.java new file mode 100644 index 000000000000..f5225ef78a4c --- /dev/null +++ b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/implementation/ScriptActionsImpl.java @@ -0,0 +1,72 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * + */ + +package com.microsoft.azure.management.hdinsight.v2018_06_01_preview.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.hdinsight.v2018_06_01_preview.ScriptActions; +import rx.Completable; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.hdinsight.v2018_06_01_preview.RuntimeScriptActionDetail; + +class ScriptActionsImpl extends WrapperImpl implements ScriptActions { + private final HDInsightManager manager; + + ScriptActionsImpl(HDInsightManager manager) { + super(manager.inner().scriptActions()); + this.manager = manager; + } + + public HDInsightManager manager() { + return this.manager; + } + + private RuntimeScriptActionDetailImpl wrapModel(RuntimeScriptActionDetailInner inner) { + return new RuntimeScriptActionDetailImpl(inner, manager()); + } + + @Override + public Observable listByClusterAsync(final String resourceGroupName, final String clusterName) { + ScriptActionsInner client = this.inner(); + return client.listByClusterAsync(resourceGroupName, clusterName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public RuntimeScriptActionDetail call(RuntimeScriptActionDetailInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Completable deleteAsync(String resourceGroupName, String clusterName, String scriptName) { + ScriptActionsInner client = this.inner(); + return client.deleteAsync(resourceGroupName, clusterName, scriptName).toCompletable(); + } + + @Override + public Observable getExecutionDetailAsync(String resourceGroupName, String clusterName, String scriptExecutionId) { + ScriptActionsInner client = this.inner(); + return client.getExecutionDetailAsync(resourceGroupName, clusterName, scriptExecutionId) + .map(new Func1() { + @Override + public RuntimeScriptActionDetail call(RuntimeScriptActionDetailInner inner) { + return new RuntimeScriptActionDetailImpl(inner, manager()); + } + }); + } + +} diff --git a/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/implementation/ScriptActionsInner.java b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/implementation/ScriptActionsInner.java new file mode 100644 index 000000000000..aa21d81533dc --- /dev/null +++ b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/implementation/ScriptActionsInner.java @@ -0,0 +1,498 @@ +/** + * 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.hdinsight.v2018_06_01_preview.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.hdinsight.v2018_06_01_preview.ErrorResponseException; +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 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.HTTP; +import retrofit2.http.Path; +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 ScriptActions. + */ +public class ScriptActionsInner { + /** The Retrofit service to perform REST calls. */ + private ScriptActionsService service; + /** The service client containing this operation class. */ + private HDInsightManagementClientImpl client; + + /** + * Initializes an instance of ScriptActionsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public ScriptActionsInner(Retrofit retrofit, HDInsightManagementClientImpl client) { + this.service = retrofit.create(ScriptActionsService.class); + this.client = client; + } + + /** + * The interface defining all the services for ScriptActions to be + * used by Retrofit to perform actually REST calls. + */ + interface ScriptActionsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.hdinsight.v2018_06_01_preview.ScriptActions delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/scriptActions/{scriptName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Path("scriptName") String scriptName, @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.hdinsight.v2018_06_01_preview.ScriptActions listByCluster" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/scriptActions") + Observable> listByCluster(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @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.hdinsight.v2018_06_01_preview.ScriptActions getExecutionDetail" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/scriptExecutionHistory/{scriptExecutionId}") + Observable> getExecutionDetail(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Path("scriptExecutionId") String scriptExecutionId, @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.hdinsight.v2018_06_01_preview.ScriptActions listByClusterNext" }) + @GET + Observable> listByClusterNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Deletes a specified persisted script action of the cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param scriptName The name of the script. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException 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 clusterName, String scriptName) { + deleteWithServiceResponseAsync(resourceGroupName, clusterName, scriptName).toBlocking().single().body(); + } + + /** + * Deletes a specified persisted script action of the cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param scriptName The name of the script. + * @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 clusterName, String scriptName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, clusterName, scriptName), serviceCallback); + } + + /** + * Deletes a specified persisted script action of the cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param scriptName The name of the script. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable deleteAsync(String resourceGroupName, String clusterName, String scriptName) { + return deleteWithServiceResponseAsync(resourceGroupName, clusterName, scriptName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes a specified persisted script action of the cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param scriptName The name of the script. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String clusterName, String scriptName) { + 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 (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName is required and cannot be null."); + } + if (scriptName == null) { + throw new IllegalArgumentException("Parameter scriptName 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.delete(this.client.subscriptionId(), resourceGroupName, clusterName, scriptName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = deleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse deleteDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Lists all the persisted script actions for the specified cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException 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<RuntimeScriptActionDetailInner> object if successful. + */ + public PagedList listByCluster(final String resourceGroupName, final String clusterName) { + ServiceResponse> response = listByClusterSinglePageAsync(resourceGroupName, clusterName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByClusterNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all the persisted script actions for the specified cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @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> listByClusterAsync(final String resourceGroupName, final String clusterName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByClusterSinglePageAsync(resourceGroupName, clusterName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByClusterNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all the persisted script actions for the specified cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<RuntimeScriptActionDetailInner> object + */ + public Observable> listByClusterAsync(final String resourceGroupName, final String clusterName) { + return listByClusterWithServiceResponseAsync(resourceGroupName, clusterName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all the persisted script actions for the specified cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<RuntimeScriptActionDetailInner> object + */ + public Observable>> listByClusterWithServiceResponseAsync(final String resourceGroupName, final String clusterName) { + return listByClusterSinglePageAsync(resourceGroupName, clusterName) + .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(listByClusterNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all the persisted script actions for the specified cluster. + * + ServiceResponse> * @param resourceGroupName The name of the resource group. + ServiceResponse> * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<RuntimeScriptActionDetailInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByClusterSinglePageAsync(final String resourceGroupName, final String clusterName) { + 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 (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName 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.listByCluster(this.client.subscriptionId(), resourceGroupName, clusterName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByClusterDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByClusterDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Gets the script execution detail for the given script execution ID. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param scriptExecutionId The script execution Id + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the RuntimeScriptActionDetailInner object if successful. + */ + public RuntimeScriptActionDetailInner getExecutionDetail(String resourceGroupName, String clusterName, String scriptExecutionId) { + return getExecutionDetailWithServiceResponseAsync(resourceGroupName, clusterName, scriptExecutionId).toBlocking().single().body(); + } + + /** + * Gets the script execution detail for the given script execution ID. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param scriptExecutionId The script execution Id + * @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 getExecutionDetailAsync(String resourceGroupName, String clusterName, String scriptExecutionId, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getExecutionDetailWithServiceResponseAsync(resourceGroupName, clusterName, scriptExecutionId), serviceCallback); + } + + /** + * Gets the script execution detail for the given script execution ID. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param scriptExecutionId The script execution Id + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the RuntimeScriptActionDetailInner object + */ + public Observable getExecutionDetailAsync(String resourceGroupName, String clusterName, String scriptExecutionId) { + return getExecutionDetailWithServiceResponseAsync(resourceGroupName, clusterName, scriptExecutionId).map(new Func1, RuntimeScriptActionDetailInner>() { + @Override + public RuntimeScriptActionDetailInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the script execution detail for the given script execution ID. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param scriptExecutionId The script execution Id + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the RuntimeScriptActionDetailInner object + */ + public Observable> getExecutionDetailWithServiceResponseAsync(String resourceGroupName, String clusterName, String scriptExecutionId) { + 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 (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName is required and cannot be null."); + } + if (scriptExecutionId == null) { + throw new IllegalArgumentException("Parameter scriptExecutionId 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.getExecutionDetail(this.client.subscriptionId(), resourceGroupName, clusterName, scriptExecutionId, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getExecutionDetailDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getExecutionDetailDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Lists all the persisted script actions for the specified cluster. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException 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<RuntimeScriptActionDetailInner> object if successful. + */ + public PagedList listByClusterNext(final String nextPageLink) { + ServiceResponse> response = listByClusterNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByClusterNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all the persisted script actions for the specified cluster. + * + * @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> listByClusterNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByClusterNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByClusterNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all the persisted script actions for the specified cluster. + * + * @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<RuntimeScriptActionDetailInner> object + */ + public Observable> listByClusterNextAsync(final String nextPageLink) { + return listByClusterNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all the persisted script actions for the specified cluster. + * + * @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<RuntimeScriptActionDetailInner> object + */ + public Observable>> listByClusterNextWithServiceResponseAsync(final String nextPageLink) { + return listByClusterNextSinglePageAsync(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(listByClusterNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all the persisted script actions for the specified cluster. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<RuntimeScriptActionDetailInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByClusterNextSinglePageAsync(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.listByClusterNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByClusterNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByClusterNextDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + +} diff --git a/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/implementation/ScriptExecutionHistorysImpl.java b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/implementation/ScriptExecutionHistorysImpl.java new file mode 100644 index 000000000000..083e2614c281 --- /dev/null +++ b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/implementation/ScriptExecutionHistorysImpl.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. + * abc + */ + +package com.microsoft.azure.management.hdinsight.v2018_06_01_preview.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.hdinsight.v2018_06_01_preview.ScriptExecutionHistorys; +import rx.Completable; +import rx.functions.Func1; +import rx.Observable; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.hdinsight.v2018_06_01_preview.RuntimeScriptActionDetail; + +class ScriptExecutionHistorysImpl extends WrapperImpl implements ScriptExecutionHistorys { + private final HDInsightManager manager; + + ScriptExecutionHistorysImpl(HDInsightManager manager) { + super(manager.inner().scriptExecutionHistorys()); + this.manager = manager; + } + + public HDInsightManager manager() { + return this.manager; + } + + @Override + public Observable listByClusterAsync(final String resourceGroupName, final String clusterName) { + ScriptExecutionHistorysInner client = this.inner(); + return client.listByClusterAsync(resourceGroupName, clusterName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public RuntimeScriptActionDetail call(RuntimeScriptActionDetailInner inner) { + return new RuntimeScriptActionDetailImpl(inner, manager()); + } + }); + } + + @Override + public Completable promoteAsync(String resourceGroupName, String clusterName, String scriptExecutionId) { + ScriptExecutionHistorysInner client = this.inner(); + return client.promoteAsync(resourceGroupName, clusterName, scriptExecutionId).toCompletable(); + } + +} diff --git a/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/implementation/ScriptExecutionHistorysInner.java b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/implementation/ScriptExecutionHistorysInner.java new file mode 100644 index 000000000000..3f1f93b7e3d7 --- /dev/null +++ b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/implementation/ScriptExecutionHistorysInner.java @@ -0,0 +1,401 @@ +/** + * 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.hdinsight.v2018_06_01_preview.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.hdinsight.v2018_06_01_preview.ErrorResponseException; +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 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.Path; +import retrofit2.http.POST; +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 ScriptExecutionHistorys. + */ +public class ScriptExecutionHistorysInner { + /** The Retrofit service to perform REST calls. */ + private ScriptExecutionHistorysService service; + /** The service client containing this operation class. */ + private HDInsightManagementClientImpl client; + + /** + * Initializes an instance of ScriptExecutionHistorysInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public ScriptExecutionHistorysInner(Retrofit retrofit, HDInsightManagementClientImpl client) { + this.service = retrofit.create(ScriptExecutionHistorysService.class); + this.client = client; + } + + /** + * The interface defining all the services for ScriptExecutionHistorys to be + * used by Retrofit to perform actually REST calls. + */ + interface ScriptExecutionHistorysService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.hdinsight.v2018_06_01_preview.ScriptExecutionHistorys listByCluster" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/scriptExecutionHistory") + Observable> listByCluster(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @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.hdinsight.v2018_06_01_preview.ScriptExecutionHistorys promote" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/scriptExecutionHistory/{scriptExecutionId}/promote") + Observable> promote(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Path("scriptExecutionId") String scriptExecutionId, @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.hdinsight.v2018_06_01_preview.ScriptExecutionHistorys listByClusterNext" }) + @GET + Observable> listByClusterNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Lists all scripts' execution history for the specified cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException 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<RuntimeScriptActionDetailInner> object if successful. + */ + public PagedList listByCluster(final String resourceGroupName, final String clusterName) { + ServiceResponse> response = listByClusterSinglePageAsync(resourceGroupName, clusterName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByClusterNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all scripts' execution history for the specified cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @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> listByClusterAsync(final String resourceGroupName, final String clusterName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByClusterSinglePageAsync(resourceGroupName, clusterName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByClusterNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all scripts' execution history for the specified cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<RuntimeScriptActionDetailInner> object + */ + public Observable> listByClusterAsync(final String resourceGroupName, final String clusterName) { + return listByClusterWithServiceResponseAsync(resourceGroupName, clusterName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all scripts' execution history for the specified cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<RuntimeScriptActionDetailInner> object + */ + public Observable>> listByClusterWithServiceResponseAsync(final String resourceGroupName, final String clusterName) { + return listByClusterSinglePageAsync(resourceGroupName, clusterName) + .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(listByClusterNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all scripts' execution history for the specified cluster. + * + ServiceResponse> * @param resourceGroupName The name of the resource group. + ServiceResponse> * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<RuntimeScriptActionDetailInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByClusterSinglePageAsync(final String resourceGroupName, final String clusterName) { + 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 (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName 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.listByCluster(this.client.subscriptionId(), resourceGroupName, clusterName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByClusterDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByClusterDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Promotes the specified ad-hoc script execution to a persisted script. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param scriptExecutionId The script execution Id + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void promote(String resourceGroupName, String clusterName, String scriptExecutionId) { + promoteWithServiceResponseAsync(resourceGroupName, clusterName, scriptExecutionId).toBlocking().single().body(); + } + + /** + * Promotes the specified ad-hoc script execution to a persisted script. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param scriptExecutionId The script execution Id + * @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 promoteAsync(String resourceGroupName, String clusterName, String scriptExecutionId, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(promoteWithServiceResponseAsync(resourceGroupName, clusterName, scriptExecutionId), serviceCallback); + } + + /** + * Promotes the specified ad-hoc script execution to a persisted script. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param scriptExecutionId The script execution Id + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable promoteAsync(String resourceGroupName, String clusterName, String scriptExecutionId) { + return promoteWithServiceResponseAsync(resourceGroupName, clusterName, scriptExecutionId).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Promotes the specified ad-hoc script execution to a persisted script. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param scriptExecutionId The script execution Id + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> promoteWithServiceResponseAsync(String resourceGroupName, String clusterName, String scriptExecutionId) { + 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 (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName is required and cannot be null."); + } + if (scriptExecutionId == null) { + throw new IllegalArgumentException("Parameter scriptExecutionId 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.promote(this.client.subscriptionId(), resourceGroupName, clusterName, scriptExecutionId, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = promoteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse promoteDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Lists all scripts' execution history for the specified cluster. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException 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<RuntimeScriptActionDetailInner> object if successful. + */ + public PagedList listByClusterNext(final String nextPageLink) { + ServiceResponse> response = listByClusterNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByClusterNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all scripts' execution history for the specified cluster. + * + * @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> listByClusterNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByClusterNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByClusterNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all scripts' execution history for the specified cluster. + * + * @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<RuntimeScriptActionDetailInner> object + */ + public Observable> listByClusterNextAsync(final String nextPageLink) { + return listByClusterNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all scripts' execution history for the specified cluster. + * + * @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<RuntimeScriptActionDetailInner> object + */ + public Observable>> listByClusterNextWithServiceResponseAsync(final String nextPageLink) { + return listByClusterNextSinglePageAsync(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(listByClusterNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all scripts' execution history for the specified cluster. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<RuntimeScriptActionDetailInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByClusterNextSinglePageAsync(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.listByClusterNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByClusterNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByClusterNextDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + +} diff --git a/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/implementation/UsagesListResultImpl.java b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/implementation/UsagesListResultImpl.java new file mode 100644 index 000000000000..e00aab78fef8 --- /dev/null +++ b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/implementation/UsagesListResultImpl.java @@ -0,0 +1,33 @@ +/** + * 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.hdinsight.v2018_06_01_preview.implementation; + +import com.microsoft.azure.management.hdinsight.v2018_06_01_preview.UsagesListResult; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import java.util.List; +import com.microsoft.azure.management.hdinsight.v2018_06_01_preview.Usage; + +class UsagesListResultImpl extends WrapperImpl implements UsagesListResult { + private final HDInsightManager manager; + UsagesListResultImpl(UsagesListResultInner inner, HDInsightManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public HDInsightManager manager() { + return this.manager; + } + + @Override + public List value() { + return this.inner().value(); + } + +} diff --git a/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/implementation/UsagesListResultInner.java b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/implementation/UsagesListResultInner.java new file mode 100644 index 000000000000..19ec943ff35b --- /dev/null +++ b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/implementation/UsagesListResultInner.java @@ -0,0 +1,45 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2018_06_01_preview.implementation; + +import java.util.List; +import com.microsoft.azure.management.hdinsight.v2018_06_01_preview.Usage; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The response for the operation to get regional usages for a subscription. + */ +public class UsagesListResultInner { + /** + * The list of usages. + */ + @JsonProperty(value = "value") + private List value; + + /** + * Get the list of usages. + * + * @return the value value + */ + public List value() { + return this.value; + } + + /** + * Set the list of usages. + * + * @param value the value value to set + * @return the UsagesListResultInner object itself. + */ + public UsagesListResultInner withValue(List value) { + this.value = value; + return this; + } + +} diff --git a/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/implementation/package-info.java b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/implementation/package-info.java new file mode 100644 index 000000000000..4cf8620203eb --- /dev/null +++ b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/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 HDInsightManagementClient. + * HDInsight Management Client. + */ +package com.microsoft.azure.management.hdinsight.v2018_06_01_preview.implementation; diff --git a/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/package-info.java b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/package-info.java new file mode 100644 index 000000000000..47078ef3fd98 --- /dev/null +++ b/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/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 HDInsightManagementClient. + * HDInsight Management Client. + */ +package com.microsoft.azure.management.hdinsight.v2018_06_01_preview; diff --git a/notificationhubs/resource-manager/v2014_09_01/pom.xml b/notificationhubs/resource-manager/v2014_09_01/pom.xml new file mode 100644 index 000000000000..60a7bdce348a --- /dev/null +++ b/notificationhubs/resource-manager/v2014_09_01/pom.xml @@ -0,0 +1,133 @@ + + + 4.0.0 + com.microsoft.azure.notificationhubs.v2014_09_01 + + com.microsoft.azure + azure-arm-parent + 0.0.2-beta + ../../../pom.xml + + azure-mgmt-notificationhubs + 1.0.0-beta + jar + Microsoft Azure SDK for NotificationHubs Management + This package contains Microsoft NotificationHubs 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/notificationhubs/resource-manager/v2014_09_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2014_09_01/AccessRights.java b/notificationhubs/resource-manager/v2014_09_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2014_09_01/AccessRights.java new file mode 100644 index 000000000000..3cf387036cee --- /dev/null +++ b/notificationhubs/resource-manager/v2014_09_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2014_09_01/AccessRights.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.notificationhubs.v2014_09_01; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for AccessRights. + */ +public enum AccessRights { + /** Enum value Manage. */ + MANAGE("Manage"), + + /** Enum value Send. */ + SEND("Send"), + + /** Enum value Listen. */ + LISTEN("Listen"); + + /** The actual serialized value for a AccessRights instance. */ + private String value; + + AccessRights(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a AccessRights instance. + * + * @param value the serialized value to parse. + * @return the parsed AccessRights object, or null if unable to parse. + */ + @JsonCreator + public static AccessRights fromString(String value) { + AccessRights[] items = AccessRights.values(); + for (AccessRights item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/notificationhubs/resource-manager/v2014_09_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2014_09_01/AdmCredential.java b/notificationhubs/resource-manager/v2014_09_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2014_09_01/AdmCredential.java new file mode 100644 index 000000000000..9672a9383e52 --- /dev/null +++ b/notificationhubs/resource-manager/v2014_09_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2014_09_01/AdmCredential.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.notificationhubs.v2014_09_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Description of a NotificationHub AdmCredential. + */ +public class AdmCredential { + /** + * Gets or sets properties of NotificationHub AdmCredential. + */ + @JsonProperty(value = "properties") + private AdmCredentialProperties properties; + + /** + * Get gets or sets properties of NotificationHub AdmCredential. + * + * @return the properties value + */ + public AdmCredentialProperties properties() { + return this.properties; + } + + /** + * Set gets or sets properties of NotificationHub AdmCredential. + * + * @param properties the properties value to set + * @return the AdmCredential object itself. + */ + public AdmCredential withProperties(AdmCredentialProperties properties) { + this.properties = properties; + return this; + } + +} diff --git a/notificationhubs/resource-manager/v2014_09_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2014_09_01/AdmCredentialProperties.java b/notificationhubs/resource-manager/v2014_09_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2014_09_01/AdmCredentialProperties.java new file mode 100644 index 000000000000..bb3eb206ed1b --- /dev/null +++ b/notificationhubs/resource-manager/v2014_09_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2014_09_01/AdmCredentialProperties.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.notificationhubs.v2014_09_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Description of a NotificationHub AdmCredential. + */ +public class AdmCredentialProperties { + /** + * Gets or sets the client identifier. + */ + @JsonProperty(value = "clientId") + private String clientId; + + /** + * Gets or sets the credential secret access key. + */ + @JsonProperty(value = "clientSecret") + private String clientSecret; + + /** + * Gets or sets the URL of the authorization token. + */ + @JsonProperty(value = "authTokenUrl") + private String authTokenUrl; + + /** + * Get gets or sets the client identifier. + * + * @return the clientId value + */ + public String clientId() { + return this.clientId; + } + + /** + * Set gets or sets the client identifier. + * + * @param clientId the clientId value to set + * @return the AdmCredentialProperties object itself. + */ + public AdmCredentialProperties withClientId(String clientId) { + this.clientId = clientId; + return this; + } + + /** + * Get gets or sets the credential secret access key. + * + * @return the clientSecret value + */ + public String clientSecret() { + return this.clientSecret; + } + + /** + * Set gets or sets the credential secret access key. + * + * @param clientSecret the clientSecret value to set + * @return the AdmCredentialProperties object itself. + */ + public AdmCredentialProperties withClientSecret(String clientSecret) { + this.clientSecret = clientSecret; + return this; + } + + /** + * Get gets or sets the URL of the authorization token. + * + * @return the authTokenUrl value + */ + public String authTokenUrl() { + return this.authTokenUrl; + } + + /** + * Set gets or sets the URL of the authorization token. + * + * @param authTokenUrl the authTokenUrl value to set + * @return the AdmCredentialProperties object itself. + */ + public AdmCredentialProperties withAuthTokenUrl(String authTokenUrl) { + this.authTokenUrl = authTokenUrl; + return this; + } + +} diff --git a/notificationhubs/resource-manager/v2014_09_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2014_09_01/ApnsCredential.java b/notificationhubs/resource-manager/v2014_09_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2014_09_01/ApnsCredential.java new file mode 100644 index 000000000000..67a401b73d44 --- /dev/null +++ b/notificationhubs/resource-manager/v2014_09_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2014_09_01/ApnsCredential.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.notificationhubs.v2014_09_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Description of a NotificationHub ApnsCredential. + */ +public class ApnsCredential { + /** + * Gets or sets properties of NotificationHub ApnsCredential. + */ + @JsonProperty(value = "properties") + private ApnsCredentialProperties properties; + + /** + * Get gets or sets properties of NotificationHub ApnsCredential. + * + * @return the properties value + */ + public ApnsCredentialProperties properties() { + return this.properties; + } + + /** + * Set gets or sets properties of NotificationHub ApnsCredential. + * + * @param properties the properties value to set + * @return the ApnsCredential object itself. + */ + public ApnsCredential withProperties(ApnsCredentialProperties properties) { + this.properties = properties; + return this; + } + +} diff --git a/notificationhubs/resource-manager/v2014_09_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2014_09_01/ApnsCredentialProperties.java b/notificationhubs/resource-manager/v2014_09_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2014_09_01/ApnsCredentialProperties.java new file mode 100644 index 000000000000..61ccd2a8508c --- /dev/null +++ b/notificationhubs/resource-manager/v2014_09_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2014_09_01/ApnsCredentialProperties.java @@ -0,0 +1,121 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.notificationhubs.v2014_09_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Description of a NotificationHub ApnsCredential. + */ +public class ApnsCredentialProperties { + /** + * Gets or sets the APNS certificate. + */ + @JsonProperty(value = "apnsCertificate") + private String apnsCertificate; + + /** + * Gets or sets the certificate key. + */ + @JsonProperty(value = "certificateKey") + private String certificateKey; + + /** + * Gets or sets the endpoint of this credential. + */ + @JsonProperty(value = "endpoint") + private String endpoint; + + /** + * Gets or sets the Apns certificate Thumbprint. + */ + @JsonProperty(value = "thumbprint") + private String thumbprint; + + /** + * Get gets or sets the APNS certificate. + * + * @return the apnsCertificate value + */ + public String apnsCertificate() { + return this.apnsCertificate; + } + + /** + * Set gets or sets the APNS certificate. + * + * @param apnsCertificate the apnsCertificate value to set + * @return the ApnsCredentialProperties object itself. + */ + public ApnsCredentialProperties withApnsCertificate(String apnsCertificate) { + this.apnsCertificate = apnsCertificate; + return this; + } + + /** + * Get gets or sets the certificate key. + * + * @return the certificateKey value + */ + public String certificateKey() { + return this.certificateKey; + } + + /** + * Set gets or sets the certificate key. + * + * @param certificateKey the certificateKey value to set + * @return the ApnsCredentialProperties object itself. + */ + public ApnsCredentialProperties withCertificateKey(String certificateKey) { + this.certificateKey = certificateKey; + return this; + } + + /** + * Get gets or sets the endpoint of this credential. + * + * @return the endpoint value + */ + public String endpoint() { + return this.endpoint; + } + + /** + * Set gets or sets the endpoint of this credential. + * + * @param endpoint the endpoint value to set + * @return the ApnsCredentialProperties object itself. + */ + public ApnsCredentialProperties withEndpoint(String endpoint) { + this.endpoint = endpoint; + return this; + } + + /** + * Get gets or sets the Apns certificate Thumbprint. + * + * @return the thumbprint value + */ + public String thumbprint() { + return this.thumbprint; + } + + /** + * Set gets or sets the Apns certificate Thumbprint. + * + * @param thumbprint the thumbprint value to set + * @return the ApnsCredentialProperties object itself. + */ + public ApnsCredentialProperties withThumbprint(String thumbprint) { + this.thumbprint = thumbprint; + return this; + } + +} diff --git a/notificationhubs/resource-manager/v2014_09_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2014_09_01/BaiduCredential.java b/notificationhubs/resource-manager/v2014_09_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2014_09_01/BaiduCredential.java new file mode 100644 index 000000000000..dd747f014dec --- /dev/null +++ b/notificationhubs/resource-manager/v2014_09_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2014_09_01/BaiduCredential.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.notificationhubs.v2014_09_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Description of a NotificationHub BaiduCredential. + */ +public class BaiduCredential { + /** + * Gets or sets properties of NotificationHub BaiduCredential. + */ + @JsonProperty(value = "properties") + private BaiduCredentialProperties properties; + + /** + * Get gets or sets properties of NotificationHub BaiduCredential. + * + * @return the properties value + */ + public BaiduCredentialProperties properties() { + return this.properties; + } + + /** + * Set gets or sets properties of NotificationHub BaiduCredential. + * + * @param properties the properties value to set + * @return the BaiduCredential object itself. + */ + public BaiduCredential withProperties(BaiduCredentialProperties properties) { + this.properties = properties; + return this; + } + +} diff --git a/notificationhubs/resource-manager/v2014_09_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2014_09_01/BaiduCredentialProperties.java b/notificationhubs/resource-manager/v2014_09_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2014_09_01/BaiduCredentialProperties.java new file mode 100644 index 000000000000..04b7933d289a --- /dev/null +++ b/notificationhubs/resource-manager/v2014_09_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2014_09_01/BaiduCredentialProperties.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.notificationhubs.v2014_09_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Description of a NotificationHub BaiduCredential. + */ +public class BaiduCredentialProperties { + /** + * Get or Set Baidu Api Key. + */ + @JsonProperty(value = "baiduApiKey") + private String baiduApiKey; + + /** + * Get or Set Baidu Endpoint. + */ + @JsonProperty(value = "baiduEndPoint") + private String baiduEndPoint; + + /** + * Get or Set Baidu Secret Key. + */ + @JsonProperty(value = "baiduSecretKey") + private String baiduSecretKey; + + /** + * Get get or Set Baidu Api Key. + * + * @return the baiduApiKey value + */ + public String baiduApiKey() { + return this.baiduApiKey; + } + + /** + * Set get or Set Baidu Api Key. + * + * @param baiduApiKey the baiduApiKey value to set + * @return the BaiduCredentialProperties object itself. + */ + public BaiduCredentialProperties withBaiduApiKey(String baiduApiKey) { + this.baiduApiKey = baiduApiKey; + return this; + } + + /** + * Get get or Set Baidu Endpoint. + * + * @return the baiduEndPoint value + */ + public String baiduEndPoint() { + return this.baiduEndPoint; + } + + /** + * Set get or Set Baidu Endpoint. + * + * @param baiduEndPoint the baiduEndPoint value to set + * @return the BaiduCredentialProperties object itself. + */ + public BaiduCredentialProperties withBaiduEndPoint(String baiduEndPoint) { + this.baiduEndPoint = baiduEndPoint; + return this; + } + + /** + * Get get or Set Baidu Secret Key. + * + * @return the baiduSecretKey value + */ + public String baiduSecretKey() { + return this.baiduSecretKey; + } + + /** + * Set get or Set Baidu Secret Key. + * + * @param baiduSecretKey the baiduSecretKey value to set + * @return the BaiduCredentialProperties object itself. + */ + public BaiduCredentialProperties withBaiduSecretKey(String baiduSecretKey) { + this.baiduSecretKey = baiduSecretKey; + return this; + } + +} diff --git a/notificationhubs/resource-manager/v2014_09_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2014_09_01/CheckAvailabilityParameters.java b/notificationhubs/resource-manager/v2014_09_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2014_09_01/CheckAvailabilityParameters.java new file mode 100644 index 000000000000..a96f93d355e0 --- /dev/null +++ b/notificationhubs/resource-manager/v2014_09_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2014_09_01/CheckAvailabilityParameters.java @@ -0,0 +1,124 @@ +/** + * 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.notificationhubs.v2014_09_01; + +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Parameters supplied to the Check Name Availability for Namespace and + * NotificationHubs. + */ +public class CheckAvailabilityParameters { + /** + * Gets or sets name. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /** + * Gets or sets location. + */ + @JsonProperty(value = "location") + private String location; + + /** + * Gets or sets tags. + */ + @JsonProperty(value = "tags") + private Map tags; + + /** + * Gets or sets true if the name is available and can be used to create new + * Namespace/NotificationHub. Otherwise false. + */ + @JsonProperty(value = "isAvailiable") + private Boolean isAvailiable; + + /** + * Get gets or sets name. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set gets or sets name. + * + * @param name the name value to set + * @return the CheckAvailabilityParameters object itself. + */ + public CheckAvailabilityParameters withName(String name) { + this.name = name; + return this; + } + + /** + * Get gets or sets location. + * + * @return the location value + */ + public String location() { + return this.location; + } + + /** + * Set gets or sets location. + * + * @param location the location value to set + * @return the CheckAvailabilityParameters object itself. + */ + public CheckAvailabilityParameters withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get gets or sets tags. + * + * @return the tags value + */ + public Map tags() { + return this.tags; + } + + /** + * Set gets or sets tags. + * + * @param tags the tags value to set + * @return the CheckAvailabilityParameters object itself. + */ + public CheckAvailabilityParameters withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Get gets or sets true if the name is available and can be used to create new Namespace/NotificationHub. Otherwise false. + * + * @return the isAvailiable value + */ + public Boolean isAvailiable() { + return this.isAvailiable; + } + + /** + * Set gets or sets true if the name is available and can be used to create new Namespace/NotificationHub. Otherwise false. + * + * @param isAvailiable the isAvailiable value to set + * @return the CheckAvailabilityParameters object itself. + */ + public CheckAvailabilityParameters withIsAvailiable(Boolean isAvailiable) { + this.isAvailiable = isAvailiable; + return this; + } + +} diff --git a/notificationhubs/resource-manager/v2014_09_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2014_09_01/CheckAvailabilityResource.java b/notificationhubs/resource-manager/v2014_09_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2014_09_01/CheckAvailabilityResource.java new file mode 100644 index 000000000000..9fb5c9dc88d8 --- /dev/null +++ b/notificationhubs/resource-manager/v2014_09_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2014_09_01/CheckAvailabilityResource.java @@ -0,0 +1,51 @@ +/** + * 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.notificationhubs.v2014_09_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.notificationhubs.v2014_09_01.implementation.NotificationHubsManager; +import com.microsoft.azure.management.notificationhubs.v2014_09_01.implementation.CheckAvailabilityResourceInner; +import java.util.Map; + +/** + * Type representing CheckAvailabilityResource. + */ +public interface CheckAvailabilityResource extends HasInner, HasManager { + /** + * @return the id value. + */ + String id(); + + /** + * @return the isAvailiable value. + */ + Boolean isAvailiable(); + + /** + * @return the location value. + */ + String location(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the tags value. + */ + Map tags(); + + /** + * @return the type value. + */ + String type(); + +} diff --git a/notificationhubs/resource-manager/v2014_09_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2014_09_01/GcmCredential.java b/notificationhubs/resource-manager/v2014_09_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2014_09_01/GcmCredential.java new file mode 100644 index 000000000000..f6b4baf4435f --- /dev/null +++ b/notificationhubs/resource-manager/v2014_09_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2014_09_01/GcmCredential.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.notificationhubs.v2014_09_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Description of a NotificationHub GcmCredential. + */ +public class GcmCredential { + /** + * Gets or sets properties of NotificationHub GcmCredential. + */ + @JsonProperty(value = "properties") + private GcmCredentialProperties properties; + + /** + * Get gets or sets properties of NotificationHub GcmCredential. + * + * @return the properties value + */ + public GcmCredentialProperties properties() { + return this.properties; + } + + /** + * Set gets or sets properties of NotificationHub GcmCredential. + * + * @param properties the properties value to set + * @return the GcmCredential object itself. + */ + public GcmCredential withProperties(GcmCredentialProperties properties) { + this.properties = properties; + return this; + } + +} diff --git a/notificationhubs/resource-manager/v2014_09_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2014_09_01/GcmCredentialProperties.java b/notificationhubs/resource-manager/v2014_09_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2014_09_01/GcmCredentialProperties.java new file mode 100644 index 000000000000..faf96e801e54 --- /dev/null +++ b/notificationhubs/resource-manager/v2014_09_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2014_09_01/GcmCredentialProperties.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.notificationhubs.v2014_09_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Description of a NotificationHub GcmCredential. + */ +public class GcmCredentialProperties { + /** + * Gets or sets the GCM endpoint. + */ + @JsonProperty(value = "gcmEndpoint") + private String gcmEndpoint; + + /** + * Gets or sets the Google API key. + */ + @JsonProperty(value = "googleApiKey") + private String googleApiKey; + + /** + * Get gets or sets the GCM endpoint. + * + * @return the gcmEndpoint value + */ + public String gcmEndpoint() { + return this.gcmEndpoint; + } + + /** + * Set gets or sets the GCM endpoint. + * + * @param gcmEndpoint the gcmEndpoint value to set + * @return the GcmCredentialProperties object itself. + */ + public GcmCredentialProperties withGcmEndpoint(String gcmEndpoint) { + this.gcmEndpoint = gcmEndpoint; + return this; + } + + /** + * Get gets or sets the Google API key. + * + * @return the googleApiKey value + */ + public String googleApiKey() { + return this.googleApiKey; + } + + /** + * Set gets or sets the Google API key. + * + * @param googleApiKey the googleApiKey value to set + * @return the GcmCredentialProperties object itself. + */ + public GcmCredentialProperties withGoogleApiKey(String googleApiKey) { + this.googleApiKey = googleApiKey; + return this; + } + +} diff --git a/notificationhubs/resource-manager/v2014_09_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2014_09_01/MpnsCredential.java b/notificationhubs/resource-manager/v2014_09_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2014_09_01/MpnsCredential.java new file mode 100644 index 000000000000..855b68706fbf --- /dev/null +++ b/notificationhubs/resource-manager/v2014_09_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2014_09_01/MpnsCredential.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.notificationhubs.v2014_09_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Description of a NotificationHub MpnsCredential. + */ +public class MpnsCredential { + /** + * Gets or sets properties of NotificationHub MpnsCredential. + */ + @JsonProperty(value = "properties") + private MpnsCredentialProperties properties; + + /** + * Get gets or sets properties of NotificationHub MpnsCredential. + * + * @return the properties value + */ + public MpnsCredentialProperties properties() { + return this.properties; + } + + /** + * Set gets or sets properties of NotificationHub MpnsCredential. + * + * @param properties the properties value to set + * @return the MpnsCredential object itself. + */ + public MpnsCredential withProperties(MpnsCredentialProperties properties) { + this.properties = properties; + return this; + } + +} diff --git a/notificationhubs/resource-manager/v2014_09_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2014_09_01/MpnsCredentialProperties.java b/notificationhubs/resource-manager/v2014_09_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2014_09_01/MpnsCredentialProperties.java new file mode 100644 index 000000000000..ac9ba041730c --- /dev/null +++ b/notificationhubs/resource-manager/v2014_09_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2014_09_01/MpnsCredentialProperties.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.notificationhubs.v2014_09_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Description of a NotificationHub MpnsCredential. + */ +public class MpnsCredentialProperties { + /** + * Gets or sets the MPNS certificate. + */ + @JsonProperty(value = "mpnsCertificate") + private String mpnsCertificate; + + /** + * Gets or sets the certificate key for this credential. + */ + @JsonProperty(value = "certificateKey") + private String certificateKey; + + /** + * Gets or sets the Mpns certificate Thumbprint. + */ + @JsonProperty(value = "thumbprint") + private String thumbprint; + + /** + * Get gets or sets the MPNS certificate. + * + * @return the mpnsCertificate value + */ + public String mpnsCertificate() { + return this.mpnsCertificate; + } + + /** + * Set gets or sets the MPNS certificate. + * + * @param mpnsCertificate the mpnsCertificate value to set + * @return the MpnsCredentialProperties object itself. + */ + public MpnsCredentialProperties withMpnsCertificate(String mpnsCertificate) { + this.mpnsCertificate = mpnsCertificate; + return this; + } + + /** + * Get gets or sets the certificate key for this credential. + * + * @return the certificateKey value + */ + public String certificateKey() { + return this.certificateKey; + } + + /** + * Set gets or sets the certificate key for this credential. + * + * @param certificateKey the certificateKey value to set + * @return the MpnsCredentialProperties object itself. + */ + public MpnsCredentialProperties withCertificateKey(String certificateKey) { + this.certificateKey = certificateKey; + return this; + } + + /** + * Get gets or sets the Mpns certificate Thumbprint. + * + * @return the thumbprint value + */ + public String thumbprint() { + return this.thumbprint; + } + + /** + * Set gets or sets the Mpns certificate Thumbprint. + * + * @param thumbprint the thumbprint value to set + * @return the MpnsCredentialProperties object itself. + */ + public MpnsCredentialProperties withThumbprint(String thumbprint) { + this.thumbprint = thumbprint; + return this; + } + +} diff --git a/notificationhubs/resource-manager/v2014_09_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2014_09_01/NamespaceCreateOrUpdateParameters.java b/notificationhubs/resource-manager/v2014_09_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2014_09_01/NamespaceCreateOrUpdateParameters.java new file mode 100644 index 000000000000..74ee50dea6ec --- /dev/null +++ b/notificationhubs/resource-manager/v2014_09_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2014_09_01/NamespaceCreateOrUpdateParameters.java @@ -0,0 +1,96 @@ +/** + * 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.notificationhubs.v2014_09_01; + +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Parameters supplied to the CreateOrUpdate Namespace operation. + */ +public class NamespaceCreateOrUpdateParameters { + /** + * Gets or sets Namespace data center location. + */ + @JsonProperty(value = "location", required = true) + private String location; + + /** + * Gets or sets Namespace tags. + */ + @JsonProperty(value = "tags") + private Map tags; + + /** + * Gets or sets properties of the Namespace. + */ + @JsonProperty(value = "properties", required = true) + private NamespaceProperties properties; + + /** + * Get gets or sets Namespace data center location. + * + * @return the location value + */ + public String location() { + return this.location; + } + + /** + * Set gets or sets Namespace data center location. + * + * @param location the location value to set + * @return the NamespaceCreateOrUpdateParameters object itself. + */ + public NamespaceCreateOrUpdateParameters withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get gets or sets Namespace tags. + * + * @return the tags value + */ + public Map tags() { + return this.tags; + } + + /** + * Set gets or sets Namespace tags. + * + * @param tags the tags value to set + * @return the NamespaceCreateOrUpdateParameters object itself. + */ + public NamespaceCreateOrUpdateParameters withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Get gets or sets properties of the Namespace. + * + * @return the properties value + */ + public NamespaceProperties properties() { + return this.properties; + } + + /** + * Set gets or sets properties of the Namespace. + * + * @param properties the properties value to set + * @return the NamespaceCreateOrUpdateParameters object itself. + */ + public NamespaceCreateOrUpdateParameters withProperties(NamespaceProperties properties) { + this.properties = properties; + return this; + } + +} diff --git a/notificationhubs/resource-manager/v2014_09_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2014_09_01/NamespaceProperties.java b/notificationhubs/resource-manager/v2014_09_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2014_09_01/NamespaceProperties.java new file mode 100644 index 000000000000..fb5b7678e5e2 --- /dev/null +++ b/notificationhubs/resource-manager/v2014_09_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2014_09_01/NamespaceProperties.java @@ -0,0 +1,310 @@ +/** + * 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.notificationhubs.v2014_09_01; + +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Namespace properties. + */ +public class NamespaceProperties { + /** + * The name of the namespace. + */ + @JsonProperty(value = "name") + private String name; + + /** + * Gets or sets provisioning state of the Namespace. + */ + @JsonProperty(value = "provisioningState") + private String provisioningState; + + /** + * Specifies the targeted region in which the namespace should be created. + * It can be any of the following values: Australia EastAustralia + * SoutheastCentral USEast USEast US 2West USNorth Central USSouth Central + * USEast AsiaSoutheast AsiaBrazil SouthJapan EastJapan WestNorth + * EuropeWest Europe. + */ + @JsonProperty(value = "region") + private String region; + + /** + * Status of the namespace. It can be any of these values:1 = + * Created/Active2 = Creating3 = Suspended4 = Deleting. + */ + @JsonProperty(value = "status") + private String status; + + /** + * The time the namespace was created. + */ + @JsonProperty(value = "createdAt") + private DateTime createdAt; + + /** + * Endpoint you can use to perform NotificationHub operations. + */ + @JsonProperty(value = "serviceBusEndpoint") + private String serviceBusEndpoint; + + /** + * The Id of the Azure subscription associated with the namespace. + */ + @JsonProperty(value = "subscriptionId") + private String subscriptionId; + + /** + * ScaleUnit where the namespace gets created. + */ + @JsonProperty(value = "scaleUnit") + private String scaleUnit; + + /** + * Whether or not the namespace is currently enabled. + */ + @JsonProperty(value = "enabled") + private Boolean enabled; + + /** + * Whether or not the namespace is set as Critical. + */ + @JsonProperty(value = "critical") + private Boolean critical; + + /** + * Gets or sets the namespace type. Possible values include: 'Messaging', + * 'NotificationHub'. + */ + @JsonProperty(value = "namespaceType") + private NamespaceType namespaceType; + + /** + * Get the name of the namespace. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name of the namespace. + * + * @param name the name value to set + * @return the NamespaceProperties object itself. + */ + public NamespaceProperties withName(String name) { + this.name = name; + return this; + } + + /** + * Get gets or sets provisioning state of the Namespace. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Set gets or sets provisioning state of the Namespace. + * + * @param provisioningState the provisioningState value to set + * @return the NamespaceProperties object itself. + */ + public NamespaceProperties withProvisioningState(String provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * Get specifies the targeted region in which the namespace should be created. It can be any of the following values: Australia EastAustralia SoutheastCentral USEast USEast US 2West USNorth Central USSouth Central USEast AsiaSoutheast AsiaBrazil SouthJapan EastJapan WestNorth EuropeWest Europe. + * + * @return the region value + */ + public String region() { + return this.region; + } + + /** + * Set specifies the targeted region in which the namespace should be created. It can be any of the following values: Australia EastAustralia SoutheastCentral USEast USEast US 2West USNorth Central USSouth Central USEast AsiaSoutheast AsiaBrazil SouthJapan EastJapan WestNorth EuropeWest Europe. + * + * @param region the region value to set + * @return the NamespaceProperties object itself. + */ + public NamespaceProperties withRegion(String region) { + this.region = region; + return this; + } + + /** + * Get status of the namespace. It can be any of these values:1 = Created/Active2 = Creating3 = Suspended4 = Deleting. + * + * @return the status value + */ + public String status() { + return this.status; + } + + /** + * Set status of the namespace. It can be any of these values:1 = Created/Active2 = Creating3 = Suspended4 = Deleting. + * + * @param status the status value to set + * @return the NamespaceProperties object itself. + */ + public NamespaceProperties withStatus(String status) { + this.status = status; + return this; + } + + /** + * Get the time the namespace was created. + * + * @return the createdAt value + */ + public DateTime createdAt() { + return this.createdAt; + } + + /** + * Set the time the namespace was created. + * + * @param createdAt the createdAt value to set + * @return the NamespaceProperties object itself. + */ + public NamespaceProperties withCreatedAt(DateTime createdAt) { + this.createdAt = createdAt; + return this; + } + + /** + * Get endpoint you can use to perform NotificationHub operations. + * + * @return the serviceBusEndpoint value + */ + public String serviceBusEndpoint() { + return this.serviceBusEndpoint; + } + + /** + * Set endpoint you can use to perform NotificationHub operations. + * + * @param serviceBusEndpoint the serviceBusEndpoint value to set + * @return the NamespaceProperties object itself. + */ + public NamespaceProperties withServiceBusEndpoint(String serviceBusEndpoint) { + this.serviceBusEndpoint = serviceBusEndpoint; + return this; + } + + /** + * Get the Id of the Azure subscription associated with the namespace. + * + * @return the subscriptionId value + */ + public String subscriptionId() { + return this.subscriptionId; + } + + /** + * Set the Id of the Azure subscription associated with the namespace. + * + * @param subscriptionId the subscriptionId value to set + * @return the NamespaceProperties object itself. + */ + public NamespaceProperties withSubscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; + return this; + } + + /** + * Get scaleUnit where the namespace gets created. + * + * @return the scaleUnit value + */ + public String scaleUnit() { + return this.scaleUnit; + } + + /** + * Set scaleUnit where the namespace gets created. + * + * @param scaleUnit the scaleUnit value to set + * @return the NamespaceProperties object itself. + */ + public NamespaceProperties withScaleUnit(String scaleUnit) { + this.scaleUnit = scaleUnit; + return this; + } + + /** + * Get whether or not the namespace is currently enabled. + * + * @return the enabled value + */ + public Boolean enabled() { + return this.enabled; + } + + /** + * Set whether or not the namespace is currently enabled. + * + * @param enabled the enabled value to set + * @return the NamespaceProperties object itself. + */ + public NamespaceProperties withEnabled(Boolean enabled) { + this.enabled = enabled; + return this; + } + + /** + * Get whether or not the namespace is set as Critical. + * + * @return the critical value + */ + public Boolean critical() { + return this.critical; + } + + /** + * Set whether or not the namespace is set as Critical. + * + * @param critical the critical value to set + * @return the NamespaceProperties object itself. + */ + public NamespaceProperties withCritical(Boolean critical) { + this.critical = critical; + return this; + } + + /** + * Get gets or sets the namespace type. Possible values include: 'Messaging', 'NotificationHub'. + * + * @return the namespaceType value + */ + public NamespaceType namespaceType() { + return this.namespaceType; + } + + /** + * Set gets or sets the namespace type. Possible values include: 'Messaging', 'NotificationHub'. + * + * @param namespaceType the namespaceType value to set + * @return the NamespaceProperties object itself. + */ + public NamespaceProperties withNamespaceType(NamespaceType namespaceType) { + this.namespaceType = namespaceType; + return this; + } + +} diff --git a/notificationhubs/resource-manager/v2014_09_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2014_09_01/NamespaceResource.java b/notificationhubs/resource-manager/v2014_09_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2014_09_01/NamespaceResource.java new file mode 100644 index 000000000000..6075117a26a6 --- /dev/null +++ b/notificationhubs/resource-manager/v2014_09_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2014_09_01/NamespaceResource.java @@ -0,0 +1,85 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.notificationhubs.v2014_09_01; + +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.notificationhubs.v2014_09_01.implementation.NotificationHubsManager; +import com.microsoft.azure.management.notificationhubs.v2014_09_01.implementation.NamespaceResourceInner; + +/** + * Type representing NamespaceResource. + */ +public interface NamespaceResource extends HasInner, Resource, GroupableResourceCore, HasResourceGroup, Refreshable, Updatable, HasManager { + /** + * @return the properties value. + */ + NamespaceProperties properties(); + + /** + * The entirety of the NamespaceResource definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithGroup, DefinitionStages.WithProperties, DefinitionStages.WithCreate { + } + + /** + * Grouping of NamespaceResource definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a NamespaceResource definition. + */ + interface Blank extends GroupableResourceCore.DefinitionWithRegion { + } + + /** + * The stage of the NamespaceResource definition allowing to specify the resource group. + */ + interface WithGroup extends GroupableResourceCore.DefinitionStages.WithGroup { + } + + /** + * The stage of the namespaceresource definition allowing to specify Properties. + */ + interface WithProperties { + /** + * Specifies properties. + * @param properties Gets or sets properties of the Namespace + * @return the next definition stage +*/ + WithCreate withProperties(NamespaceProperties 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 { + } + } + /** + * The template for a NamespaceResource update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, Resource.UpdateWithTags { + } + + /** + * Grouping of NamespaceResource update stages. + */ + interface UpdateStages { + } +} diff --git a/notificationhubs/resource-manager/v2014_09_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2014_09_01/NamespaceSharedAccessAuthorizationRuleResource.java b/notificationhubs/resource-manager/v2014_09_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2014_09_01/NamespaceSharedAccessAuthorizationRuleResource.java new file mode 100644 index 000000000000..d01429410fef --- /dev/null +++ b/notificationhubs/resource-manager/v2014_09_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2014_09_01/NamespaceSharedAccessAuthorizationRuleResource.java @@ -0,0 +1,163 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.notificationhubs.v2014_09_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.notificationhubs.v2014_09_01.implementation.SharedAccessAuthorizationRuleResourceInner; +import com.microsoft.azure.arm.model.Indexable; +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.notificationhubs.v2014_09_01.implementation.NotificationHubsManager; +import java.util.Map; + +/** + * Type representing NamespaceSharedAccessAuthorizationRuleResource. + */ +public interface NamespaceSharedAccessAuthorizationRuleResource extends HasInner, Indexable, Updatable, HasManager { + /** + * @return the id value. + */ + String id(); + + /** + * @return the location value. + */ + String location(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the properties value. + */ + SharedAccessAuthorizationRuleProperties properties(); + + /** + * @return the tags value. + */ + Map tags(); + + /** + * @return the type value. + */ + String type(); + + /** + * The entirety of the NamespaceSharedAccessAuthorizationRuleResource definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithNamespace, DefinitionStages.WithProperties, DefinitionStages.WithCreate { + } + + /** + * Grouping of NamespaceSharedAccessAuthorizationRuleResource definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a NamespaceSharedAccessAuthorizationRuleResource definition. + */ + interface Blank extends WithNamespace { + } + + /** + * The stage of the namespacesharedaccessauthorizationruleresource definition allowing to specify Namespace. + */ + interface WithNamespace { + /** + * Specifies resourceGroupName, namespaceName. + * @param resourceGroupName The name of the resource group + * @param namespaceName The namespace name + * @return the next definition stage + */ + WithProperties withExistingNamespace(String resourceGroupName, String namespaceName); + } + + /** + * The stage of the namespacesharedaccessauthorizationruleresource definition allowing to specify Properties. + */ + interface WithProperties { + /** + * Specifies properties. + * @param properties Gets or sets properties of the Namespace AuthorizationRules + * @return the next definition stage + */ + WithCreate withProperties(SharedAccessAuthorizationRuleProperties properties); + } + + /** + * The stage of the namespacesharedaccessauthorizationruleresource definition allowing to specify Location. + */ + interface WithLocation { + /** + * Specifies location. + * @param location Gets or sets Namespace data center location + * @return the next definition stage + */ + WithCreate withLocation(String location); + } + + /** + * The stage of the namespacesharedaccessauthorizationruleresource definition allowing to specify Name. + */ + interface WithName { + /** + * Specifies name. + * @param name Gets or sets Name of the Namespace AuthorizationRule + * @return the next definition stage + */ + WithCreate withName(String name); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, DefinitionStages.WithLocation, DefinitionStages.WithName { + } + } + /** + * The template for a NamespaceSharedAccessAuthorizationRuleResource update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, UpdateStages.WithLocation, UpdateStages.WithName { + } + + /** + * Grouping of NamespaceSharedAccessAuthorizationRuleResource update stages. + */ + interface UpdateStages { + /** + * The stage of the namespacesharedaccessauthorizationruleresource update allowing to specify Location. + */ + interface WithLocation { + /** + * Specifies location. + * @param location Gets or sets Namespace data center location + * @return the next update stage + */ + Update withLocation(String location); + } + + /** + * The stage of the namespacesharedaccessauthorizationruleresource update allowing to specify Name. + */ + interface WithName { + /** + * Specifies name. + * @param name Gets or sets Name of the Namespace AuthorizationRule + * @return the next update stage + */ + Update withName(String name); + } + + } +} diff --git a/notificationhubs/resource-manager/v2014_09_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2014_09_01/NamespaceType.java b/notificationhubs/resource-manager/v2014_09_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2014_09_01/NamespaceType.java new file mode 100644 index 000000000000..91942daec48a --- /dev/null +++ b/notificationhubs/resource-manager/v2014_09_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2014_09_01/NamespaceType.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.notificationhubs.v2014_09_01; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for NamespaceType. + */ +public enum NamespaceType { + /** Enum value Messaging. */ + MESSAGING("Messaging"), + + /** Enum value NotificationHub. */ + NOTIFICATION_HUB("NotificationHub"); + + /** The actual serialized value for a NamespaceType instance. */ + private String value; + + NamespaceType(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a NamespaceType instance. + * + * @param value the serialized value to parse. + * @return the parsed NamespaceType object, or null if unable to parse. + */ + @JsonCreator + public static NamespaceType fromString(String value) { + NamespaceType[] items = NamespaceType.values(); + for (NamespaceType item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/notificationhubs/resource-manager/v2014_09_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2014_09_01/Namespaces.java b/notificationhubs/resource-manager/v2014_09_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2014_09_01/Namespaces.java new file mode 100644 index 000000000000..d27f677325b3 --- /dev/null +++ b/notificationhubs/resource-manager/v2014_09_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2014_09_01/Namespaces.java @@ -0,0 +1,94 @@ +/** + * 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.notificationhubs.v2014_09_01; + +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 rx.Completable; +import com.microsoft.azure.management.notificationhubs.v2014_09_01.implementation.NamespacesInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing Namespaces. + */ +public interface Namespaces extends SupportsCreating, SupportsDeletingByResourceGroup, SupportsBatchDeletion, SupportsGettingByResourceGroup, SupportsListingByResourceGroup, SupportsListing, HasInner { + /** + * Begins definition for a new AuthorizationRule resource. + * @param name resource name. + * @return the first stage of the new AuthorizationRule definition. + */ + NamespaceSharedAccessAuthorizationRuleResource.DefinitionStages.Blank defineAuthorizationRule(String name); + + /** + * The Get Operation Status operation returns the status of the specified operation. After calling an asynchronous operation, you can call Get Operation Status to determine whether the operation has succeeded, failed, or is still in progress. + * + * @param operationStatusLink Location value returned by the Begin operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable getLongRunningOperationStatusAsync(String operationStatusLink); + + /** + * Gets the authorization rules for a namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAuthorizationRulesAsync(final String resourceGroupName, final String namespaceName); + + /** + * Checks the availability of the given service namespace across all Windows Azure subscriptions. This is useful because the domain name is created based on the service namespace name. + * + * @param parameters The namespace name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable checkAvailabilityAsync(CheckAvailabilityParameters parameters); + + /** + * Deletes a namespace authorization rule. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param authorizationRuleName Authorization Rule Name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable deleteAuthorizationRuleAsync(String resourceGroupName, String namespaceName, String authorizationRuleName); + + /** + * Gets an authorization rule for a namespace by name. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name + * @param authorizationRuleName Authorization rule name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAuthorizationRuleAsync(String resourceGroupName, String namespaceName, String authorizationRuleName); + + /** + * Gets the Primary and Secondary ConnectionStrings to the namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param authorizationRuleName The connection string of the namespace for the specified authorizationRule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listKeysAsync(String resourceGroupName, String namespaceName, String authorizationRuleName); + +} diff --git a/notificationhubs/resource-manager/v2014_09_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2014_09_01/NotificationHubCreateOrUpdateParameters.java b/notificationhubs/resource-manager/v2014_09_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2014_09_01/NotificationHubCreateOrUpdateParameters.java new file mode 100644 index 000000000000..1bc832efd273 --- /dev/null +++ b/notificationhubs/resource-manager/v2014_09_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2014_09_01/NotificationHubCreateOrUpdateParameters.java @@ -0,0 +1,96 @@ +/** + * 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.notificationhubs.v2014_09_01; + +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Parameters supplied to the CreateOrUpdate NotificationHub operation. + */ +public class NotificationHubCreateOrUpdateParameters { + /** + * Gets or sets NotificationHub data center location. + */ + @JsonProperty(value = "location", required = true) + private String location; + + /** + * Gets or sets NotificationHub tags. + */ + @JsonProperty(value = "tags") + private Map tags; + + /** + * Gets or sets properties of the NotificationHub. + */ + @JsonProperty(value = "properties", required = true) + private NotificationHubProperties properties; + + /** + * Get gets or sets NotificationHub data center location. + * + * @return the location value + */ + public String location() { + return this.location; + } + + /** + * Set gets or sets NotificationHub data center location. + * + * @param location the location value to set + * @return the NotificationHubCreateOrUpdateParameters object itself. + */ + public NotificationHubCreateOrUpdateParameters withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get gets or sets NotificationHub tags. + * + * @return the tags value + */ + public Map tags() { + return this.tags; + } + + /** + * Set gets or sets NotificationHub tags. + * + * @param tags the tags value to set + * @return the NotificationHubCreateOrUpdateParameters object itself. + */ + public NotificationHubCreateOrUpdateParameters withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Get gets or sets properties of the NotificationHub. + * + * @return the properties value + */ + public NotificationHubProperties properties() { + return this.properties; + } + + /** + * Set gets or sets properties of the NotificationHub. + * + * @param properties the properties value to set + * @return the NotificationHubCreateOrUpdateParameters object itself. + */ + public NotificationHubCreateOrUpdateParameters withProperties(NotificationHubProperties properties) { + this.properties = properties; + return this; + } + +} diff --git a/notificationhubs/resource-manager/v2014_09_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2014_09_01/NotificationHubNamespaceSharedAccessAuthorizationRuleResource.java b/notificationhubs/resource-manager/v2014_09_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2014_09_01/NotificationHubNamespaceSharedAccessAuthorizationRuleResource.java new file mode 100644 index 000000000000..64787f72f137 --- /dev/null +++ b/notificationhubs/resource-manager/v2014_09_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2014_09_01/NotificationHubNamespaceSharedAccessAuthorizationRuleResource.java @@ -0,0 +1,164 @@ +/** + * 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.notificationhubs.v2014_09_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.notificationhubs.v2014_09_01.implementation.SharedAccessAuthorizationRuleResourceInner; +import com.microsoft.azure.arm.model.Indexable; +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.notificationhubs.v2014_09_01.implementation.NotificationHubsManager; +import java.util.Map; + +/** + * Type representing NotificationHubNamespaceSharedAccessAuthorizationRuleResource. + */ +public interface NotificationHubNamespaceSharedAccessAuthorizationRuleResource extends HasInner, Indexable, Updatable, HasManager { + /** + * @return the id value. + */ + String id(); + + /** + * @return the location value. + */ + String location(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the properties value. + */ + SharedAccessAuthorizationRuleProperties properties(); + + /** + * @return the tags value. + */ + Map tags(); + + /** + * @return the type value. + */ + String type(); + + /** + * The entirety of the NotificationHubNamespaceSharedAccessAuthorizationRuleResource definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithNotificationHub, DefinitionStages.WithProperties, DefinitionStages.WithCreate { + } + + /** + * Grouping of NotificationHubNamespaceSharedAccessAuthorizationRuleResource definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a NotificationHubNamespaceSharedAccessAuthorizationRuleResource definition. + */ + interface Blank extends WithNotificationHub { + } + + /** + * The stage of the notificationhubnamespacesharedaccessauthorizationruleresource definition allowing to specify NotificationHub. + */ + interface WithNotificationHub { + /** + * Specifies resourceGroupName, namespaceName, notificationHubName. + * @param resourceGroupName The name of the resource group + * @param namespaceName The namespace name + * @param notificationHubName The notification hub name + * @return the next definition stage + */ + WithProperties withExistingNotificationHub(String resourceGroupName, String namespaceName, String notificationHubName); + } + + /** + * The stage of the notificationhubnamespacesharedaccessauthorizationruleresource definition allowing to specify Properties. + */ + interface WithProperties { + /** + * Specifies properties. + * @param properties Gets or sets properties of the Namespace AuthorizationRules + * @return the next definition stage + */ + WithCreate withProperties(SharedAccessAuthorizationRuleProperties properties); + } + + /** + * The stage of the notificationhubnamespacesharedaccessauthorizationruleresource definition allowing to specify Location. + */ + interface WithLocation { + /** + * Specifies location. + * @param location Gets or sets Namespace data center location + * @return the next definition stage + */ + WithCreate withLocation(String location); + } + + /** + * The stage of the notificationhubnamespacesharedaccessauthorizationruleresource definition allowing to specify Name. + */ + interface WithName { + /** + * Specifies name. + * @param name Gets or sets Name of the Namespace AuthorizationRule + * @return the next definition stage + */ + WithCreate withName(String name); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, DefinitionStages.WithLocation, DefinitionStages.WithName { + } + } + /** + * The template for a NotificationHubNamespaceSharedAccessAuthorizationRuleResource update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, UpdateStages.WithLocation, UpdateStages.WithName { + } + + /** + * Grouping of NotificationHubNamespaceSharedAccessAuthorizationRuleResource update stages. + */ + interface UpdateStages { + /** + * The stage of the notificationhubnamespacesharedaccessauthorizationruleresource update allowing to specify Location. + */ + interface WithLocation { + /** + * Specifies location. + * @param location Gets or sets Namespace data center location + * @return the next update stage + */ + Update withLocation(String location); + } + + /** + * The stage of the notificationhubnamespacesharedaccessauthorizationruleresource update allowing to specify Name. + */ + interface WithName { + /** + * Specifies name. + * @param name Gets or sets Name of the Namespace AuthorizationRule + * @return the next update stage + */ + Update withName(String name); + } + + } +} diff --git a/notificationhubs/resource-manager/v2014_09_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2014_09_01/NotificationHubProperties.java b/notificationhubs/resource-manager/v2014_09_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2014_09_01/NotificationHubProperties.java new file mode 100644 index 000000000000..7474d18991eb --- /dev/null +++ b/notificationhubs/resource-manager/v2014_09_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2014_09_01/NotificationHubProperties.java @@ -0,0 +1,252 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.notificationhubs.v2014_09_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * NotificationHub properties. + */ +public class NotificationHubProperties { + /** + * The NotificationHub name. + */ + @JsonProperty(value = "name") + private String name; + + /** + * The RegistrationTtl of the created NotificationHub. + */ + @JsonProperty(value = "registrationTtl") + private String registrationTtl; + + /** + * The AuthorizationRules of the created NotificationHub. + */ + @JsonProperty(value = "authorizationRules") + private List authorizationRules; + + /** + * The ApnsCredential of the created NotificationHub. + */ + @JsonProperty(value = "apnsCredential") + private ApnsCredential apnsCredential; + + /** + * The WnsCredential of the created NotificationHub. + */ + @JsonProperty(value = "wnsCredential") + private WnsCredential wnsCredential; + + /** + * The GcmCredential of the created NotificationHub. + */ + @JsonProperty(value = "gcmCredential") + private GcmCredential gcmCredential; + + /** + * The MpnsCredential of the created NotificationHub. + */ + @JsonProperty(value = "mpnsCredential") + private MpnsCredential mpnsCredential; + + /** + * The AdmCredential of the created NotificationHub. + */ + @JsonProperty(value = "admCredential") + private AdmCredential admCredential; + + /** + * The BaiduCredential of the created NotificationHub. + */ + @JsonProperty(value = "baiduCredential") + private BaiduCredential baiduCredential; + + /** + * Get the NotificationHub name. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the NotificationHub name. + * + * @param name the name value to set + * @return the NotificationHubProperties object itself. + */ + public NotificationHubProperties withName(String name) { + this.name = name; + return this; + } + + /** + * Get the RegistrationTtl of the created NotificationHub. + * + * @return the registrationTtl value + */ + public String registrationTtl() { + return this.registrationTtl; + } + + /** + * Set the RegistrationTtl of the created NotificationHub. + * + * @param registrationTtl the registrationTtl value to set + * @return the NotificationHubProperties object itself. + */ + public NotificationHubProperties withRegistrationTtl(String registrationTtl) { + this.registrationTtl = registrationTtl; + return this; + } + + /** + * Get the AuthorizationRules of the created NotificationHub. + * + * @return the authorizationRules value + */ + public List authorizationRules() { + return this.authorizationRules; + } + + /** + * Set the AuthorizationRules of the created NotificationHub. + * + * @param authorizationRules the authorizationRules value to set + * @return the NotificationHubProperties object itself. + */ + public NotificationHubProperties withAuthorizationRules(List authorizationRules) { + this.authorizationRules = authorizationRules; + return this; + } + + /** + * Get the ApnsCredential of the created NotificationHub. + * + * @return the apnsCredential value + */ + public ApnsCredential apnsCredential() { + return this.apnsCredential; + } + + /** + * Set the ApnsCredential of the created NotificationHub. + * + * @param apnsCredential the apnsCredential value to set + * @return the NotificationHubProperties object itself. + */ + public NotificationHubProperties withApnsCredential(ApnsCredential apnsCredential) { + this.apnsCredential = apnsCredential; + return this; + } + + /** + * Get the WnsCredential of the created NotificationHub. + * + * @return the wnsCredential value + */ + public WnsCredential wnsCredential() { + return this.wnsCredential; + } + + /** + * Set the WnsCredential of the created NotificationHub. + * + * @param wnsCredential the wnsCredential value to set + * @return the NotificationHubProperties object itself. + */ + public NotificationHubProperties withWnsCredential(WnsCredential wnsCredential) { + this.wnsCredential = wnsCredential; + return this; + } + + /** + * Get the GcmCredential of the created NotificationHub. + * + * @return the gcmCredential value + */ + public GcmCredential gcmCredential() { + return this.gcmCredential; + } + + /** + * Set the GcmCredential of the created NotificationHub. + * + * @param gcmCredential the gcmCredential value to set + * @return the NotificationHubProperties object itself. + */ + public NotificationHubProperties withGcmCredential(GcmCredential gcmCredential) { + this.gcmCredential = gcmCredential; + return this; + } + + /** + * Get the MpnsCredential of the created NotificationHub. + * + * @return the mpnsCredential value + */ + public MpnsCredential mpnsCredential() { + return this.mpnsCredential; + } + + /** + * Set the MpnsCredential of the created NotificationHub. + * + * @param mpnsCredential the mpnsCredential value to set + * @return the NotificationHubProperties object itself. + */ + public NotificationHubProperties withMpnsCredential(MpnsCredential mpnsCredential) { + this.mpnsCredential = mpnsCredential; + return this; + } + + /** + * Get the AdmCredential of the created NotificationHub. + * + * @return the admCredential value + */ + public AdmCredential admCredential() { + return this.admCredential; + } + + /** + * Set the AdmCredential of the created NotificationHub. + * + * @param admCredential the admCredential value to set + * @return the NotificationHubProperties object itself. + */ + public NotificationHubProperties withAdmCredential(AdmCredential admCredential) { + this.admCredential = admCredential; + return this; + } + + /** + * Get the BaiduCredential of the created NotificationHub. + * + * @return the baiduCredential value + */ + public BaiduCredential baiduCredential() { + return this.baiduCredential; + } + + /** + * Set the BaiduCredential of the created NotificationHub. + * + * @param baiduCredential the baiduCredential value to set + * @return the NotificationHubProperties object itself. + */ + public NotificationHubProperties withBaiduCredential(BaiduCredential baiduCredential) { + this.baiduCredential = baiduCredential; + return this; + } + +} diff --git a/notificationhubs/resource-manager/v2014_09_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2014_09_01/NotificationHubResource.java b/notificationhubs/resource-manager/v2014_09_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2014_09_01/NotificationHubResource.java new file mode 100644 index 000000000000..3d7baf2d5ca8 --- /dev/null +++ b/notificationhubs/resource-manager/v2014_09_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2014_09_01/NotificationHubResource.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. + */ + +package com.microsoft.azure.management.notificationhubs.v2014_09_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.notificationhubs.v2014_09_01.implementation.NotificationHubResourceInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.notificationhubs.v2014_09_01.implementation.NotificationHubsManager; +import java.util.Map; + +/** + * Type representing NotificationHubResource. + */ +public interface NotificationHubResource extends HasInner, Indexable, Refreshable, Updatable, HasManager { + /** + * @return the id value. + */ + String id(); + + /** + * @return the location value. + */ + String location(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the properties value. + */ + NotificationHubProperties properties(); + + /** + * @return the tags value. + */ + Map tags(); + + /** + * @return the type value. + */ + String type(); + + /** + * The entirety of the NotificationHubResource definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithNamespace, DefinitionStages.WithLocation, DefinitionStages.WithProperties, DefinitionStages.WithCreate { + } + + /** + * Grouping of NotificationHubResource definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a NotificationHubResource definition. + */ + interface Blank extends WithNamespace { + } + + /** + * The stage of the notificationhubresource definition allowing to specify Namespace. + */ + interface WithNamespace { + /** + * Specifies resourceGroupName, namespaceName. + * @param resourceGroupName The name of the resource group + * @param namespaceName The namespace name + * @return the next definition stage + */ + WithLocation withExistingNamespace(String resourceGroupName, String namespaceName); + } + + /** + * The stage of the notificationhubresource definition allowing to specify Location. + */ + interface WithLocation { + /** + * Specifies location. + * @param location Gets or sets NotificationHub data center location + * @return the next definition stage + */ + WithProperties withLocation(String location); + } + + /** + * The stage of the notificationhubresource definition allowing to specify Properties. + */ + interface WithProperties { + /** + * Specifies properties. + * @param properties Gets or sets properties of the NotificationHub + * @return the next definition stage + */ + WithCreate withProperties(NotificationHubProperties properties); + } + + /** + * The stage of the notificationhubresource definition allowing to specify Tags. + */ + interface WithTags { + /** + * Specifies tags. + * @param tags Gets or sets NotificationHub tags + * @return the next definition stage + */ + WithCreate withTags(Map tags); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, DefinitionStages.WithTags { + } + } + /** + * The template for a NotificationHubResource update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, UpdateStages.WithTags { + } + + /** + * Grouping of NotificationHubResource update stages. + */ + interface UpdateStages { + /** + * The stage of the notificationhubresource update allowing to specify Tags. + */ + interface WithTags { + /** + * Specifies tags. + * @param tags Gets or sets NotificationHub tags + * @return the next update stage + */ + Update withTags(Map tags); + } + + } +} diff --git a/notificationhubs/resource-manager/v2014_09_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2014_09_01/NotificationHubs.java b/notificationhubs/resource-manager/v2014_09_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2014_09_01/NotificationHubs.java new file mode 100644 index 000000000000..79221672b929 --- /dev/null +++ b/notificationhubs/resource-manager/v2014_09_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2014_09_01/NotificationHubs.java @@ -0,0 +1,129 @@ +/** + * 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.notificationhubs.v2014_09_01; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import rx.Completable; +import rx.Observable; +import com.microsoft.azure.management.notificationhubs.v2014_09_01.implementation.NotificationHubsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing NotificationHubs. + */ +public interface NotificationHubs extends SupportsCreating, HasInner { + /** + * Begins definition for a new AuthorizationRule resource. + * @param name resource name. + * @return the first stage of the new AuthorizationRule definition. + */ + NotificationHubNamespaceSharedAccessAuthorizationRuleResource.DefinitionStages.Blank defineAuthorizationRule(String name); + + /** + * Gets the authorization rules for a NotificationHub. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name + * @param notificationHubName The notification hub name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAuthorizationRulesAsync(final String resourceGroupName, final String namespaceName, final String notificationHubName); + + /** + * Lists the PNS Credentials associated with a notification hub . + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param notificationHubName The notification hub name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getPnsCredentialsAsync(String resourceGroupName, String namespaceName, String notificationHubName); + + /** + * Lists the notification hubs associated with a namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param notificationHubName The notification hub name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String namespaceName, String notificationHubName); + + /** + * Lists the notification hubs associated with a namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(final String resourceGroupName, final String namespaceName); + + /** + * Deletes a notification hub associated with a namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param notificationHubName The notification hub name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable deleteAsync(String resourceGroupName, String namespaceName, String notificationHubName); + + /** + * Checks the availability of the given notificationHub in a namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param parameters The notificationHub name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable checkAvailabilityAsync(String resourceGroupName, String namespaceName, CheckAvailabilityParameters parameters); + + /** + * Deletes a notificationHub authorization rule. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param notificationHubName The notification hub name. + * @param authorizationRuleName Authorization Rule Name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable deleteAuthorizationRuleAsync(String resourceGroupName, String namespaceName, String notificationHubName, String authorizationRuleName); + + /** + * Gets an authorization rule for a NotificationHub by name. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name + * @param notificationHubName The notification hub name. + * @param authorizationRuleName authorization rule name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAuthorizationRuleAsync(String resourceGroupName, String namespaceName, String notificationHubName, String authorizationRuleName); + + /** + * Gets the Primary and Secondary ConnectionStrings to the NotificationHub. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param notificationHubName The notification hub name. + * @param authorizationRuleName The connection string of the NotificationHub for the specified authorizationRule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listKeysAsync(String resourceGroupName, String namespaceName, String notificationHubName, String authorizationRuleName); + +} diff --git a/notificationhubs/resource-manager/v2014_09_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2014_09_01/ResourceListKeys.java b/notificationhubs/resource-manager/v2014_09_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2014_09_01/ResourceListKeys.java new file mode 100644 index 000000000000..d30360757f2c --- /dev/null +++ b/notificationhubs/resource-manager/v2014_09_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2014_09_01/ResourceListKeys.java @@ -0,0 +1,30 @@ +/** + * 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.notificationhubs.v2014_09_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.notificationhubs.v2014_09_01.implementation.NotificationHubsManager; +import com.microsoft.azure.management.notificationhubs.v2014_09_01.implementation.ResourceListKeysInner; + +/** + * Type representing ResourceListKeys. + */ +public interface ResourceListKeys extends HasInner, HasManager { + /** + * @return the primaryConnectionString value. + */ + String primaryConnectionString(); + + /** + * @return the secondaryConnectionString value. + */ + String secondaryConnectionString(); + +} diff --git a/notificationhubs/resource-manager/v2014_09_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2014_09_01/SharedAccessAuthorizationRuleCreateOrUpdateParameters.java b/notificationhubs/resource-manager/v2014_09_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2014_09_01/SharedAccessAuthorizationRuleCreateOrUpdateParameters.java new file mode 100644 index 000000000000..5e3a4745f8c9 --- /dev/null +++ b/notificationhubs/resource-manager/v2014_09_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2014_09_01/SharedAccessAuthorizationRuleCreateOrUpdateParameters.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.notificationhubs.v2014_09_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Parameters supplied to the CreateOrUpdate Namespace AuthorizationRules. + */ +public class SharedAccessAuthorizationRuleCreateOrUpdateParameters { + /** + * Gets or sets Namespace data center location. + */ + @JsonProperty(value = "location") + private String location; + + /** + * Gets or sets Name of the Namespace AuthorizationRule. + */ + @JsonProperty(value = "name") + private String name; + + /** + * Gets or sets properties of the Namespace AuthorizationRules. + */ + @JsonProperty(value = "properties", required = true) + private SharedAccessAuthorizationRuleProperties properties; + + /** + * Get gets or sets Namespace data center location. + * + * @return the location value + */ + public String location() { + return this.location; + } + + /** + * Set gets or sets Namespace data center location. + * + * @param location the location value to set + * @return the SharedAccessAuthorizationRuleCreateOrUpdateParameters object itself. + */ + public SharedAccessAuthorizationRuleCreateOrUpdateParameters withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get gets or sets Name of the Namespace AuthorizationRule. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set gets or sets Name of the Namespace AuthorizationRule. + * + * @param name the name value to set + * @return the SharedAccessAuthorizationRuleCreateOrUpdateParameters object itself. + */ + public SharedAccessAuthorizationRuleCreateOrUpdateParameters withName(String name) { + this.name = name; + return this; + } + + /** + * Get gets or sets properties of the Namespace AuthorizationRules. + * + * @return the properties value + */ + public SharedAccessAuthorizationRuleProperties properties() { + return this.properties; + } + + /** + * Set gets or sets properties of the Namespace AuthorizationRules. + * + * @param properties the properties value to set + * @return the SharedAccessAuthorizationRuleCreateOrUpdateParameters object itself. + */ + public SharedAccessAuthorizationRuleCreateOrUpdateParameters withProperties(SharedAccessAuthorizationRuleProperties properties) { + this.properties = properties; + return this; + } + +} diff --git a/notificationhubs/resource-manager/v2014_09_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2014_09_01/SharedAccessAuthorizationRuleProperties.java b/notificationhubs/resource-manager/v2014_09_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2014_09_01/SharedAccessAuthorizationRuleProperties.java new file mode 100644 index 000000000000..cdb5a512d228 --- /dev/null +++ b/notificationhubs/resource-manager/v2014_09_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2014_09_01/SharedAccessAuthorizationRuleProperties.java @@ -0,0 +1,253 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.notificationhubs.v2014_09_01; + +import java.util.List; +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * SharedAccessAuthorizationRule properties. + */ +public class SharedAccessAuthorizationRuleProperties { + /** + * The primary key that was used. + */ + @JsonProperty(value = "primaryKey") + private String primaryKey; + + /** + * The secondary key that was used. + */ + @JsonProperty(value = "secondaryKey") + private String secondaryKey; + + /** + * The name of the key that was used. + */ + @JsonProperty(value = "keyName") + private String keyName; + + /** + * The type of the claim. + */ + @JsonProperty(value = "claimType") + private String claimType; + + /** + * The value of the claim. + */ + @JsonProperty(value = "claimValue") + private String claimValue; + + /** + * The rights associated with the rule. + */ + @JsonProperty(value = "rights") + private List rights; + + /** + * The time at which the authorization rule was created. + */ + @JsonProperty(value = "createdTime") + private DateTime createdTime; + + /** + * The most recent time the rule was updated. + */ + @JsonProperty(value = "modifiedTime") + private DateTime modifiedTime; + + /** + * The revision number for the rule. + */ + @JsonProperty(value = "revision") + private Integer revision; + + /** + * Get the primary key that was used. + * + * @return the primaryKey value + */ + public String primaryKey() { + return this.primaryKey; + } + + /** + * Set the primary key that was used. + * + * @param primaryKey the primaryKey value to set + * @return the SharedAccessAuthorizationRuleProperties object itself. + */ + public SharedAccessAuthorizationRuleProperties withPrimaryKey(String primaryKey) { + this.primaryKey = primaryKey; + return this; + } + + /** + * Get the secondary key that was used. + * + * @return the secondaryKey value + */ + public String secondaryKey() { + return this.secondaryKey; + } + + /** + * Set the secondary key that was used. + * + * @param secondaryKey the secondaryKey value to set + * @return the SharedAccessAuthorizationRuleProperties object itself. + */ + public SharedAccessAuthorizationRuleProperties withSecondaryKey(String secondaryKey) { + this.secondaryKey = secondaryKey; + return this; + } + + /** + * Get the name of the key that was used. + * + * @return the keyName value + */ + public String keyName() { + return this.keyName; + } + + /** + * Set the name of the key that was used. + * + * @param keyName the keyName value to set + * @return the SharedAccessAuthorizationRuleProperties object itself. + */ + public SharedAccessAuthorizationRuleProperties withKeyName(String keyName) { + this.keyName = keyName; + return this; + } + + /** + * Get the type of the claim. + * + * @return the claimType value + */ + public String claimType() { + return this.claimType; + } + + /** + * Set the type of the claim. + * + * @param claimType the claimType value to set + * @return the SharedAccessAuthorizationRuleProperties object itself. + */ + public SharedAccessAuthorizationRuleProperties withClaimType(String claimType) { + this.claimType = claimType; + return this; + } + + /** + * Get the value of the claim. + * + * @return the claimValue value + */ + public String claimValue() { + return this.claimValue; + } + + /** + * Set the value of the claim. + * + * @param claimValue the claimValue value to set + * @return the SharedAccessAuthorizationRuleProperties object itself. + */ + public SharedAccessAuthorizationRuleProperties withClaimValue(String claimValue) { + this.claimValue = claimValue; + return this; + } + + /** + * Get the rights associated with the rule. + * + * @return the rights value + */ + public List rights() { + return this.rights; + } + + /** + * Set the rights associated with the rule. + * + * @param rights the rights value to set + * @return the SharedAccessAuthorizationRuleProperties object itself. + */ + public SharedAccessAuthorizationRuleProperties withRights(List rights) { + this.rights = rights; + return this; + } + + /** + * Get the time at which the authorization rule was created. + * + * @return the createdTime value + */ + public DateTime createdTime() { + return this.createdTime; + } + + /** + * Set the time at which the authorization rule was created. + * + * @param createdTime the createdTime value to set + * @return the SharedAccessAuthorizationRuleProperties object itself. + */ + public SharedAccessAuthorizationRuleProperties withCreatedTime(DateTime createdTime) { + this.createdTime = createdTime; + return this; + } + + /** + * Get the most recent time the rule was updated. + * + * @return the modifiedTime value + */ + public DateTime modifiedTime() { + return this.modifiedTime; + } + + /** + * Set the most recent time the rule was updated. + * + * @param modifiedTime the modifiedTime value to set + * @return the SharedAccessAuthorizationRuleProperties object itself. + */ + public SharedAccessAuthorizationRuleProperties withModifiedTime(DateTime modifiedTime) { + this.modifiedTime = modifiedTime; + return this; + } + + /** + * Get the revision number for the rule. + * + * @return the revision value + */ + public Integer revision() { + return this.revision; + } + + /** + * Set the revision number for the rule. + * + * @param revision the revision value to set + * @return the SharedAccessAuthorizationRuleProperties object itself. + */ + public SharedAccessAuthorizationRuleProperties withRevision(Integer revision) { + this.revision = revision; + return this; + } + +} diff --git a/notificationhubs/resource-manager/v2014_09_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2014_09_01/WnsCredential.java b/notificationhubs/resource-manager/v2014_09_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2014_09_01/WnsCredential.java new file mode 100644 index 000000000000..14085de58dc3 --- /dev/null +++ b/notificationhubs/resource-manager/v2014_09_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2014_09_01/WnsCredential.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.notificationhubs.v2014_09_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Description of a NotificationHub WnsCredential. + */ +public class WnsCredential { + /** + * Gets or sets properties of NotificationHub WnsCredential. + */ + @JsonProperty(value = "properties") + private WnsCredentialProperties properties; + + /** + * Get gets or sets properties of NotificationHub WnsCredential. + * + * @return the properties value + */ + public WnsCredentialProperties properties() { + return this.properties; + } + + /** + * Set gets or sets properties of NotificationHub WnsCredential. + * + * @param properties the properties value to set + * @return the WnsCredential object itself. + */ + public WnsCredential withProperties(WnsCredentialProperties properties) { + this.properties = properties; + return this; + } + +} diff --git a/notificationhubs/resource-manager/v2014_09_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2014_09_01/WnsCredentialProperties.java b/notificationhubs/resource-manager/v2014_09_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2014_09_01/WnsCredentialProperties.java new file mode 100644 index 000000000000..74da872fe837 --- /dev/null +++ b/notificationhubs/resource-manager/v2014_09_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2014_09_01/WnsCredentialProperties.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.notificationhubs.v2014_09_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Description of a NotificationHub WnsCredential. + */ +public class WnsCredentialProperties { + /** + * Gets or sets the package ID for this credential. + */ + @JsonProperty(value = "packageSid") + private String packageSid; + + /** + * Gets or sets the secret key. + */ + @JsonProperty(value = "secretKey") + private String secretKey; + + /** + * Gets or sets the Windows Live endpoint. + */ + @JsonProperty(value = "windowsLiveEndpoint") + private String windowsLiveEndpoint; + + /** + * Get gets or sets the package ID for this credential. + * + * @return the packageSid value + */ + public String packageSid() { + return this.packageSid; + } + + /** + * Set gets or sets the package ID for this credential. + * + * @param packageSid the packageSid value to set + * @return the WnsCredentialProperties object itself. + */ + public WnsCredentialProperties withPackageSid(String packageSid) { + this.packageSid = packageSid; + return this; + } + + /** + * Get gets or sets the secret key. + * + * @return the secretKey value + */ + public String secretKey() { + return this.secretKey; + } + + /** + * Set gets or sets the secret key. + * + * @param secretKey the secretKey value to set + * @return the WnsCredentialProperties object itself. + */ + public WnsCredentialProperties withSecretKey(String secretKey) { + this.secretKey = secretKey; + return this; + } + + /** + * Get gets or sets the Windows Live endpoint. + * + * @return the windowsLiveEndpoint value + */ + public String windowsLiveEndpoint() { + return this.windowsLiveEndpoint; + } + + /** + * Set gets or sets the Windows Live endpoint. + * + * @param windowsLiveEndpoint the windowsLiveEndpoint value to set + * @return the WnsCredentialProperties object itself. + */ + public WnsCredentialProperties withWindowsLiveEndpoint(String windowsLiveEndpoint) { + this.windowsLiveEndpoint = windowsLiveEndpoint; + return this; + } + +} diff --git a/notificationhubs/resource-manager/v2014_09_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2014_09_01/implementation/CheckAvailabilityResourceImpl.java b/notificationhubs/resource-manager/v2014_09_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2014_09_01/implementation/CheckAvailabilityResourceImpl.java new file mode 100644 index 000000000000..7ff3ca2035bf --- /dev/null +++ b/notificationhubs/resource-manager/v2014_09_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2014_09_01/implementation/CheckAvailabilityResourceImpl.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.notificationhubs.v2014_09_01.implementation; + +import com.microsoft.azure.management.notificationhubs.v2014_09_01.CheckAvailabilityResource; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import java.util.Map; + +class CheckAvailabilityResourceImpl extends WrapperImpl implements CheckAvailabilityResource { + private final NotificationHubsManager manager; + CheckAvailabilityResourceImpl(CheckAvailabilityResourceInner inner, NotificationHubsManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public NotificationHubsManager manager() { + return this.manager; + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public Boolean isAvailiable() { + return this.inner().isAvailiable(); + } + + @Override + public String location() { + return this.inner().location(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public Map tags() { + return this.inner().tags(); + } + + @Override + public String type() { + return this.inner().type(); + } + +} diff --git a/notificationhubs/resource-manager/v2014_09_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2014_09_01/implementation/CheckAvailabilityResourceInner.java b/notificationhubs/resource-manager/v2014_09_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2014_09_01/implementation/CheckAvailabilityResourceInner.java new file mode 100644 index 000000000000..dd2f0fef8dfd --- /dev/null +++ b/notificationhubs/resource-manager/v2014_09_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2014_09_01/implementation/CheckAvailabilityResourceInner.java @@ -0,0 +1,175 @@ +/** + * 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.notificationhubs.v2014_09_01.implementation; + +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Description of a CheckAvailibility resource. + */ +public class CheckAvailabilityResourceInner { + /** + * Gets or sets the id. + */ + @JsonProperty(value = "id") + private String id; + + /** + * Gets or sets datacenter location. + */ + @JsonProperty(value = "location") + private String location; + + /** + * Gets or sets name. + */ + @JsonProperty(value = "name") + private String name; + + /** + * Gets or sets resource type. + */ + @JsonProperty(value = "type") + private String type; + + /** + * Gets or sets tags. + */ + @JsonProperty(value = "tags") + private Map tags; + + /** + * Gets or sets true if the name is available and can be used to create new + * Namespace/NotificationHub. Otherwise false. + */ + @JsonProperty(value = "isAvailiable") + private Boolean isAvailiable; + + /** + * Get gets or sets the id. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set gets or sets the id. + * + * @param id the id value to set + * @return the CheckAvailabilityResourceInner object itself. + */ + public CheckAvailabilityResourceInner withId(String id) { + this.id = id; + return this; + } + + /** + * Get gets or sets datacenter location. + * + * @return the location value + */ + public String location() { + return this.location; + } + + /** + * Set gets or sets datacenter location. + * + * @param location the location value to set + * @return the CheckAvailabilityResourceInner object itself. + */ + public CheckAvailabilityResourceInner withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get gets or sets name. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set gets or sets name. + * + * @param name the name value to set + * @return the CheckAvailabilityResourceInner object itself. + */ + public CheckAvailabilityResourceInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get gets or sets resource type. + * + * @return the type value + */ + public String type() { + return this.type; + } + + /** + * Set gets or sets resource type. + * + * @param type the type value to set + * @return the CheckAvailabilityResourceInner object itself. + */ + public CheckAvailabilityResourceInner withType(String type) { + this.type = type; + return this; + } + + /** + * Get gets or sets tags. + * + * @return the tags value + */ + public Map tags() { + return this.tags; + } + + /** + * Set gets or sets tags. + * + * @param tags the tags value to set + * @return the CheckAvailabilityResourceInner object itself. + */ + public CheckAvailabilityResourceInner withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Get gets or sets true if the name is available and can be used to create new Namespace/NotificationHub. Otherwise false. + * + * @return the isAvailiable value + */ + public Boolean isAvailiable() { + return this.isAvailiable; + } + + /** + * Set gets or sets true if the name is available and can be used to create new Namespace/NotificationHub. Otherwise false. + * + * @param isAvailiable the isAvailiable value to set + * @return the CheckAvailabilityResourceInner object itself. + */ + public CheckAvailabilityResourceInner withIsAvailiable(Boolean isAvailiable) { + this.isAvailiable = isAvailiable; + return this; + } + +} diff --git a/notificationhubs/resource-manager/v2014_09_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2014_09_01/implementation/IdParsingUtils.java b/notificationhubs/resource-manager/v2014_09_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2014_09_01/implementation/IdParsingUtils.java new file mode 100644 index 000000000000..cd227e4b8e49 --- /dev/null +++ b/notificationhubs/resource-manager/v2014_09_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2014_09_01/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.notificationhubs.v2014_09_01.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/notificationhubs/resource-manager/v2014_09_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2014_09_01/implementation/NamespaceResourceImpl.java b/notificationhubs/resource-manager/v2014_09_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2014_09_01/implementation/NamespaceResourceImpl.java new file mode 100644 index 000000000000..e6bb81a5611a --- /dev/null +++ b/notificationhubs/resource-manager/v2014_09_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2014_09_01/implementation/NamespaceResourceImpl.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.notificationhubs.v2014_09_01.implementation; + +import com.microsoft.azure.arm.resources.models.implementation.GroupableResourceCoreImpl; +import com.microsoft.azure.management.notificationhubs.v2014_09_01.NamespaceResource; +import rx.Observable; +import com.microsoft.azure.management.notificationhubs.v2014_09_01.NamespaceCreateOrUpdateParameters; +import com.microsoft.azure.management.notificationhubs.v2014_09_01.NamespaceProperties; +import rx.functions.Func1; + +class NamespaceResourceImpl extends GroupableResourceCoreImpl implements NamespaceResource, NamespaceResource.Definition, NamespaceResource.Update { + private NamespaceCreateOrUpdateParameters createOrUpdateParameter; + NamespaceResourceImpl(String name, NamespaceResourceInner inner, NotificationHubsManager manager) { + super(name, inner, manager); + this.createOrUpdateParameter = new NamespaceCreateOrUpdateParameters(); + } + + @Override + public Observable createResourceAsync() { + NamespacesInner client = this.manager().inner().namespaces(); + this.createOrUpdateParameter.withLocation(inner().location()); + this.createOrUpdateParameter.withTags(inner().getTags()); + return client.createOrUpdateAsync(this.resourceGroupName(), this.name(), this.createOrUpdateParameter) + .map(new Func1() { + @Override + public NamespaceResourceInner call(NamespaceResourceInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + NamespacesInner client = this.manager().inner().namespaces(); + return client.createOrUpdateAsync(this.resourceGroupName(), this.name(), this.createOrUpdateParameter) + .map(new Func1() { + @Override + public NamespaceResourceInner call(NamespaceResourceInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + NamespacesInner client = this.manager().inner().namespaces(); + return client.getByResourceGroupAsync(this.resourceGroupName(), this.name()); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + private void resetCreateUpdateParameters() { + this.createOrUpdateParameter = new NamespaceCreateOrUpdateParameters(); + } + + @Override + public NamespaceProperties properties() { + return this.inner().properties(); + } + + @Override + public NamespaceResourceImpl withProperties(NamespaceProperties properties) { + this.createOrUpdateParameter.withProperties(properties); + return this; + } + +} diff --git a/notificationhubs/resource-manager/v2014_09_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2014_09_01/implementation/NamespaceResourceInner.java b/notificationhubs/resource-manager/v2014_09_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2014_09_01/implementation/NamespaceResourceInner.java new file mode 100644 index 000000000000..b0db44558b41 --- /dev/null +++ b/notificationhubs/resource-manager/v2014_09_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2014_09_01/implementation/NamespaceResourceInner.java @@ -0,0 +1,45 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.notificationhubs.v2014_09_01.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.azure.Resource; +import com.microsoft.azure.management.notificationhubs.v2014_09_01.NamespaceProperties; + +/** + * Description of a Namespace resource. + */ +public class NamespaceResourceInner extends Resource { + /** + * Gets or sets properties of the Namespace. + */ + @JsonProperty(value = "properties") + private NamespaceProperties properties; + + /** + * Get gets or sets properties of the Namespace. + * + * @return the properties value + */ + public NamespaceProperties properties() { + return this.properties; + } + + /** + * Set gets or sets properties of the Namespace. + * + * @param properties the properties value to set + * @return the NamespaceResourceInner object itself. + */ + public NamespaceResourceInner withProperties(NamespaceProperties properties) { + this.properties = properties; + return this; + } + +} diff --git a/notificationhubs/resource-manager/v2014_09_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2014_09_01/implementation/NamespaceSharedAccessAuthorizationRuleResourceImpl.java b/notificationhubs/resource-manager/v2014_09_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2014_09_01/implementation/NamespaceSharedAccessAuthorizationRuleResourceImpl.java new file mode 100644 index 000000000000..443095e37031 --- /dev/null +++ b/notificationhubs/resource-manager/v2014_09_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2014_09_01/implementation/NamespaceSharedAccessAuthorizationRuleResourceImpl.java @@ -0,0 +1,151 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.notificationhubs.v2014_09_01.implementation; + +import com.microsoft.azure.management.notificationhubs.v2014_09_01.NamespaceSharedAccessAuthorizationRuleResource; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import com.microsoft.azure.management.notificationhubs.v2014_09_01.SharedAccessAuthorizationRuleCreateOrUpdateParameters; +import com.microsoft.azure.management.notificationhubs.v2014_09_01.SharedAccessAuthorizationRuleProperties; +import java.util.Map; +import rx.functions.Func1; + +class NamespaceSharedAccessAuthorizationRuleResourceImpl extends CreatableUpdatableImpl implements NamespaceSharedAccessAuthorizationRuleResource, NamespaceSharedAccessAuthorizationRuleResource.Definition, NamespaceSharedAccessAuthorizationRuleResource.Update { + private final NotificationHubsManager manager; + private String resourceGroupName; + private String namespaceName; + private String authorizationRuleName; + private SharedAccessAuthorizationRuleCreateOrUpdateParameters createOrUpdateParameter; + + NamespaceSharedAccessAuthorizationRuleResourceImpl(String name, NotificationHubsManager manager) { + super(name, new SharedAccessAuthorizationRuleResourceInner()); + this.manager = manager; + // Set resource name + this.authorizationRuleName = name; + // + this.createOrUpdateParameter = new SharedAccessAuthorizationRuleCreateOrUpdateParameters(); + } + + NamespaceSharedAccessAuthorizationRuleResourceImpl(SharedAccessAuthorizationRuleResourceInner inner, NotificationHubsManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.authorizationRuleName = inner.name(); + // resource ancestor names + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.namespaceName = IdParsingUtils.getValueFromIdByName(inner.id(), "namespaces"); + this.authorizationRuleName = IdParsingUtils.getValueFromIdByName(inner.id(), "AuthorizationRules"); + // + this.createOrUpdateParameter = new SharedAccessAuthorizationRuleCreateOrUpdateParameters(); + } + + @Override + public NotificationHubsManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + NamespacesInner client = this.manager().inner().namespaces(); + return client.createOrUpdateAuthorizationRuleAsync(this.resourceGroupName, this.namespaceName, this.authorizationRuleName, this.createOrUpdateParameter) + .map(new Func1() { + @Override + public SharedAccessAuthorizationRuleResourceInner call(SharedAccessAuthorizationRuleResourceInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + NamespacesInner client = this.manager().inner().namespaces(); + return client.createOrUpdateAuthorizationRuleAsync(this.resourceGroupName, this.namespaceName, this.authorizationRuleName, this.createOrUpdateParameter) + .map(new Func1() { + @Override + public SharedAccessAuthorizationRuleResourceInner call(SharedAccessAuthorizationRuleResourceInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + NamespacesInner client = this.manager().inner().namespaces(); + return null; // NOP getInnerAsync implementation as get is not supported + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + private void resetCreateUpdateParameters() { + this.createOrUpdateParameter = new SharedAccessAuthorizationRuleCreateOrUpdateParameters(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String location() { + return this.inner().location(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public SharedAccessAuthorizationRuleProperties properties() { + return this.inner().properties(); + } + + @Override + public Map tags() { + return this.inner().tags(); + } + + @Override + public String type() { + return this.inner().type(); + } + + @Override + public NamespaceSharedAccessAuthorizationRuleResourceImpl withExistingNamespace(String resourceGroupName, String namespaceName) { + this.resourceGroupName = resourceGroupName; + this.namespaceName = namespaceName; + return this; + } + + @Override + public NamespaceSharedAccessAuthorizationRuleResourceImpl withProperties(SharedAccessAuthorizationRuleProperties properties) { + this.createOrUpdateParameter.withProperties(properties); + return this; + } + + @Override + public NamespaceSharedAccessAuthorizationRuleResourceImpl withLocation(String location) { + this.createOrUpdateParameter.withLocation(location); + return this; + } + + @Override + public NamespaceSharedAccessAuthorizationRuleResourceImpl withName(String name) { + this.createOrUpdateParameter.withName(name); + return this; + } + +} diff --git a/notificationhubs/resource-manager/v2014_09_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2014_09_01/implementation/NamespacesImpl.java b/notificationhubs/resource-manager/v2014_09_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2014_09_01/implementation/NamespacesImpl.java new file mode 100644 index 000000000000..b04bc4b0e286 --- /dev/null +++ b/notificationhubs/resource-manager/v2014_09_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2014_09_01/implementation/NamespacesImpl.java @@ -0,0 +1,221 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * def + */ + +package com.microsoft.azure.management.notificationhubs.v2014_09_01.implementation; + +import com.microsoft.azure.arm.resources.collection.implementation.GroupableResourcesCoreImpl; +import com.microsoft.azure.management.notificationhubs.v2014_09_01.Namespaces; +import com.microsoft.azure.management.notificationhubs.v2014_09_01.NamespaceResource; +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.notificationhubs.v2014_09_01.NamespaceSharedAccessAuthorizationRuleResource; +import com.microsoft.azure.management.notificationhubs.v2014_09_01.CheckAvailabilityResource; +import com.microsoft.azure.management.notificationhubs.v2014_09_01.CheckAvailabilityParameters; +import com.microsoft.azure.management.notificationhubs.v2014_09_01.ResourceListKeys; + +class NamespacesImpl extends GroupableResourcesCoreImpl implements Namespaces { + protected NamespacesImpl(NotificationHubsManager manager) { + super(manager.inner().namespaces(), manager); + } + + @Override + protected Observable getInnerAsync(String resourceGroupName, String name) { + NamespacesInner client = this.inner(); + return client.getByResourceGroupAsync(resourceGroupName, name); + } + + @Override + protected Completable deleteInnerAsync(String resourceGroupName, String name) { + NamespacesInner 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) { + NamespacesInner client = this.inner(); + return this.wrapList(client.listByResourceGroup(resourceGroupName)); + } + + @Override + public Observable listByResourceGroupAsync(String resourceGroupName) { + NamespacesInner 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 NamespaceResource call(NamespaceResourceInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public PagedList list() { + NamespacesInner client = this.inner(); + return this.wrapList(client.list()); + } + + @Override + public Observable listAsync() { + NamespacesInner client = this.inner(); + return client.listAsync() + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public NamespaceResource call(NamespaceResourceInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public NamespaceResourceImpl define(String name) { + return wrapModel(name); + } + + @Override + public Completable getLongRunningOperationStatusAsync(String operationStatusLink) { + NamespacesInner client = this.inner(); + return client.getLongRunningOperationStatusAsync(operationStatusLink).toCompletable(); + } + + @Override + public Observable listAuthorizationRulesAsync(final String resourceGroupName, final String namespaceName) { + NamespacesInner client = this.inner(); + return client.listAuthorizationRulesAsync(resourceGroupName, namespaceName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public NamespaceSharedAccessAuthorizationRuleResource call(SharedAccessAuthorizationRuleResourceInner inner) { + return new NamespaceSharedAccessAuthorizationRuleResourceImpl(inner, manager()); + } + }); + } + + @Override + public Observable checkAvailabilityAsync(CheckAvailabilityParameters parameters) { + NamespacesInner client = this.inner(); + return client.checkAvailabilityAsync(parameters) + .map(new Func1() { + @Override + public CheckAvailabilityResource call(CheckAvailabilityResourceInner inner) { + return new CheckAvailabilityResourceImpl(inner, manager()); + } + }); + } + + @Override + protected NamespaceResourceImpl wrapModel(NamespaceResourceInner inner) { + return new NamespaceResourceImpl(inner.name(), inner, manager()); + } + + @Override + protected NamespaceResourceImpl wrapModel(String name) { + return new NamespaceResourceImpl(name, new NamespaceResourceInner(), this.manager()); + } + + @Override + public NamespaceSharedAccessAuthorizationRuleResourceImpl defineAuthorizationRule(String name) { + return wrapAuthorizationRuleModel(name); + } + + private NamespaceSharedAccessAuthorizationRuleResourceImpl wrapAuthorizationRuleModel(String name) { + return new NamespaceSharedAccessAuthorizationRuleResourceImpl(name, this.manager()); + } + + private NamespaceSharedAccessAuthorizationRuleResourceImpl wrapNamespaceSharedAccessAuthorizationRuleResourceModel(SharedAccessAuthorizationRuleResourceInner inner) { + return new NamespaceSharedAccessAuthorizationRuleResourceImpl(inner, manager()); + } + + @Override + public Completable deleteAuthorizationRuleAsync(String resourceGroupName, String namespaceName, String authorizationRuleName) { + NamespacesInner client = this.inner(); + return client.deleteAuthorizationRuleAsync(resourceGroupName, namespaceName, authorizationRuleName).toCompletable(); + } + + @Override + public Observable getAuthorizationRuleAsync(String resourceGroupName, String namespaceName, String authorizationRuleName) { + NamespacesInner client = this.inner(); + return client.getAuthorizationRuleAsync(resourceGroupName, namespaceName, authorizationRuleName) + .map(new Func1() { + @Override + public NamespaceSharedAccessAuthorizationRuleResource call(SharedAccessAuthorizationRuleResourceInner inner) { + return new NamespaceSharedAccessAuthorizationRuleResourceImpl(inner, manager()); + } + }); + } + + @Override + public Observable listKeysAsync(String resourceGroupName, String namespaceName, String authorizationRuleName) { + NamespacesInner client = this.inner(); + return client.listKeysAsync(resourceGroupName, namespaceName, authorizationRuleName) + .map(new Func1() { + @Override + public ResourceListKeys call(ResourceListKeysInner inner) { + return new ResourceListKeysImpl(inner, manager()); + } + }); + } + +} diff --git a/notificationhubs/resource-manager/v2014_09_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2014_09_01/implementation/NamespacesInner.java b/notificationhubs/resource-manager/v2014_09_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2014_09_01/implementation/NamespacesInner.java new file mode 100644 index 000000000000..1e27ad6ba0ba --- /dev/null +++ b/notificationhubs/resource-manager/v2014_09_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2014_09_01/implementation/NamespacesInner.java @@ -0,0 +1,1685 @@ +/** + * 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.notificationhubs.v2014_09_01.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.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.notificationhubs.v2014_09_01.CheckAvailabilityParameters; +import com.microsoft.azure.management.notificationhubs.v2014_09_01.NamespaceCreateOrUpdateParameters; +import com.microsoft.azure.management.notificationhubs.v2014_09_01.SharedAccessAuthorizationRuleCreateOrUpdateParameters; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.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 Namespaces. + */ +public class NamespacesInner implements InnerSupportsGet, InnerSupportsDelete, InnerSupportsListing { + /** The Retrofit service to perform REST calls. */ + private NamespacesService service; + /** The service client containing this operation class. */ + private NotificationHubsManagementClientImpl client; + + /** + * Initializes an instance of NamespacesInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public NamespacesInner(Retrofit retrofit, NotificationHubsManagementClientImpl client) { + this.service = retrofit.create(NamespacesService.class); + this.client = client; + } + + /** + * The interface defining all the services for Namespaces to be + * used by Retrofit to perform actually REST calls. + */ + interface NamespacesService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.notificationhubs.v2014_09_01.Namespaces checkAvailability" }) + @POST("subscriptions/{subscriptionId}/providers/Microsoft.NotificationHubs/checkNamespaceAvailability") + Observable> checkAvailability(@Path("subscriptionId") String subscriptionId, @Body CheckAvailabilityParameters parameters, @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.notificationhubs.v2014_09_01.Namespaces createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}") + Observable> createOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @Path("subscriptionId") String subscriptionId, @Body NamespaceCreateOrUpdateParameters parameters, @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.notificationhubs.v2014_09_01.Namespaces delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @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.notificationhubs.v2014_09_01.Namespaces beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @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.notificationhubs.v2014_09_01.Namespaces getByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}") + Observable> getByResourceGroup(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @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.notificationhubs.v2014_09_01.Namespaces createOrUpdateAuthorizationRule" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/AuthorizationRules/{authorizationRuleName}") + Observable> createOrUpdateAuthorizationRule(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @Path("authorizationRuleName") String authorizationRuleName, @Path("subscriptionId") String subscriptionId, @Body SharedAccessAuthorizationRuleCreateOrUpdateParameters parameters, @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.notificationhubs.v2014_09_01.Namespaces deleteAuthorizationRule" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/AuthorizationRules/{authorizationRuleName}", method = "DELETE", hasBody = true) + Observable> deleteAuthorizationRule(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @Path("authorizationRuleName") String authorizationRuleName, @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.notificationhubs.v2014_09_01.Namespaces getAuthorizationRule" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/AuthorizationRules/{authorizationRuleName}") + Observable> getAuthorizationRule(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @Path("authorizationRuleName") String authorizationRuleName, @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.notificationhubs.v2014_09_01.Namespaces getLongRunningOperationStatus" }) + @GET("{operationStatusLink}") + Observable> getLongRunningOperationStatus(@Path(value = "operationStatusLink", encoded = true) String operationStatusLink, @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.notificationhubs.v2014_09_01.Namespaces listByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces") + Observable> listByResourceGroup(@Path("resourceGroupName") String resourceGroupName, @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.notificationhubs.v2014_09_01.Namespaces list" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.NotificationHubs/namespaces") + 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.notificationhubs.v2014_09_01.Namespaces listAuthorizationRules" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/AuthorizationRules") + Observable> listAuthorizationRules(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @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.notificationhubs.v2014_09_01.Namespaces listKeys" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/AuthorizationRules/{authorizationRuleName}/listKeys") + Observable> listKeys(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @Path("authorizationRuleName") String authorizationRuleName, @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.notificationhubs.v2014_09_01.Namespaces listByResourceGroupNext" }) + @GET + Observable> listByResourceGroupNext(@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.notificationhubs.v2014_09_01.Namespaces 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.notificationhubs.v2014_09_01.Namespaces listAuthorizationRulesNext" }) + @GET + Observable> listAuthorizationRulesNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Checks the availability of the given service namespace across all Windows Azure subscriptions. This is useful because the domain name is created based on the service namespace name. + * + * @param parameters The namespace name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the CheckAvailabilityResourceInner object if successful. + */ + public CheckAvailabilityResourceInner checkAvailability(CheckAvailabilityParameters parameters) { + return checkAvailabilityWithServiceResponseAsync(parameters).toBlocking().single().body(); + } + + /** + * Checks the availability of the given service namespace across all Windows Azure subscriptions. This is useful because the domain name is created based on the service namespace name. + * + * @param parameters The namespace name. + * @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 checkAvailabilityAsync(CheckAvailabilityParameters parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(checkAvailabilityWithServiceResponseAsync(parameters), serviceCallback); + } + + /** + * Checks the availability of the given service namespace across all Windows Azure subscriptions. This is useful because the domain name is created based on the service namespace name. + * + * @param parameters The namespace name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the CheckAvailabilityResourceInner object + */ + public Observable checkAvailabilityAsync(CheckAvailabilityParameters parameters) { + return checkAvailabilityWithServiceResponseAsync(parameters).map(new Func1, CheckAvailabilityResourceInner>() { + @Override + public CheckAvailabilityResourceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Checks the availability of the given service namespace across all Windows Azure subscriptions. This is useful because the domain name is created based on the service namespace name. + * + * @param parameters The namespace name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the CheckAvailabilityResourceInner object + */ + public Observable> checkAvailabilityWithServiceResponseAsync(CheckAvailabilityParameters parameters) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters 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(parameters); + return service.checkAvailability(this.client.subscriptionId(), parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = checkAvailabilityDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse checkAvailabilityDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Creates/Updates a service namespace. Once created, this namespace's resource manifest is immutable. This operation is idempotent. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param parameters Parameters supplied to create a Namespace Resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the NamespaceResourceInner object if successful. + */ + public NamespaceResourceInner createOrUpdate(String resourceGroupName, String namespaceName, NamespaceCreateOrUpdateParameters parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, namespaceName, parameters).toBlocking().single().body(); + } + + /** + * Creates/Updates a service namespace. Once created, this namespace's resource manifest is immutable. This operation is idempotent. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param parameters Parameters supplied to create a Namespace Resource. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String resourceGroupName, String namespaceName, NamespaceCreateOrUpdateParameters parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, namespaceName, parameters), serviceCallback); + } + + /** + * Creates/Updates a service namespace. Once created, this namespace's resource manifest is immutable. This operation is idempotent. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param parameters Parameters supplied to create a Namespace Resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the NamespaceResourceInner object + */ + public Observable createOrUpdateAsync(String resourceGroupName, String namespaceName, NamespaceCreateOrUpdateParameters parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, namespaceName, parameters).map(new Func1, NamespaceResourceInner>() { + @Override + public NamespaceResourceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates/Updates a service namespace. Once created, this namespace's resource manifest is immutable. This operation is idempotent. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param parameters Parameters supplied to create a Namespace Resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the NamespaceResourceInner object + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String namespaceName, NamespaceCreateOrUpdateParameters parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (namespaceName == null) { + throw new IllegalArgumentException("Parameter namespaceName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters 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(parameters); + return service.createOrUpdate(resourceGroupName, namespaceName, this.client.subscriptionId(), parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = createOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse createOrUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Deletes an existing namespace. This operation also removes all associated notificationHubs under the namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException 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 namespaceName) { + deleteWithServiceResponseAsync(resourceGroupName, namespaceName).toBlocking().last().body(); + } + + /** + * Deletes an existing namespace. This operation also removes all associated notificationHubs under the namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @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 namespaceName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, namespaceName), serviceCallback); + } + + /** + * Deletes an existing namespace. This operation also removes all associated notificationHubs under the namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String namespaceName) { + return deleteWithServiceResponseAsync(resourceGroupName, namespaceName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes an existing namespace. This operation also removes all associated notificationHubs under the namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String namespaceName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (namespaceName == null) { + throw new IllegalArgumentException("Parameter namespaceName is required and cannot be null."); + } + 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."); + } + Observable> observable = service.delete(resourceGroupName, namespaceName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Deletes an existing namespace. This operation also removes all associated notificationHubs under the namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException 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 namespaceName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, namespaceName).toBlocking().single().body(); + } + + /** + * Deletes an existing namespace. This operation also removes all associated notificationHubs under the namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @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 namespaceName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, namespaceName), serviceCallback); + } + + /** + * Deletes an existing namespace. This operation also removes all associated notificationHubs under the namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String namespaceName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, namespaceName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes an existing namespace. This operation also removes all associated notificationHubs under the namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String namespaceName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (namespaceName == null) { + throw new IllegalArgumentException("Parameter namespaceName is required and cannot be null."); + } + 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.beginDelete(resourceGroupName, namespaceName, this.client.subscriptionId(), 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 CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Returns the description for the specified namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the NamespaceResourceInner object if successful. + */ + public NamespaceResourceInner getByResourceGroup(String resourceGroupName, String namespaceName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, namespaceName).toBlocking().single().body(); + } + + /** + * Returns the description for the specified namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @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 namespaceName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getByResourceGroupWithServiceResponseAsync(resourceGroupName, namespaceName), serviceCallback); + } + + /** + * Returns the description for the specified namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the NamespaceResourceInner object + */ + public Observable getByResourceGroupAsync(String resourceGroupName, String namespaceName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, namespaceName).map(new Func1, NamespaceResourceInner>() { + @Override + public NamespaceResourceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Returns the description for the specified namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the NamespaceResourceInner object + */ + public Observable> getByResourceGroupWithServiceResponseAsync(String resourceGroupName, String namespaceName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (namespaceName == null) { + throw new IllegalArgumentException("Parameter namespaceName is required and cannot be null."); + } + 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.getByResourceGroup(resourceGroupName, namespaceName, this.client.subscriptionId(), 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 CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Creates an authorization rule for a namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param authorizationRuleName Aauthorization Rule Name. + * @param parameters The shared access authorization rule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the SharedAccessAuthorizationRuleResourceInner object if successful. + */ + public SharedAccessAuthorizationRuleResourceInner createOrUpdateAuthorizationRule(String resourceGroupName, String namespaceName, String authorizationRuleName, SharedAccessAuthorizationRuleCreateOrUpdateParameters parameters) { + return createOrUpdateAuthorizationRuleWithServiceResponseAsync(resourceGroupName, namespaceName, authorizationRuleName, parameters).toBlocking().single().body(); + } + + /** + * Creates an authorization rule for a namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param authorizationRuleName Aauthorization Rule Name. + * @param parameters The shared access authorization rule. + * @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 createOrUpdateAuthorizationRuleAsync(String resourceGroupName, String namespaceName, String authorizationRuleName, SharedAccessAuthorizationRuleCreateOrUpdateParameters parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateAuthorizationRuleWithServiceResponseAsync(resourceGroupName, namespaceName, authorizationRuleName, parameters), serviceCallback); + } + + /** + * Creates an authorization rule for a namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param authorizationRuleName Aauthorization Rule Name. + * @param parameters The shared access authorization rule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SharedAccessAuthorizationRuleResourceInner object + */ + public Observable createOrUpdateAuthorizationRuleAsync(String resourceGroupName, String namespaceName, String authorizationRuleName, SharedAccessAuthorizationRuleCreateOrUpdateParameters parameters) { + return createOrUpdateAuthorizationRuleWithServiceResponseAsync(resourceGroupName, namespaceName, authorizationRuleName, parameters).map(new Func1, SharedAccessAuthorizationRuleResourceInner>() { + @Override + public SharedAccessAuthorizationRuleResourceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates an authorization rule for a namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param authorizationRuleName Aauthorization Rule Name. + * @param parameters The shared access authorization rule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SharedAccessAuthorizationRuleResourceInner object + */ + public Observable> createOrUpdateAuthorizationRuleWithServiceResponseAsync(String resourceGroupName, String namespaceName, String authorizationRuleName, SharedAccessAuthorizationRuleCreateOrUpdateParameters parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (namespaceName == null) { + throw new IllegalArgumentException("Parameter namespaceName is required and cannot be null."); + } + if (authorizationRuleName == null) { + throw new IllegalArgumentException("Parameter authorizationRuleName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters 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(parameters); + return service.createOrUpdateAuthorizationRule(resourceGroupName, namespaceName, authorizationRuleName, this.client.subscriptionId(), parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = createOrUpdateAuthorizationRuleDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse createOrUpdateAuthorizationRuleDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Deletes a namespace authorization rule. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param authorizationRuleName Authorization Rule Name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void deleteAuthorizationRule(String resourceGroupName, String namespaceName, String authorizationRuleName) { + deleteAuthorizationRuleWithServiceResponseAsync(resourceGroupName, namespaceName, authorizationRuleName).toBlocking().single().body(); + } + + /** + * Deletes a namespace authorization rule. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param authorizationRuleName Authorization Rule Name. + * @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 deleteAuthorizationRuleAsync(String resourceGroupName, String namespaceName, String authorizationRuleName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteAuthorizationRuleWithServiceResponseAsync(resourceGroupName, namespaceName, authorizationRuleName), serviceCallback); + } + + /** + * Deletes a namespace authorization rule. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param authorizationRuleName Authorization Rule Name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable deleteAuthorizationRuleAsync(String resourceGroupName, String namespaceName, String authorizationRuleName) { + return deleteAuthorizationRuleWithServiceResponseAsync(resourceGroupName, namespaceName, authorizationRuleName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes a namespace authorization rule. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param authorizationRuleName Authorization Rule Name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> deleteAuthorizationRuleWithServiceResponseAsync(String resourceGroupName, String namespaceName, String authorizationRuleName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (namespaceName == null) { + throw new IllegalArgumentException("Parameter namespaceName is required and cannot be null."); + } + if (authorizationRuleName == null) { + throw new IllegalArgumentException("Parameter authorizationRuleName is required and cannot be null."); + } + 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.deleteAuthorizationRule(resourceGroupName, namespaceName, authorizationRuleName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = deleteAuthorizationRuleDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse deleteAuthorizationRuleDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets an authorization rule for a namespace by name. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name + * @param authorizationRuleName Authorization rule name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the SharedAccessAuthorizationRuleResourceInner object if successful. + */ + public SharedAccessAuthorizationRuleResourceInner getAuthorizationRule(String resourceGroupName, String namespaceName, String authorizationRuleName) { + return getAuthorizationRuleWithServiceResponseAsync(resourceGroupName, namespaceName, authorizationRuleName).toBlocking().single().body(); + } + + /** + * Gets an authorization rule for a namespace by name. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name + * @param authorizationRuleName Authorization rule name. + * @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 getAuthorizationRuleAsync(String resourceGroupName, String namespaceName, String authorizationRuleName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getAuthorizationRuleWithServiceResponseAsync(resourceGroupName, namespaceName, authorizationRuleName), serviceCallback); + } + + /** + * Gets an authorization rule for a namespace by name. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name + * @param authorizationRuleName Authorization rule name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SharedAccessAuthorizationRuleResourceInner object + */ + public Observable getAuthorizationRuleAsync(String resourceGroupName, String namespaceName, String authorizationRuleName) { + return getAuthorizationRuleWithServiceResponseAsync(resourceGroupName, namespaceName, authorizationRuleName).map(new Func1, SharedAccessAuthorizationRuleResourceInner>() { + @Override + public SharedAccessAuthorizationRuleResourceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets an authorization rule for a namespace by name. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name + * @param authorizationRuleName Authorization rule name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SharedAccessAuthorizationRuleResourceInner object + */ + public Observable> getAuthorizationRuleWithServiceResponseAsync(String resourceGroupName, String namespaceName, String authorizationRuleName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (namespaceName == null) { + throw new IllegalArgumentException("Parameter namespaceName is required and cannot be null."); + } + if (authorizationRuleName == null) { + throw new IllegalArgumentException("Parameter authorizationRuleName is required and cannot be null."); + } + 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.getAuthorizationRule(resourceGroupName, namespaceName, authorizationRuleName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getAuthorizationRuleDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getAuthorizationRuleDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * The Get Operation Status operation returns the status of the specified operation. After calling an asynchronous operation, you can call Get Operation Status to determine whether the operation has succeeded, failed, or is still in progress. + * + * @param operationStatusLink Location value returned by the Begin operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void getLongRunningOperationStatus(String operationStatusLink) { + getLongRunningOperationStatusWithServiceResponseAsync(operationStatusLink).toBlocking().single().body(); + } + + /** + * The Get Operation Status operation returns the status of the specified operation. After calling an asynchronous operation, you can call Get Operation Status to determine whether the operation has succeeded, failed, or is still in progress. + * + * @param operationStatusLink Location value returned by the Begin operation. + * @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 getLongRunningOperationStatusAsync(String operationStatusLink, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getLongRunningOperationStatusWithServiceResponseAsync(operationStatusLink), serviceCallback); + } + + /** + * The Get Operation Status operation returns the status of the specified operation. After calling an asynchronous operation, you can call Get Operation Status to determine whether the operation has succeeded, failed, or is still in progress. + * + * @param operationStatusLink Location value returned by the Begin operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable getLongRunningOperationStatusAsync(String operationStatusLink) { + return getLongRunningOperationStatusWithServiceResponseAsync(operationStatusLink).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * The Get Operation Status operation returns the status of the specified operation. After calling an asynchronous operation, you can call Get Operation Status to determine whether the operation has succeeded, failed, or is still in progress. + * + * @param operationStatusLink Location value returned by the Begin operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> getLongRunningOperationStatusWithServiceResponseAsync(String operationStatusLink) { + if (operationStatusLink == null) { + throw new IllegalArgumentException("Parameter operationStatusLink is required and cannot be null."); + } + return service.getLongRunningOperationStatus(operationStatusLink, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getLongRunningOperationStatusDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getLongRunningOperationStatusDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .register(404, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Lists the available namespaces within a resourceGroup. + * + * @param resourceGroupName The name of the resource group. If resourceGroupName value is null the method lists all the namespaces within subscription + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException 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<NamespaceResourceInner> 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(); + } + }; + } + + /** + * Lists the available namespaces within a resourceGroup. + * + * @param resourceGroupName The name of the resource group. If resourceGroupName value is null the method lists all the namespaces within 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> listByResourceGroupAsync(final String resourceGroupName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupSinglePageAsync(resourceGroupName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists the available namespaces within a resourceGroup. + * + * @param resourceGroupName The name of the resource group. If resourceGroupName value is null the method lists all the namespaces within subscription + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<NamespaceResourceInner> object + */ + public Observable> listByResourceGroupAsync(final String resourceGroupName) { + return listByResourceGroupWithServiceResponseAsync(resourceGroupName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists the available namespaces within a resourceGroup. + * + * @param resourceGroupName The name of the resource group. If resourceGroupName value is null the method lists all the namespaces within subscription + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<NamespaceResourceInner> 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)); + } + }); + } + + /** + * Lists the available namespaces within a resourceGroup. + * + ServiceResponse> * @param resourceGroupName The name of the resource group. If resourceGroupName value is null the method lists all the namespaces within subscription + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<NamespaceResourceInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupSinglePageAsync(final String resourceGroupName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + 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.listByResourceGroup(resourceGroupName, 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 = listByResourceGroupDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Lists all the available namespaces within the subscription irrespective of the resourceGroups. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException 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<NamespaceResourceInner> 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 the available namespaces within the subscription irrespective of the resourceGroups. + * + * @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 the available namespaces within the subscription irrespective of the resourceGroups. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<NamespaceResourceInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all the available namespaces within the subscription irrespective of the resourceGroups. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<NamespaceResourceInner> 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 the available namespaces within the subscription irrespective of the resourceGroups. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<NamespaceResourceInner> 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 CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets the authorization rules for a namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException 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<SharedAccessAuthorizationRuleResourceInner> object if successful. + */ + public PagedList listAuthorizationRules(final String resourceGroupName, final String namespaceName) { + ServiceResponse> response = listAuthorizationRulesSinglePageAsync(resourceGroupName, namespaceName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listAuthorizationRulesNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets the authorization rules for a namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name + * @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> listAuthorizationRulesAsync(final String resourceGroupName, final String namespaceName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listAuthorizationRulesSinglePageAsync(resourceGroupName, namespaceName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listAuthorizationRulesNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets the authorization rules for a namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<SharedAccessAuthorizationRuleResourceInner> object + */ + public Observable> listAuthorizationRulesAsync(final String resourceGroupName, final String namespaceName) { + return listAuthorizationRulesWithServiceResponseAsync(resourceGroupName, namespaceName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets the authorization rules for a namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<SharedAccessAuthorizationRuleResourceInner> object + */ + public Observable>> listAuthorizationRulesWithServiceResponseAsync(final String resourceGroupName, final String namespaceName) { + return listAuthorizationRulesSinglePageAsync(resourceGroupName, namespaceName) + .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(listAuthorizationRulesNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets the authorization rules for a namespace. + * + ServiceResponse> * @param resourceGroupName The name of the resource group. + ServiceResponse> * @param namespaceName The namespace name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<SharedAccessAuthorizationRuleResourceInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listAuthorizationRulesSinglePageAsync(final String resourceGroupName, final String namespaceName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (namespaceName == null) { + throw new IllegalArgumentException("Parameter namespaceName is required and cannot be null."); + } + 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.listAuthorizationRules(resourceGroupName, namespaceName, 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 = listAuthorizationRulesDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listAuthorizationRulesDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets the Primary and Secondary ConnectionStrings to the namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param authorizationRuleName The connection string of the namespace for the specified authorizationRule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ResourceListKeysInner object if successful. + */ + public ResourceListKeysInner listKeys(String resourceGroupName, String namespaceName, String authorizationRuleName) { + return listKeysWithServiceResponseAsync(resourceGroupName, namespaceName, authorizationRuleName).toBlocking().single().body(); + } + + /** + * Gets the Primary and Secondary ConnectionStrings to the namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param authorizationRuleName The connection string of the namespace for the specified authorizationRule. + * @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 listKeysAsync(String resourceGroupName, String namespaceName, String authorizationRuleName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(listKeysWithServiceResponseAsync(resourceGroupName, namespaceName, authorizationRuleName), serviceCallback); + } + + /** + * Gets the Primary and Secondary ConnectionStrings to the namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param authorizationRuleName The connection string of the namespace for the specified authorizationRule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ResourceListKeysInner object + */ + public Observable listKeysAsync(String resourceGroupName, String namespaceName, String authorizationRuleName) { + return listKeysWithServiceResponseAsync(resourceGroupName, namespaceName, authorizationRuleName).map(new Func1, ResourceListKeysInner>() { + @Override + public ResourceListKeysInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the Primary and Secondary ConnectionStrings to the namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param authorizationRuleName The connection string of the namespace for the specified authorizationRule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ResourceListKeysInner object + */ + public Observable> listKeysWithServiceResponseAsync(String resourceGroupName, String namespaceName, String authorizationRuleName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (namespaceName == null) { + throw new IllegalArgumentException("Parameter namespaceName is required and cannot be null."); + } + if (authorizationRuleName == null) { + throw new IllegalArgumentException("Parameter authorizationRuleName is required and cannot be null."); + } + 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.listKeys(resourceGroupName, namespaceName, authorizationRuleName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = listKeysDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse listKeysDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Lists the available namespaces within a resourceGroup. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException 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<NamespaceResourceInner> 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(); + } + }; + } + + /** + * Lists the available namespaces within a resourceGroup. + * + * @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); + } + + /** + * Lists the available namespaces within a resourceGroup. + * + * @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<NamespaceResourceInner> object + */ + public Observable> listByResourceGroupNextAsync(final String nextPageLink) { + return listByResourceGroupNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists the available namespaces within a resourceGroup. + * + * @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<NamespaceResourceInner> 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)); + } + }); + } + + /** + * Lists the available namespaces within a resourceGroup. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<NamespaceResourceInner> 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 CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Lists all the available namespaces within the subscription irrespective of the resourceGroups. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException 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<NamespaceResourceInner> 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 the available namespaces within the subscription irrespective of the resourceGroups. + * + * @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 the available namespaces within the subscription irrespective of the resourceGroups. + * + * @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<NamespaceResourceInner> 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 the available namespaces within the subscription irrespective of the resourceGroups. + * + * @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<NamespaceResourceInner> 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 the available namespaces within the subscription irrespective of the resourceGroups. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<NamespaceResourceInner> 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 CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets the authorization rules for a namespace. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException 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<SharedAccessAuthorizationRuleResourceInner> object if successful. + */ + public PagedList listAuthorizationRulesNext(final String nextPageLink) { + ServiceResponse> response = listAuthorizationRulesNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listAuthorizationRulesNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets the authorization rules for a namespace. + * + * @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> listAuthorizationRulesNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listAuthorizationRulesNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listAuthorizationRulesNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets the authorization rules for a namespace. + * + * @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<SharedAccessAuthorizationRuleResourceInner> object + */ + public Observable> listAuthorizationRulesNextAsync(final String nextPageLink) { + return listAuthorizationRulesNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets the authorization rules for a namespace. + * + * @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<SharedAccessAuthorizationRuleResourceInner> object + */ + public Observable>> listAuthorizationRulesNextWithServiceResponseAsync(final String nextPageLink) { + return listAuthorizationRulesNextSinglePageAsync(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(listAuthorizationRulesNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets the authorization rules for a namespace. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<SharedAccessAuthorizationRuleResourceInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listAuthorizationRulesNextSinglePageAsync(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.listAuthorizationRulesNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listAuthorizationRulesNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listAuthorizationRulesNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/notificationhubs/resource-manager/v2014_09_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2014_09_01/implementation/NotificationHubNamespaceSharedAccessAuthorizationRuleResourceImpl.java b/notificationhubs/resource-manager/v2014_09_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2014_09_01/implementation/NotificationHubNamespaceSharedAccessAuthorizationRuleResourceImpl.java new file mode 100644 index 000000000000..9a04a081ba1d --- /dev/null +++ b/notificationhubs/resource-manager/v2014_09_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2014_09_01/implementation/NotificationHubNamespaceSharedAccessAuthorizationRuleResourceImpl.java @@ -0,0 +1,154 @@ +/** + * 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.notificationhubs.v2014_09_01.implementation; + +import com.microsoft.azure.management.notificationhubs.v2014_09_01.NotificationHubNamespaceSharedAccessAuthorizationRuleResource; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import com.microsoft.azure.management.notificationhubs.v2014_09_01.SharedAccessAuthorizationRuleCreateOrUpdateParameters; +import com.microsoft.azure.management.notificationhubs.v2014_09_01.SharedAccessAuthorizationRuleProperties; +import java.util.Map; +import rx.functions.Func1; + +class NotificationHubNamespaceSharedAccessAuthorizationRuleResourceImpl extends CreatableUpdatableImpl implements NotificationHubNamespaceSharedAccessAuthorizationRuleResource, NotificationHubNamespaceSharedAccessAuthorizationRuleResource.Definition, NotificationHubNamespaceSharedAccessAuthorizationRuleResource.Update { + private final NotificationHubsManager manager; + private String resourceGroupName; + private String namespaceName; + private String notificationHubName; + private String authorizationRuleName; + private SharedAccessAuthorizationRuleCreateOrUpdateParameters createOrUpdateParameter; + + NotificationHubNamespaceSharedAccessAuthorizationRuleResourceImpl(String name, NotificationHubsManager manager) { + super(name, new SharedAccessAuthorizationRuleResourceInner()); + this.manager = manager; + // Set resource name + this.authorizationRuleName = name; + // + this.createOrUpdateParameter = new SharedAccessAuthorizationRuleCreateOrUpdateParameters(); + } + + NotificationHubNamespaceSharedAccessAuthorizationRuleResourceImpl(SharedAccessAuthorizationRuleResourceInner inner, NotificationHubsManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.authorizationRuleName = inner.name(); + // resource ancestor names + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.namespaceName = IdParsingUtils.getValueFromIdByName(inner.id(), "namespaces"); + this.notificationHubName = IdParsingUtils.getValueFromIdByName(inner.id(), "notificationHubs"); + this.authorizationRuleName = IdParsingUtils.getValueFromIdByName(inner.id(), "AuthorizationRules"); + // + this.createOrUpdateParameter = new SharedAccessAuthorizationRuleCreateOrUpdateParameters(); + } + + @Override + public NotificationHubsManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + NotificationHubsInner client = this.manager().inner().notificationHubs(); + return client.createOrUpdateAuthorizationRuleAsync(this.resourceGroupName, this.namespaceName, this.notificationHubName, this.authorizationRuleName, this.createOrUpdateParameter) + .map(new Func1() { + @Override + public SharedAccessAuthorizationRuleResourceInner call(SharedAccessAuthorizationRuleResourceInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + NotificationHubsInner client = this.manager().inner().notificationHubs(); + return client.createOrUpdateAuthorizationRuleAsync(this.resourceGroupName, this.namespaceName, this.notificationHubName, this.authorizationRuleName, this.createOrUpdateParameter) + .map(new Func1() { + @Override + public SharedAccessAuthorizationRuleResourceInner call(SharedAccessAuthorizationRuleResourceInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + NotificationHubsInner client = this.manager().inner().notificationHubs(); + return null; // NOP getInnerAsync implementation as get is not supported + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + private void resetCreateUpdateParameters() { + this.createOrUpdateParameter = new SharedAccessAuthorizationRuleCreateOrUpdateParameters(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String location() { + return this.inner().location(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public SharedAccessAuthorizationRuleProperties properties() { + return this.inner().properties(); + } + + @Override + public Map tags() { + return this.inner().tags(); + } + + @Override + public String type() { + return this.inner().type(); + } + + @Override + public NotificationHubNamespaceSharedAccessAuthorizationRuleResourceImpl withExistingNotificationHub(String resourceGroupName, String namespaceName, String notificationHubName) { + this.resourceGroupName = resourceGroupName; + this.namespaceName = namespaceName; + this.notificationHubName = notificationHubName; + return this; + } + + @Override + public NotificationHubNamespaceSharedAccessAuthorizationRuleResourceImpl withProperties(SharedAccessAuthorizationRuleProperties properties) { + this.createOrUpdateParameter.withProperties(properties); + return this; + } + + @Override + public NotificationHubNamespaceSharedAccessAuthorizationRuleResourceImpl withLocation(String location) { + this.createOrUpdateParameter.withLocation(location); + return this; + } + + @Override + public NotificationHubNamespaceSharedAccessAuthorizationRuleResourceImpl withName(String name) { + this.createOrUpdateParameter.withName(name); + return this; + } + +} diff --git a/notificationhubs/resource-manager/v2014_09_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2014_09_01/implementation/NotificationHubResourceImpl.java b/notificationhubs/resource-manager/v2014_09_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2014_09_01/implementation/NotificationHubResourceImpl.java new file mode 100644 index 000000000000..0dc84a8af10b --- /dev/null +++ b/notificationhubs/resource-manager/v2014_09_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2014_09_01/implementation/NotificationHubResourceImpl.java @@ -0,0 +1,151 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.notificationhubs.v2014_09_01.implementation; + +import com.microsoft.azure.management.notificationhubs.v2014_09_01.NotificationHubResource; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import com.microsoft.azure.management.notificationhubs.v2014_09_01.NotificationHubCreateOrUpdateParameters; +import java.util.Map; +import com.microsoft.azure.management.notificationhubs.v2014_09_01.NotificationHubProperties; +import rx.functions.Func1; + +class NotificationHubResourceImpl extends CreatableUpdatableImpl implements NotificationHubResource, NotificationHubResource.Definition, NotificationHubResource.Update { + private final NotificationHubsManager manager; + private String resourceGroupName; + private String namespaceName; + private String notificationHubName; + private NotificationHubCreateOrUpdateParameters createOrUpdateParameter; + + NotificationHubResourceImpl(String name, NotificationHubsManager manager) { + super(name, new NotificationHubResourceInner()); + this.manager = manager; + // Set resource name + this.notificationHubName = name; + // + this.createOrUpdateParameter = new NotificationHubCreateOrUpdateParameters(); + } + + NotificationHubResourceImpl(NotificationHubResourceInner inner, NotificationHubsManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.notificationHubName = inner.name(); + // resource ancestor names + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.namespaceName = IdParsingUtils.getValueFromIdByName(inner.id(), "namespaces"); + this.notificationHubName = IdParsingUtils.getValueFromIdByName(inner.id(), "notificationHubs"); + // + this.createOrUpdateParameter = new NotificationHubCreateOrUpdateParameters(); + } + + @Override + public NotificationHubsManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + NotificationHubsInner client = this.manager().inner().notificationHubs(); + return client.createOrUpdateAsync(this.resourceGroupName, this.namespaceName, this.notificationHubName, this.createOrUpdateParameter) + .map(new Func1() { + @Override + public NotificationHubResourceInner call(NotificationHubResourceInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + NotificationHubsInner client = this.manager().inner().notificationHubs(); + return client.createOrUpdateAsync(this.resourceGroupName, this.namespaceName, this.notificationHubName, this.createOrUpdateParameter) + .map(new Func1() { + @Override + public NotificationHubResourceInner call(NotificationHubResourceInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + NotificationHubsInner client = this.manager().inner().notificationHubs(); + return client.getAsync(this.resourceGroupName, this.namespaceName, this.notificationHubName); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + private void resetCreateUpdateParameters() { + this.createOrUpdateParameter = new NotificationHubCreateOrUpdateParameters(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String location() { + return this.inner().location(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public NotificationHubProperties properties() { + return this.inner().properties(); + } + + @Override + public Map tags() { + return this.inner().tags(); + } + + @Override + public String type() { + return this.inner().type(); + } + + @Override + public NotificationHubResourceImpl withExistingNamespace(String resourceGroupName, String namespaceName) { + this.resourceGroupName = resourceGroupName; + this.namespaceName = namespaceName; + return this; + } + + @Override + public NotificationHubResourceImpl withLocation(String location) { + this.createOrUpdateParameter.withLocation(location); + return this; + } + + @Override + public NotificationHubResourceImpl withProperties(NotificationHubProperties properties) { + this.createOrUpdateParameter.withProperties(properties); + return this; + } + + @Override + public NotificationHubResourceImpl withTags(Map tags) { + this.createOrUpdateParameter.withTags(tags); + return this; + } + +} diff --git a/notificationhubs/resource-manager/v2014_09_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2014_09_01/implementation/NotificationHubResourceInner.java b/notificationhubs/resource-manager/v2014_09_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2014_09_01/implementation/NotificationHubResourceInner.java new file mode 100644 index 000000000000..fc246a763944 --- /dev/null +++ b/notificationhubs/resource-manager/v2014_09_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2014_09_01/implementation/NotificationHubResourceInner.java @@ -0,0 +1,175 @@ +/** + * 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.notificationhubs.v2014_09_01.implementation; + +import java.util.Map; +import com.microsoft.azure.management.notificationhubs.v2014_09_01.NotificationHubProperties; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Description of a NotificationHub Resource. + */ +public class NotificationHubResourceInner { + /** + * Gets or sets the id of the created NotificationHub. + */ + @JsonProperty(value = "id") + private String id; + + /** + * Gets or sets datacenter location of the NotificationHub. + */ + @JsonProperty(value = "location") + private String location; + + /** + * Gets or sets name of the NotificationHub. + */ + @JsonProperty(value = "name") + private String name; + + /** + * Gets or sets resource type of the NotificationHub. + */ + @JsonProperty(value = "type") + private String type; + + /** + * Gets or sets tags of the NotificationHub. + */ + @JsonProperty(value = "tags") + private Map tags; + + /** + * Gets or sets properties of the NotificationHub. + */ + @JsonProperty(value = "properties") + private NotificationHubProperties properties; + + /** + * Get gets or sets the id of the created NotificationHub. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set gets or sets the id of the created NotificationHub. + * + * @param id the id value to set + * @return the NotificationHubResourceInner object itself. + */ + public NotificationHubResourceInner withId(String id) { + this.id = id; + return this; + } + + /** + * Get gets or sets datacenter location of the NotificationHub. + * + * @return the location value + */ + public String location() { + return this.location; + } + + /** + * Set gets or sets datacenter location of the NotificationHub. + * + * @param location the location value to set + * @return the NotificationHubResourceInner object itself. + */ + public NotificationHubResourceInner withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get gets or sets name of the NotificationHub. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set gets or sets name of the NotificationHub. + * + * @param name the name value to set + * @return the NotificationHubResourceInner object itself. + */ + public NotificationHubResourceInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get gets or sets resource type of the NotificationHub. + * + * @return the type value + */ + public String type() { + return this.type; + } + + /** + * Set gets or sets resource type of the NotificationHub. + * + * @param type the type value to set + * @return the NotificationHubResourceInner object itself. + */ + public NotificationHubResourceInner withType(String type) { + this.type = type; + return this; + } + + /** + * Get gets or sets tags of the NotificationHub. + * + * @return the tags value + */ + public Map tags() { + return this.tags; + } + + /** + * Set gets or sets tags of the NotificationHub. + * + * @param tags the tags value to set + * @return the NotificationHubResourceInner object itself. + */ + public NotificationHubResourceInner withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Get gets or sets properties of the NotificationHub. + * + * @return the properties value + */ + public NotificationHubProperties properties() { + return this.properties; + } + + /** + * Set gets or sets properties of the NotificationHub. + * + * @param properties the properties value to set + * @return the NotificationHubResourceInner object itself. + */ + public NotificationHubResourceInner withProperties(NotificationHubProperties properties) { + this.properties = properties; + return this; + } + +} diff --git a/notificationhubs/resource-manager/v2014_09_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2014_09_01/implementation/NotificationHubsImpl.java b/notificationhubs/resource-manager/v2014_09_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2014_09_01/implementation/NotificationHubsImpl.java new file mode 100644 index 000000000000..dfb5d7bda764 --- /dev/null +++ b/notificationhubs/resource-manager/v2014_09_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2014_09_01/implementation/NotificationHubsImpl.java @@ -0,0 +1,170 @@ +/** + * 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.notificationhubs.v2014_09_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.notificationhubs.v2014_09_01.NotificationHubs; +import rx.Completable; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.notificationhubs.v2014_09_01.NamespaceSharedAccessAuthorizationRuleResource; +import com.microsoft.azure.management.notificationhubs.v2014_09_01.NotificationHubResource; +import com.microsoft.azure.management.notificationhubs.v2014_09_01.CheckAvailabilityResource; +import com.microsoft.azure.management.notificationhubs.v2014_09_01.CheckAvailabilityParameters; +import com.microsoft.azure.management.notificationhubs.v2014_09_01.ResourceListKeys; + +class NotificationHubsImpl extends WrapperImpl implements NotificationHubs { + private final NotificationHubsManager manager; + + NotificationHubsImpl(NotificationHubsManager manager) { + super(manager.inner().notificationHubs()); + this.manager = manager; + } + + public NotificationHubsManager manager() { + return this.manager; + } + + @Override + public NotificationHubResourceImpl define(String name) { + return wrapModel(name); + } + + private NotificationHubResourceImpl wrapModel(NotificationHubResourceInner inner) { + return new NotificationHubResourceImpl(inner, manager()); + } + + private NotificationHubResourceImpl wrapModel(String name) { + return new NotificationHubResourceImpl(name, this.manager()); + } + + @Override + public Observable listAuthorizationRulesAsync(final String resourceGroupName, final String namespaceName, final String notificationHubName) { + NotificationHubsInner client = this.inner(); + return client.listAuthorizationRulesAsync(resourceGroupName, namespaceName, notificationHubName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public NamespaceSharedAccessAuthorizationRuleResource call(SharedAccessAuthorizationRuleResourceInner inner) { + return new NamespaceSharedAccessAuthorizationRuleResourceImpl(inner, manager()); + } + }); + } + + @Override + public Observable getPnsCredentialsAsync(String resourceGroupName, String namespaceName, String notificationHubName) { + NotificationHubsInner client = this.inner(); + return client.getPnsCredentialsAsync(resourceGroupName, namespaceName, notificationHubName) + .map(new Func1() { + @Override + public NotificationHubResource call(NotificationHubResourceInner inner) { + return new NotificationHubResourceImpl(inner, manager()); + } + }); + } + + @Override + public Observable listAsync(final String resourceGroupName, final String namespaceName) { + NotificationHubsInner client = this.inner(); + return client.listAsync(resourceGroupName, namespaceName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public NotificationHubResource call(NotificationHubResourceInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Observable getAsync(String resourceGroupName, String namespaceName, String notificationHubName) { + NotificationHubsInner client = this.inner(); + return client.getAsync(resourceGroupName, namespaceName, notificationHubName) + .map(new Func1() { + @Override + public NotificationHubResource call(NotificationHubResourceInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Completable deleteAsync(String resourceGroupName, String namespaceName, String notificationHubName) { + NotificationHubsInner client = this.inner(); + return client.deleteAsync(resourceGroupName, namespaceName, notificationHubName).toCompletable(); + } + + @Override + public NotificationHubNamespaceSharedAccessAuthorizationRuleResourceImpl defineAuthorizationRule(String name) { + return wrapAuthorizationRuleModel(name); + } + + private NotificationHubNamespaceSharedAccessAuthorizationRuleResourceImpl wrapAuthorizationRuleModel(String name) { + return new NotificationHubNamespaceSharedAccessAuthorizationRuleResourceImpl(name, this.manager()); + } + + private NotificationHubNamespaceSharedAccessAuthorizationRuleResourceImpl wrapNotificationHubNamespaceSharedAccessAuthorizationRuleResourceModel(SharedAccessAuthorizationRuleResourceInner inner) { + return new NotificationHubNamespaceSharedAccessAuthorizationRuleResourceImpl(inner, manager()); + } + + @Override + public Observable checkAvailabilityAsync(String resourceGroupName, String namespaceName, CheckAvailabilityParameters parameters) { + NotificationHubsInner client = this.inner(); + return client.checkAvailabilityAsync(resourceGroupName, namespaceName, parameters) + .map(new Func1() { + @Override + public CheckAvailabilityResource call(CheckAvailabilityResourceInner inner) { + return new CheckAvailabilityResourceImpl(inner, manager()); + } + }); + } + + @Override + public Completable deleteAuthorizationRuleAsync(String resourceGroupName, String namespaceName, String notificationHubName, String authorizationRuleName) { + NotificationHubsInner client = this.inner(); + return client.deleteAuthorizationRuleAsync(resourceGroupName, namespaceName, notificationHubName, authorizationRuleName).toCompletable(); + } + + @Override + public Observable getAuthorizationRuleAsync(String resourceGroupName, String namespaceName, String notificationHubName, String authorizationRuleName) { + NotificationHubsInner client = this.inner(); + return client.getAuthorizationRuleAsync(resourceGroupName, namespaceName, notificationHubName, authorizationRuleName) + .map(new Func1() { + @Override + public NamespaceSharedAccessAuthorizationRuleResource call(SharedAccessAuthorizationRuleResourceInner inner) { + return new NamespaceSharedAccessAuthorizationRuleResourceImpl(inner, manager()); + } + }); + } + + @Override + public Observable listKeysAsync(String resourceGroupName, String namespaceName, String notificationHubName, String authorizationRuleName) { + NotificationHubsInner client = this.inner(); + return client.listKeysAsync(resourceGroupName, namespaceName, notificationHubName, authorizationRuleName) + .map(new Func1() { + @Override + public ResourceListKeys call(ResourceListKeysInner inner) { + return new ResourceListKeysImpl(inner, manager()); + } + }); + } + +} diff --git a/notificationhubs/resource-manager/v2014_09_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2014_09_01/implementation/NotificationHubsInner.java b/notificationhubs/resource-manager/v2014_09_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2014_09_01/implementation/NotificationHubsInner.java new file mode 100644 index 000000000000..69329930cee0 --- /dev/null +++ b/notificationhubs/resource-manager/v2014_09_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2014_09_01/implementation/NotificationHubsInner.java @@ -0,0 +1,1480 @@ +/** + * 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.notificationhubs.v2014_09_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.notificationhubs.v2014_09_01.CheckAvailabilityParameters; +import com.microsoft.azure.management.notificationhubs.v2014_09_01.NotificationHubCreateOrUpdateParameters; +import com.microsoft.azure.management.notificationhubs.v2014_09_01.SharedAccessAuthorizationRuleCreateOrUpdateParameters; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.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 NotificationHubs. + */ +public class NotificationHubsInner { + /** The Retrofit service to perform REST calls. */ + private NotificationHubsService service; + /** The service client containing this operation class. */ + private NotificationHubsManagementClientImpl client; + + /** + * Initializes an instance of NotificationHubsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public NotificationHubsInner(Retrofit retrofit, NotificationHubsManagementClientImpl client) { + this.service = retrofit.create(NotificationHubsService.class); + this.client = client; + } + + /** + * The interface defining all the services for NotificationHubs to be + * used by Retrofit to perform actually REST calls. + */ + interface NotificationHubsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.notificationhubs.v2014_09_01.NotificationHubs checkAvailability" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/checkNotificationHubAvailability") + Observable> checkAvailability(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @Path("subscriptionId") String subscriptionId, @Body CheckAvailabilityParameters parameters, @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.notificationhubs.v2014_09_01.NotificationHubs createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/notificationHubs/{notificationHubName}") + Observable> createOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @Path("notificationHubName") String notificationHubName, @Path("subscriptionId") String subscriptionId, @Body NotificationHubCreateOrUpdateParameters parameters, @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.notificationhubs.v2014_09_01.NotificationHubs delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/notificationHubs/{notificationHubName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @Path("notificationHubName") String notificationHubName, @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.notificationhubs.v2014_09_01.NotificationHubs get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/notificationHubs/{notificationHubName}") + Observable> get(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @Path("notificationHubName") String notificationHubName, @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.notificationhubs.v2014_09_01.NotificationHubs createOrUpdateAuthorizationRule" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/notificationHubs/{notificationHubName}/AuthorizationRules/{authorizationRuleName}") + Observable> createOrUpdateAuthorizationRule(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @Path("notificationHubName") String notificationHubName, @Path("authorizationRuleName") String authorizationRuleName, @Path("subscriptionId") String subscriptionId, @Body SharedAccessAuthorizationRuleCreateOrUpdateParameters parameters, @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.notificationhubs.v2014_09_01.NotificationHubs deleteAuthorizationRule" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/notificationHubs/{notificationHubName}/AuthorizationRules/{authorizationRuleName}", method = "DELETE", hasBody = true) + Observable> deleteAuthorizationRule(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @Path("notificationHubName") String notificationHubName, @Path("authorizationRuleName") String authorizationRuleName, @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.notificationhubs.v2014_09_01.NotificationHubs getAuthorizationRule" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/notificationHubs/{notificationHubName}/AuthorizationRules/{authorizationRuleName}") + Observable> getAuthorizationRule(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @Path("notificationHubName") String notificationHubName, @Path("authorizationRuleName") String authorizationRuleName, @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.notificationhubs.v2014_09_01.NotificationHubs list" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/notificationHubs") + Observable> list(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @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.notificationhubs.v2014_09_01.NotificationHubs listAuthorizationRules" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/notificationHubs/{notificationHubName}/AuthorizationRules") + Observable> listAuthorizationRules(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @Path("notificationHubName") String notificationHubName, @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.notificationhubs.v2014_09_01.NotificationHubs listKeys" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/notificationHubs/{notificationHubName}/AuthorizationRules/{authorizationRuleName}/listKeys") + Observable> listKeys(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @Path("notificationHubName") String notificationHubName, @Path("authorizationRuleName") String authorizationRuleName, @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.notificationhubs.v2014_09_01.NotificationHubs getPnsCredentials" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/notificationHubs/{notificationHubName}/pnsCredentials") + Observable> getPnsCredentials(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @Path("notificationHubName") String notificationHubName, @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.notificationhubs.v2014_09_01.NotificationHubs 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.notificationhubs.v2014_09_01.NotificationHubs listAuthorizationRulesNext" }) + @GET + Observable> listAuthorizationRulesNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Checks the availability of the given notificationHub in a namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param parameters The notificationHub name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the CheckAvailabilityResourceInner object if successful. + */ + public CheckAvailabilityResourceInner checkAvailability(String resourceGroupName, String namespaceName, CheckAvailabilityParameters parameters) { + return checkAvailabilityWithServiceResponseAsync(resourceGroupName, namespaceName, parameters).toBlocking().single().body(); + } + + /** + * Checks the availability of the given notificationHub in a namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param parameters The notificationHub name. + * @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 checkAvailabilityAsync(String resourceGroupName, String namespaceName, CheckAvailabilityParameters parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(checkAvailabilityWithServiceResponseAsync(resourceGroupName, namespaceName, parameters), serviceCallback); + } + + /** + * Checks the availability of the given notificationHub in a namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param parameters The notificationHub name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the CheckAvailabilityResourceInner object + */ + public Observable checkAvailabilityAsync(String resourceGroupName, String namespaceName, CheckAvailabilityParameters parameters) { + return checkAvailabilityWithServiceResponseAsync(resourceGroupName, namespaceName, parameters).map(new Func1, CheckAvailabilityResourceInner>() { + @Override + public CheckAvailabilityResourceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Checks the availability of the given notificationHub in a namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param parameters The notificationHub name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the CheckAvailabilityResourceInner object + */ + public Observable> checkAvailabilityWithServiceResponseAsync(String resourceGroupName, String namespaceName, CheckAvailabilityParameters parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (namespaceName == null) { + throw new IllegalArgumentException("Parameter namespaceName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters 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(parameters); + return service.checkAvailability(resourceGroupName, namespaceName, this.client.subscriptionId(), parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = checkAvailabilityDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse checkAvailabilityDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Creates/Update a NotificationHub in a namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param notificationHubName The notification hub name. + * @param parameters Parameters supplied to the create/update a NotificationHub Resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the NotificationHubResourceInner object if successful. + */ + public NotificationHubResourceInner createOrUpdate(String resourceGroupName, String namespaceName, String notificationHubName, NotificationHubCreateOrUpdateParameters parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, namespaceName, notificationHubName, parameters).toBlocking().single().body(); + } + + /** + * Creates/Update a NotificationHub in a namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param notificationHubName The notification hub name. + * @param parameters Parameters supplied to the create/update a NotificationHub Resource. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String resourceGroupName, String namespaceName, String notificationHubName, NotificationHubCreateOrUpdateParameters parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, namespaceName, notificationHubName, parameters), serviceCallback); + } + + /** + * Creates/Update a NotificationHub in a namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param notificationHubName The notification hub name. + * @param parameters Parameters supplied to the create/update a NotificationHub Resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the NotificationHubResourceInner object + */ + public Observable createOrUpdateAsync(String resourceGroupName, String namespaceName, String notificationHubName, NotificationHubCreateOrUpdateParameters parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, namespaceName, notificationHubName, parameters).map(new Func1, NotificationHubResourceInner>() { + @Override + public NotificationHubResourceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates/Update a NotificationHub in a namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param notificationHubName The notification hub name. + * @param parameters Parameters supplied to the create/update a NotificationHub Resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the NotificationHubResourceInner object + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String namespaceName, String notificationHubName, NotificationHubCreateOrUpdateParameters parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (namespaceName == null) { + throw new IllegalArgumentException("Parameter namespaceName is required and cannot be null."); + } + if (notificationHubName == null) { + throw new IllegalArgumentException("Parameter notificationHubName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters 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(parameters); + return service.createOrUpdate(resourceGroupName, namespaceName, notificationHubName, this.client.subscriptionId(), parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = createOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse createOrUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Deletes a notification hub associated with a namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param notificationHubName The notification hub name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException 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 namespaceName, String notificationHubName) { + deleteWithServiceResponseAsync(resourceGroupName, namespaceName, notificationHubName).toBlocking().single().body(); + } + + /** + * Deletes a notification hub associated with a namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param notificationHubName The notification hub name. + * @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 namespaceName, String notificationHubName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, namespaceName, notificationHubName), serviceCallback); + } + + /** + * Deletes a notification hub associated with a namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param notificationHubName The notification hub name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable deleteAsync(String resourceGroupName, String namespaceName, String notificationHubName) { + return deleteWithServiceResponseAsync(resourceGroupName, namespaceName, notificationHubName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes a notification hub associated with a namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param notificationHubName The notification hub name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String namespaceName, String notificationHubName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (namespaceName == null) { + throw new IllegalArgumentException("Parameter namespaceName is required and cannot be null."); + } + if (notificationHubName == null) { + throw new IllegalArgumentException("Parameter notificationHubName is required and cannot be null."); + } + 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.delete(resourceGroupName, namespaceName, notificationHubName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = deleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse deleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Lists the notification hubs associated with a namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param notificationHubName The notification hub name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the NotificationHubResourceInner object if successful. + */ + public NotificationHubResourceInner get(String resourceGroupName, String namespaceName, String notificationHubName) { + return getWithServiceResponseAsync(resourceGroupName, namespaceName, notificationHubName).toBlocking().single().body(); + } + + /** + * Lists the notification hubs associated with a namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param notificationHubName The notification hub name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String resourceGroupName, String namespaceName, String notificationHubName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, namespaceName, notificationHubName), serviceCallback); + } + + /** + * Lists the notification hubs associated with a namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param notificationHubName The notification hub name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the NotificationHubResourceInner object + */ + public Observable getAsync(String resourceGroupName, String namespaceName, String notificationHubName) { + return getWithServiceResponseAsync(resourceGroupName, namespaceName, notificationHubName).map(new Func1, NotificationHubResourceInner>() { + @Override + public NotificationHubResourceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Lists the notification hubs associated with a namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param notificationHubName The notification hub name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the NotificationHubResourceInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String namespaceName, String notificationHubName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (namespaceName == null) { + throw new IllegalArgumentException("Parameter namespaceName is required and cannot be null."); + } + if (notificationHubName == null) { + throw new IllegalArgumentException("Parameter notificationHubName is required and cannot be null."); + } + 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.get(resourceGroupName, namespaceName, notificationHubName, this.client.subscriptionId(), 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 CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Creates/Updates an authorization rule for a NotificationHub. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param notificationHubName The notification hub name. + * @param authorizationRuleName Authorization Rule Name. + * @param parameters The shared access authorization rule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the SharedAccessAuthorizationRuleResourceInner object if successful. + */ + public SharedAccessAuthorizationRuleResourceInner createOrUpdateAuthorizationRule(String resourceGroupName, String namespaceName, String notificationHubName, String authorizationRuleName, SharedAccessAuthorizationRuleCreateOrUpdateParameters parameters) { + return createOrUpdateAuthorizationRuleWithServiceResponseAsync(resourceGroupName, namespaceName, notificationHubName, authorizationRuleName, parameters).toBlocking().single().body(); + } + + /** + * Creates/Updates an authorization rule for a NotificationHub. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param notificationHubName The notification hub name. + * @param authorizationRuleName Authorization Rule Name. + * @param parameters The shared access authorization rule. + * @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 createOrUpdateAuthorizationRuleAsync(String resourceGroupName, String namespaceName, String notificationHubName, String authorizationRuleName, SharedAccessAuthorizationRuleCreateOrUpdateParameters parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateAuthorizationRuleWithServiceResponseAsync(resourceGroupName, namespaceName, notificationHubName, authorizationRuleName, parameters), serviceCallback); + } + + /** + * Creates/Updates an authorization rule for a NotificationHub. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param notificationHubName The notification hub name. + * @param authorizationRuleName Authorization Rule Name. + * @param parameters The shared access authorization rule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SharedAccessAuthorizationRuleResourceInner object + */ + public Observable createOrUpdateAuthorizationRuleAsync(String resourceGroupName, String namespaceName, String notificationHubName, String authorizationRuleName, SharedAccessAuthorizationRuleCreateOrUpdateParameters parameters) { + return createOrUpdateAuthorizationRuleWithServiceResponseAsync(resourceGroupName, namespaceName, notificationHubName, authorizationRuleName, parameters).map(new Func1, SharedAccessAuthorizationRuleResourceInner>() { + @Override + public SharedAccessAuthorizationRuleResourceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates/Updates an authorization rule for a NotificationHub. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param notificationHubName The notification hub name. + * @param authorizationRuleName Authorization Rule Name. + * @param parameters The shared access authorization rule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SharedAccessAuthorizationRuleResourceInner object + */ + public Observable> createOrUpdateAuthorizationRuleWithServiceResponseAsync(String resourceGroupName, String namespaceName, String notificationHubName, String authorizationRuleName, SharedAccessAuthorizationRuleCreateOrUpdateParameters parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (namespaceName == null) { + throw new IllegalArgumentException("Parameter namespaceName is required and cannot be null."); + } + if (notificationHubName == null) { + throw new IllegalArgumentException("Parameter notificationHubName is required and cannot be null."); + } + if (authorizationRuleName == null) { + throw new IllegalArgumentException("Parameter authorizationRuleName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters 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(parameters); + return service.createOrUpdateAuthorizationRule(resourceGroupName, namespaceName, notificationHubName, authorizationRuleName, this.client.subscriptionId(), parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = createOrUpdateAuthorizationRuleDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse createOrUpdateAuthorizationRuleDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Deletes a notificationHub authorization rule. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param notificationHubName The notification hub name. + * @param authorizationRuleName Authorization Rule Name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void deleteAuthorizationRule(String resourceGroupName, String namespaceName, String notificationHubName, String authorizationRuleName) { + deleteAuthorizationRuleWithServiceResponseAsync(resourceGroupName, namespaceName, notificationHubName, authorizationRuleName).toBlocking().single().body(); + } + + /** + * Deletes a notificationHub authorization rule. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param notificationHubName The notification hub name. + * @param authorizationRuleName Authorization Rule Name. + * @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 deleteAuthorizationRuleAsync(String resourceGroupName, String namespaceName, String notificationHubName, String authorizationRuleName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteAuthorizationRuleWithServiceResponseAsync(resourceGroupName, namespaceName, notificationHubName, authorizationRuleName), serviceCallback); + } + + /** + * Deletes a notificationHub authorization rule. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param notificationHubName The notification hub name. + * @param authorizationRuleName Authorization Rule Name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable deleteAuthorizationRuleAsync(String resourceGroupName, String namespaceName, String notificationHubName, String authorizationRuleName) { + return deleteAuthorizationRuleWithServiceResponseAsync(resourceGroupName, namespaceName, notificationHubName, authorizationRuleName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes a notificationHub authorization rule. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param notificationHubName The notification hub name. + * @param authorizationRuleName Authorization Rule Name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> deleteAuthorizationRuleWithServiceResponseAsync(String resourceGroupName, String namespaceName, String notificationHubName, String authorizationRuleName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (namespaceName == null) { + throw new IllegalArgumentException("Parameter namespaceName is required and cannot be null."); + } + if (notificationHubName == null) { + throw new IllegalArgumentException("Parameter notificationHubName is required and cannot be null."); + } + if (authorizationRuleName == null) { + throw new IllegalArgumentException("Parameter authorizationRuleName is required and cannot be null."); + } + 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.deleteAuthorizationRule(resourceGroupName, namespaceName, notificationHubName, authorizationRuleName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = deleteAuthorizationRuleDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse deleteAuthorizationRuleDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets an authorization rule for a NotificationHub by name. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name + * @param notificationHubName The notification hub name. + * @param authorizationRuleName authorization rule name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the SharedAccessAuthorizationRuleResourceInner object if successful. + */ + public SharedAccessAuthorizationRuleResourceInner getAuthorizationRule(String resourceGroupName, String namespaceName, String notificationHubName, String authorizationRuleName) { + return getAuthorizationRuleWithServiceResponseAsync(resourceGroupName, namespaceName, notificationHubName, authorizationRuleName).toBlocking().single().body(); + } + + /** + * Gets an authorization rule for a NotificationHub by name. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name + * @param notificationHubName The notification hub name. + * @param authorizationRuleName authorization rule name. + * @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 getAuthorizationRuleAsync(String resourceGroupName, String namespaceName, String notificationHubName, String authorizationRuleName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getAuthorizationRuleWithServiceResponseAsync(resourceGroupName, namespaceName, notificationHubName, authorizationRuleName), serviceCallback); + } + + /** + * Gets an authorization rule for a NotificationHub by name. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name + * @param notificationHubName The notification hub name. + * @param authorizationRuleName authorization rule name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SharedAccessAuthorizationRuleResourceInner object + */ + public Observable getAuthorizationRuleAsync(String resourceGroupName, String namespaceName, String notificationHubName, String authorizationRuleName) { + return getAuthorizationRuleWithServiceResponseAsync(resourceGroupName, namespaceName, notificationHubName, authorizationRuleName).map(new Func1, SharedAccessAuthorizationRuleResourceInner>() { + @Override + public SharedAccessAuthorizationRuleResourceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets an authorization rule for a NotificationHub by name. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name + * @param notificationHubName The notification hub name. + * @param authorizationRuleName authorization rule name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SharedAccessAuthorizationRuleResourceInner object + */ + public Observable> getAuthorizationRuleWithServiceResponseAsync(String resourceGroupName, String namespaceName, String notificationHubName, String authorizationRuleName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (namespaceName == null) { + throw new IllegalArgumentException("Parameter namespaceName is required and cannot be null."); + } + if (notificationHubName == null) { + throw new IllegalArgumentException("Parameter notificationHubName is required and cannot be null."); + } + if (authorizationRuleName == null) { + throw new IllegalArgumentException("Parameter authorizationRuleName is required and cannot be null."); + } + 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.getAuthorizationRule(resourceGroupName, namespaceName, notificationHubName, authorizationRuleName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getAuthorizationRuleDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getAuthorizationRuleDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Lists the notification hubs associated with a namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException 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<NotificationHubResourceInner> object if successful. + */ + public PagedList list(final String resourceGroupName, final String namespaceName) { + ServiceResponse> response = listSinglePageAsync(resourceGroupName, namespaceName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists the notification hubs associated with a namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @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 String resourceGroupName, final String namespaceName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(resourceGroupName, namespaceName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists the notification hubs associated with a namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<NotificationHubResourceInner> object + */ + public Observable> listAsync(final String resourceGroupName, final String namespaceName) { + return listWithServiceResponseAsync(resourceGroupName, namespaceName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists the notification hubs associated with a namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<NotificationHubResourceInner> object + */ + public Observable>> listWithServiceResponseAsync(final String resourceGroupName, final String namespaceName) { + return listSinglePageAsync(resourceGroupName, namespaceName) + .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 the notification hubs associated with a namespace. + * + ServiceResponse> * @param resourceGroupName The name of the resource group. + ServiceResponse> * @param namespaceName The namespace name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<NotificationHubResourceInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync(final String resourceGroupName, final String namespaceName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (namespaceName == null) { + throw new IllegalArgumentException("Parameter namespaceName is required and cannot be null."); + } + 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(resourceGroupName, namespaceName, 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 CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets the authorization rules for a NotificationHub. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name + * @param notificationHubName The notification hub name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException 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<SharedAccessAuthorizationRuleResourceInner> object if successful. + */ + public PagedList listAuthorizationRules(final String resourceGroupName, final String namespaceName, final String notificationHubName) { + ServiceResponse> response = listAuthorizationRulesSinglePageAsync(resourceGroupName, namespaceName, notificationHubName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listAuthorizationRulesNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets the authorization rules for a NotificationHub. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name + * @param notificationHubName The notification hub name. + * @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> listAuthorizationRulesAsync(final String resourceGroupName, final String namespaceName, final String notificationHubName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listAuthorizationRulesSinglePageAsync(resourceGroupName, namespaceName, notificationHubName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listAuthorizationRulesNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets the authorization rules for a NotificationHub. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name + * @param notificationHubName The notification hub name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<SharedAccessAuthorizationRuleResourceInner> object + */ + public Observable> listAuthorizationRulesAsync(final String resourceGroupName, final String namespaceName, final String notificationHubName) { + return listAuthorizationRulesWithServiceResponseAsync(resourceGroupName, namespaceName, notificationHubName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets the authorization rules for a NotificationHub. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name + * @param notificationHubName The notification hub name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<SharedAccessAuthorizationRuleResourceInner> object + */ + public Observable>> listAuthorizationRulesWithServiceResponseAsync(final String resourceGroupName, final String namespaceName, final String notificationHubName) { + return listAuthorizationRulesSinglePageAsync(resourceGroupName, namespaceName, notificationHubName) + .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(listAuthorizationRulesNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets the authorization rules for a NotificationHub. + * + ServiceResponse> * @param resourceGroupName The name of the resource group. + ServiceResponse> * @param namespaceName The namespace name + ServiceResponse> * @param notificationHubName The notification hub name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<SharedAccessAuthorizationRuleResourceInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listAuthorizationRulesSinglePageAsync(final String resourceGroupName, final String namespaceName, final String notificationHubName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (namespaceName == null) { + throw new IllegalArgumentException("Parameter namespaceName is required and cannot be null."); + } + if (notificationHubName == null) { + throw new IllegalArgumentException("Parameter notificationHubName is required and cannot be null."); + } + 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.listAuthorizationRules(resourceGroupName, namespaceName, notificationHubName, 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 = listAuthorizationRulesDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listAuthorizationRulesDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets the Primary and Secondary ConnectionStrings to the NotificationHub. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param notificationHubName The notification hub name. + * @param authorizationRuleName The connection string of the NotificationHub for the specified authorizationRule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ResourceListKeysInner object if successful. + */ + public ResourceListKeysInner listKeys(String resourceGroupName, String namespaceName, String notificationHubName, String authorizationRuleName) { + return listKeysWithServiceResponseAsync(resourceGroupName, namespaceName, notificationHubName, authorizationRuleName).toBlocking().single().body(); + } + + /** + * Gets the Primary and Secondary ConnectionStrings to the NotificationHub. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param notificationHubName The notification hub name. + * @param authorizationRuleName The connection string of the NotificationHub for the specified authorizationRule. + * @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 listKeysAsync(String resourceGroupName, String namespaceName, String notificationHubName, String authorizationRuleName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(listKeysWithServiceResponseAsync(resourceGroupName, namespaceName, notificationHubName, authorizationRuleName), serviceCallback); + } + + /** + * Gets the Primary and Secondary ConnectionStrings to the NotificationHub. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param notificationHubName The notification hub name. + * @param authorizationRuleName The connection string of the NotificationHub for the specified authorizationRule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ResourceListKeysInner object + */ + public Observable listKeysAsync(String resourceGroupName, String namespaceName, String notificationHubName, String authorizationRuleName) { + return listKeysWithServiceResponseAsync(resourceGroupName, namespaceName, notificationHubName, authorizationRuleName).map(new Func1, ResourceListKeysInner>() { + @Override + public ResourceListKeysInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the Primary and Secondary ConnectionStrings to the NotificationHub. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param notificationHubName The notification hub name. + * @param authorizationRuleName The connection string of the NotificationHub for the specified authorizationRule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ResourceListKeysInner object + */ + public Observable> listKeysWithServiceResponseAsync(String resourceGroupName, String namespaceName, String notificationHubName, String authorizationRuleName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (namespaceName == null) { + throw new IllegalArgumentException("Parameter namespaceName is required and cannot be null."); + } + if (notificationHubName == null) { + throw new IllegalArgumentException("Parameter notificationHubName is required and cannot be null."); + } + if (authorizationRuleName == null) { + throw new IllegalArgumentException("Parameter authorizationRuleName is required and cannot be null."); + } + 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.listKeys(resourceGroupName, namespaceName, notificationHubName, authorizationRuleName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = listKeysDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse listKeysDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Lists the PNS Credentials associated with a notification hub . + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param notificationHubName The notification hub name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the NotificationHubResourceInner object if successful. + */ + public NotificationHubResourceInner getPnsCredentials(String resourceGroupName, String namespaceName, String notificationHubName) { + return getPnsCredentialsWithServiceResponseAsync(resourceGroupName, namespaceName, notificationHubName).toBlocking().single().body(); + } + + /** + * Lists the PNS Credentials associated with a notification hub . + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param notificationHubName The notification hub name. + * @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 getPnsCredentialsAsync(String resourceGroupName, String namespaceName, String notificationHubName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getPnsCredentialsWithServiceResponseAsync(resourceGroupName, namespaceName, notificationHubName), serviceCallback); + } + + /** + * Lists the PNS Credentials associated with a notification hub . + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param notificationHubName The notification hub name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the NotificationHubResourceInner object + */ + public Observable getPnsCredentialsAsync(String resourceGroupName, String namespaceName, String notificationHubName) { + return getPnsCredentialsWithServiceResponseAsync(resourceGroupName, namespaceName, notificationHubName).map(new Func1, NotificationHubResourceInner>() { + @Override + public NotificationHubResourceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Lists the PNS Credentials associated with a notification hub . + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param notificationHubName The notification hub name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the NotificationHubResourceInner object + */ + public Observable> getPnsCredentialsWithServiceResponseAsync(String resourceGroupName, String namespaceName, String notificationHubName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (namespaceName == null) { + throw new IllegalArgumentException("Parameter namespaceName is required and cannot be null."); + } + if (notificationHubName == null) { + throw new IllegalArgumentException("Parameter notificationHubName is required and cannot be null."); + } + 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.getPnsCredentials(resourceGroupName, namespaceName, notificationHubName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getPnsCredentialsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getPnsCredentialsDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Lists the notification hubs associated with a namespace. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException 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<NotificationHubResourceInner> 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 the notification hubs associated with a namespace. + * + * @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 the notification hubs associated with a namespace. + * + * @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<NotificationHubResourceInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists the notification hubs associated with a namespace. + * + * @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<NotificationHubResourceInner> 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 the notification hubs associated with a namespace. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<NotificationHubResourceInner> 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 CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets the authorization rules for a NotificationHub. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException 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<SharedAccessAuthorizationRuleResourceInner> object if successful. + */ + public PagedList listAuthorizationRulesNext(final String nextPageLink) { + ServiceResponse> response = listAuthorizationRulesNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listAuthorizationRulesNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets the authorization rules for a NotificationHub. + * + * @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> listAuthorizationRulesNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listAuthorizationRulesNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listAuthorizationRulesNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets the authorization rules for a NotificationHub. + * + * @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<SharedAccessAuthorizationRuleResourceInner> object + */ + public Observable> listAuthorizationRulesNextAsync(final String nextPageLink) { + return listAuthorizationRulesNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets the authorization rules for a NotificationHub. + * + * @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<SharedAccessAuthorizationRuleResourceInner> object + */ + public Observable>> listAuthorizationRulesNextWithServiceResponseAsync(final String nextPageLink) { + return listAuthorizationRulesNextSinglePageAsync(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(listAuthorizationRulesNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets the authorization rules for a NotificationHub. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<SharedAccessAuthorizationRuleResourceInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listAuthorizationRulesNextSinglePageAsync(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.listAuthorizationRulesNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listAuthorizationRulesNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listAuthorizationRulesNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/notificationhubs/resource-manager/v2014_09_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2014_09_01/implementation/NotificationHubsManagementClientImpl.java b/notificationhubs/resource-manager/v2014_09_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2014_09_01/implementation/NotificationHubsManagementClientImpl.java new file mode 100644 index 000000000000..bb3bd88f8bdd --- /dev/null +++ b/notificationhubs/resource-manager/v2014_09_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2014_09_01/implementation/NotificationHubsManagementClientImpl.java @@ -0,0 +1,210 @@ +/** + * 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.notificationhubs.v2014_09_01.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 NotificationHubsManagementClientImpl class. + */ +public class NotificationHubsManagementClientImpl 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; + } + + /** Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. */ + private String subscriptionId; + + /** + * Gets Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + * + * @return the subscriptionId value. + */ + public String subscriptionId() { + return this.subscriptionId; + } + + /** + * Sets Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + * + * @param subscriptionId the subscriptionId value. + * @return the service client itself + */ + public NotificationHubsManagementClientImpl withSubscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; + return this; + } + + /** Client Api Version. */ + private String apiVersion; + + /** + * Gets Client Api Version. + * + * @return the apiVersion value. + */ + public String apiVersion() { + return this.apiVersion; + } + + /** The preferred language for the response. */ + private String acceptLanguage; + + /** + * Gets The preferred language for the response. + * + * @return the acceptLanguage value. + */ + public String acceptLanguage() { + return this.acceptLanguage; + } + + /** + * Sets The preferred language for the response. + * + * @param acceptLanguage the acceptLanguage value. + * @return the service client itself + */ + public NotificationHubsManagementClientImpl 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 NotificationHubsManagementClientImpl 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 NotificationHubsManagementClientImpl withGenerateClientRequestId(boolean generateClientRequestId) { + this.generateClientRequestId = generateClientRequestId; + return this; + } + + /** + * The NamespacesInner object to access its operations. + */ + private NamespacesInner namespaces; + + /** + * Gets the NamespacesInner object to access its operations. + * @return the NamespacesInner object. + */ + public NamespacesInner namespaces() { + return this.namespaces; + } + + /** + * The NotificationHubsInner object to access its operations. + */ + private NotificationHubsInner notificationHubs; + + /** + * Gets the NotificationHubsInner object to access its operations. + * @return the NotificationHubsInner object. + */ + public NotificationHubsInner notificationHubs() { + return this.notificationHubs; + } + + /** + * Initializes an instance of NotificationHubsManagementClient client. + * + * @param credentials the management credentials for Azure + */ + public NotificationHubsManagementClientImpl(ServiceClientCredentials credentials) { + this("https://management.azure.com", credentials); + } + + /** + * Initializes an instance of NotificationHubsManagementClient client. + * + * @param baseUrl the base URL of the host + * @param credentials the management credentials for Azure + */ + public NotificationHubsManagementClientImpl(String baseUrl, ServiceClientCredentials credentials) { + super(baseUrl, credentials); + initialize(); + } + + /** + * Initializes an instance of NotificationHubsManagementClient client. + * + * @param restClient the REST client to connect to Azure. + */ + public NotificationHubsManagementClientImpl(RestClient restClient) { + super(restClient); + initialize(); + } + + protected void initialize() { + this.apiVersion = "2014-09-01"; + this.acceptLanguage = "en-US"; + this.longRunningOperationRetryTimeout = 30; + this.generateClientRequestId = true; + this.namespaces = new NamespacesInner(restClient().retrofit(), this); + this.notificationHubs = new NotificationHubsInner(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(), "NotificationHubsManagementClient", "2014-09-01"); + } +} diff --git a/notificationhubs/resource-manager/v2014_09_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2014_09_01/implementation/NotificationHubsManager.java b/notificationhubs/resource-manager/v2014_09_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2014_09_01/implementation/NotificationHubsManager.java new file mode 100644 index 000000000000..521face7ea86 --- /dev/null +++ b/notificationhubs/resource-manager/v2014_09_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2014_09_01/implementation/NotificationHubsManager.java @@ -0,0 +1,111 @@ +/** + * 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.notificationhubs.v2014_09_01.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.notificationhubs.v2014_09_01.Namespaces; +import com.microsoft.azure.management.notificationhubs.v2014_09_01.NotificationHubs; +import com.microsoft.azure.arm.resources.implementation.AzureConfigurableCoreImpl; +import com.microsoft.azure.arm.resources.implementation.ManagerCore; + +/** + * Entry point to Azure NotificationHubs resource management. + */ +public final class NotificationHubsManager extends ManagerCore { + private Namespaces namespaces; + private NotificationHubs notificationHubs; + /** + * Get a Configurable instance that can be used to create NotificationHubsManager with optional configuration. + * + * @return the instance allowing configurations + */ + public static Configurable configure() { + return new NotificationHubsManager.ConfigurableImpl(); + } + /** + * Creates an instance of NotificationHubsManager that exposes NotificationHubs resource management API entry points. + * + * @param credentials the credentials to use + * @param subscriptionId the subscription UUID + * @return the NotificationHubsManager + */ + public static NotificationHubsManager authenticate(AzureTokenCredentials credentials, String subscriptionId) { + return new NotificationHubsManager(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 NotificationHubsManager that exposes NotificationHubs resource management API entry points. + * + * @param restClient the RestClient to be used for API calls. + * @param subscriptionId the subscription UUID + * @return the NotificationHubsManager + */ + public static NotificationHubsManager authenticate(RestClient restClient, String subscriptionId) { + return new NotificationHubsManager(restClient, subscriptionId); + } + /** + * The interface allowing configurations to be set. + */ + public interface Configurable extends AzureConfigurable { + /** + * Creates an instance of NotificationHubsManager that exposes NotificationHubs management API entry points. + * + * @param credentials the credentials to use + * @param subscriptionId the subscription UUID + * @return the interface exposing NotificationHubs management API entry points that work across subscriptions + */ + NotificationHubsManager authenticate(AzureTokenCredentials credentials, String subscriptionId); + } + + /** + * @return Entry point to manage Namespaces. + */ + public Namespaces namespaces() { + if (this.namespaces == null) { + this.namespaces = new NamespacesImpl(this); + } + return this.namespaces; + } + + /** + * @return Entry point to manage NotificationHubs. + */ + public NotificationHubs notificationHubs() { + if (this.notificationHubs == null) { + this.notificationHubs = new NotificationHubsImpl(this); + } + return this.notificationHubs; + } + + /** + * The implementation for Configurable interface. + */ + private static final class ConfigurableImpl extends AzureConfigurableCoreImpl implements Configurable { + public NotificationHubsManager authenticate(AzureTokenCredentials credentials, String subscriptionId) { + return NotificationHubsManager.authenticate(buildRestClient(credentials), subscriptionId); + } + } + private NotificationHubsManager(RestClient restClient, String subscriptionId) { + super( + restClient, + subscriptionId, + new NotificationHubsManagementClientImpl(restClient).withSubscriptionId(subscriptionId)); + } +} diff --git a/notificationhubs/resource-manager/v2014_09_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2014_09_01/implementation/PageImpl.java b/notificationhubs/resource-manager/v2014_09_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2014_09_01/implementation/PageImpl.java new file mode 100644 index 000000000000..cf2c8c64f1e3 --- /dev/null +++ b/notificationhubs/resource-manager/v2014_09_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2014_09_01/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.notificationhubs.v2014_09_01.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/notificationhubs/resource-manager/v2014_09_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2014_09_01/implementation/ResourceListKeysImpl.java b/notificationhubs/resource-manager/v2014_09_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2014_09_01/implementation/ResourceListKeysImpl.java new file mode 100644 index 000000000000..02591f2d40dc --- /dev/null +++ b/notificationhubs/resource-manager/v2014_09_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2014_09_01/implementation/ResourceListKeysImpl.java @@ -0,0 +1,36 @@ +/** + * 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.notificationhubs.v2014_09_01.implementation; + +import com.microsoft.azure.management.notificationhubs.v2014_09_01.ResourceListKeys; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; + +class ResourceListKeysImpl extends WrapperImpl implements ResourceListKeys { + private final NotificationHubsManager manager; + ResourceListKeysImpl(ResourceListKeysInner inner, NotificationHubsManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public NotificationHubsManager manager() { + return this.manager; + } + + @Override + public String primaryConnectionString() { + return this.inner().primaryConnectionString(); + } + + @Override + public String secondaryConnectionString() { + return this.inner().secondaryConnectionString(); + } + +} diff --git a/notificationhubs/resource-manager/v2014_09_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2014_09_01/implementation/ResourceListKeysInner.java b/notificationhubs/resource-manager/v2014_09_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2014_09_01/implementation/ResourceListKeysInner.java new file mode 100644 index 000000000000..ba20ce360002 --- /dev/null +++ b/notificationhubs/resource-manager/v2014_09_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2014_09_01/implementation/ResourceListKeysInner.java @@ -0,0 +1,71 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.notificationhubs.v2014_09_01.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Namespace/NotificationHub Connection String. + */ +public class ResourceListKeysInner { + /** + * Gets or sets the primaryConnectionString of the created Namespace + * AuthorizationRule. + */ + @JsonProperty(value = "primaryConnectionString") + private String primaryConnectionString; + + /** + * Gets or sets the secondaryConnectionString of the created Namespace + * AuthorizationRule. + */ + @JsonProperty(value = "secondaryConnectionString") + private String secondaryConnectionString; + + /** + * Get gets or sets the primaryConnectionString of the created Namespace AuthorizationRule. + * + * @return the primaryConnectionString value + */ + public String primaryConnectionString() { + return this.primaryConnectionString; + } + + /** + * Set gets or sets the primaryConnectionString of the created Namespace AuthorizationRule. + * + * @param primaryConnectionString the primaryConnectionString value to set + * @return the ResourceListKeysInner object itself. + */ + public ResourceListKeysInner withPrimaryConnectionString(String primaryConnectionString) { + this.primaryConnectionString = primaryConnectionString; + return this; + } + + /** + * Get gets or sets the secondaryConnectionString of the created Namespace AuthorizationRule. + * + * @return the secondaryConnectionString value + */ + public String secondaryConnectionString() { + return this.secondaryConnectionString; + } + + /** + * Set gets or sets the secondaryConnectionString of the created Namespace AuthorizationRule. + * + * @param secondaryConnectionString the secondaryConnectionString value to set + * @return the ResourceListKeysInner object itself. + */ + public ResourceListKeysInner withSecondaryConnectionString(String secondaryConnectionString) { + this.secondaryConnectionString = secondaryConnectionString; + return this; + } + +} diff --git a/notificationhubs/resource-manager/v2014_09_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2014_09_01/implementation/SharedAccessAuthorizationRuleResourceInner.java b/notificationhubs/resource-manager/v2014_09_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2014_09_01/implementation/SharedAccessAuthorizationRuleResourceInner.java new file mode 100644 index 000000000000..904737bf46ad --- /dev/null +++ b/notificationhubs/resource-manager/v2014_09_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2014_09_01/implementation/SharedAccessAuthorizationRuleResourceInner.java @@ -0,0 +1,175 @@ +/** + * 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.notificationhubs.v2014_09_01.implementation; + +import java.util.Map; +import com.microsoft.azure.management.notificationhubs.v2014_09_01.SharedAccessAuthorizationRuleProperties; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Description of a Namespace AuthorizationRules. + */ +public class SharedAccessAuthorizationRuleResourceInner { + /** + * Gets or sets the id of the created Namespace AuthorizationRules. + */ + @JsonProperty(value = "id") + private String id; + + /** + * Gets or sets datacenter location of the Namespace AuthorizationRules. + */ + @JsonProperty(value = "location") + private String location; + + /** + * Gets or sets name of the Namespace AuthorizationRules. + */ + @JsonProperty(value = "name") + private String name; + + /** + * Gets or sets resource type of the Namespace AuthorizationRules. + */ + @JsonProperty(value = "type") + private String type; + + /** + * Gets or sets tags of the Namespace AuthorizationRules. + */ + @JsonProperty(value = "tags") + private Map tags; + + /** + * Gets or sets properties of the Namespace. + */ + @JsonProperty(value = "properties") + private SharedAccessAuthorizationRuleProperties properties; + + /** + * Get gets or sets the id of the created Namespace AuthorizationRules. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set gets or sets the id of the created Namespace AuthorizationRules. + * + * @param id the id value to set + * @return the SharedAccessAuthorizationRuleResourceInner object itself. + */ + public SharedAccessAuthorizationRuleResourceInner withId(String id) { + this.id = id; + return this; + } + + /** + * Get gets or sets datacenter location of the Namespace AuthorizationRules. + * + * @return the location value + */ + public String location() { + return this.location; + } + + /** + * Set gets or sets datacenter location of the Namespace AuthorizationRules. + * + * @param location the location value to set + * @return the SharedAccessAuthorizationRuleResourceInner object itself. + */ + public SharedAccessAuthorizationRuleResourceInner withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get gets or sets name of the Namespace AuthorizationRules. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set gets or sets name of the Namespace AuthorizationRules. + * + * @param name the name value to set + * @return the SharedAccessAuthorizationRuleResourceInner object itself. + */ + public SharedAccessAuthorizationRuleResourceInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get gets or sets resource type of the Namespace AuthorizationRules. + * + * @return the type value + */ + public String type() { + return this.type; + } + + /** + * Set gets or sets resource type of the Namespace AuthorizationRules. + * + * @param type the type value to set + * @return the SharedAccessAuthorizationRuleResourceInner object itself. + */ + public SharedAccessAuthorizationRuleResourceInner withType(String type) { + this.type = type; + return this; + } + + /** + * Get gets or sets tags of the Namespace AuthorizationRules. + * + * @return the tags value + */ + public Map tags() { + return this.tags; + } + + /** + * Set gets or sets tags of the Namespace AuthorizationRules. + * + * @param tags the tags value to set + * @return the SharedAccessAuthorizationRuleResourceInner object itself. + */ + public SharedAccessAuthorizationRuleResourceInner withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Get gets or sets properties of the Namespace. + * + * @return the properties value + */ + public SharedAccessAuthorizationRuleProperties properties() { + return this.properties; + } + + /** + * Set gets or sets properties of the Namespace. + * + * @param properties the properties value to set + * @return the SharedAccessAuthorizationRuleResourceInner object itself. + */ + public SharedAccessAuthorizationRuleResourceInner withProperties(SharedAccessAuthorizationRuleProperties properties) { + this.properties = properties; + return this; + } + +} diff --git a/notificationhubs/resource-manager/v2014_09_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2014_09_01/implementation/package-info.java b/notificationhubs/resource-manager/v2014_09_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2014_09_01/implementation/package-info.java new file mode 100644 index 000000000000..5b3327511b5e --- /dev/null +++ b/notificationhubs/resource-manager/v2014_09_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2014_09_01/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 NotificationHubsManagementClient. + * Azure NotificationHub client. + */ +package com.microsoft.azure.management.notificationhubs.v2014_09_01.implementation; diff --git a/notificationhubs/resource-manager/v2014_09_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2014_09_01/package-info.java b/notificationhubs/resource-manager/v2014_09_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2014_09_01/package-info.java new file mode 100644 index 000000000000..6cc9380f223b --- /dev/null +++ b/notificationhubs/resource-manager/v2014_09_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2014_09_01/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 NotificationHubsManagementClient. + * Azure NotificationHub client. + */ +package com.microsoft.azure.management.notificationhubs.v2014_09_01; diff --git a/notificationhubs/resource-manager/v2016_03_01/pom.xml b/notificationhubs/resource-manager/v2016_03_01/pom.xml new file mode 100644 index 000000000000..c4eed2028414 --- /dev/null +++ b/notificationhubs/resource-manager/v2016_03_01/pom.xml @@ -0,0 +1,133 @@ + + + 4.0.0 + com.microsoft.azure.notificationhubs.v2016_03_01 + + com.microsoft.azure + azure-arm-parent + 0.0.2-beta + ../../../pom.xml + + azure-mgmt-notificationhubs + 1.0.0-beta + jar + Microsoft Azure SDK for NotificationHubs Management + This package contains Microsoft NotificationHubs 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/notificationhubs/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2016_03_01/AccessRights.java b/notificationhubs/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2016_03_01/AccessRights.java new file mode 100644 index 000000000000..af2cca114561 --- /dev/null +++ b/notificationhubs/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2016_03_01/AccessRights.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.notificationhubs.v2016_03_01; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for AccessRights. + */ +public enum AccessRights { + /** Enum value Manage. */ + MANAGE("Manage"), + + /** Enum value Send. */ + SEND("Send"), + + /** Enum value Listen. */ + LISTEN("Listen"); + + /** The actual serialized value for a AccessRights instance. */ + private String value; + + AccessRights(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a AccessRights instance. + * + * @param value the serialized value to parse. + * @return the parsed AccessRights object, or null if unable to parse. + */ + @JsonCreator + public static AccessRights fromString(String value) { + AccessRights[] items = AccessRights.values(); + for (AccessRights item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/notificationhubs/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2016_03_01/AdmCredential.java b/notificationhubs/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2016_03_01/AdmCredential.java new file mode 100644 index 000000000000..2d28c47ac806 --- /dev/null +++ b/notificationhubs/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2016_03_01/AdmCredential.java @@ -0,0 +1,97 @@ +/** + * 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.notificationhubs.v2016_03_01; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * Description of a NotificationHub AdmCredential. + */ +@JsonFlatten +public class AdmCredential { + /** + * The client identifier. + */ + @JsonProperty(value = "properties.clientId") + private String clientId; + + /** + * The credential secret access key. + */ + @JsonProperty(value = "properties.clientSecret") + private String clientSecret; + + /** + * The URL of the authorization token. + */ + @JsonProperty(value = "properties.authTokenUrl") + private String authTokenUrl; + + /** + * Get the client identifier. + * + * @return the clientId value + */ + public String clientId() { + return this.clientId; + } + + /** + * Set the client identifier. + * + * @param clientId the clientId value to set + * @return the AdmCredential object itself. + */ + public AdmCredential withClientId(String clientId) { + this.clientId = clientId; + return this; + } + + /** + * Get the credential secret access key. + * + * @return the clientSecret value + */ + public String clientSecret() { + return this.clientSecret; + } + + /** + * Set the credential secret access key. + * + * @param clientSecret the clientSecret value to set + * @return the AdmCredential object itself. + */ + public AdmCredential withClientSecret(String clientSecret) { + this.clientSecret = clientSecret; + return this; + } + + /** + * Get the URL of the authorization token. + * + * @return the authTokenUrl value + */ + public String authTokenUrl() { + return this.authTokenUrl; + } + + /** + * Set the URL of the authorization token. + * + * @param authTokenUrl the authTokenUrl value to set + * @return the AdmCredential object itself. + */ + public AdmCredential withAuthTokenUrl(String authTokenUrl) { + this.authTokenUrl = authTokenUrl; + return this; + } + +} diff --git a/notificationhubs/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2016_03_01/ApnsCredential.java b/notificationhubs/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2016_03_01/ApnsCredential.java new file mode 100644 index 000000000000..e33eab99d352 --- /dev/null +++ b/notificationhubs/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2016_03_01/ApnsCredential.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.notificationhubs.v2016_03_01; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * Description of a NotificationHub ApnsCredential. + */ +@JsonFlatten +public class ApnsCredential { + /** + * The APNS certificate. + */ + @JsonProperty(value = "properties.apnsCertificate") + private String apnsCertificate; + + /** + * The certificate key. + */ + @JsonProperty(value = "properties.certificateKey") + private String certificateKey; + + /** + * The endpoint of this credential. + */ + @JsonProperty(value = "properties.endpoint") + private String endpoint; + + /** + * The Apns certificate Thumbprint. + */ + @JsonProperty(value = "properties.thumbprint") + private String thumbprint; + + /** + * Get the APNS certificate. + * + * @return the apnsCertificate value + */ + public String apnsCertificate() { + return this.apnsCertificate; + } + + /** + * Set the APNS certificate. + * + * @param apnsCertificate the apnsCertificate value to set + * @return the ApnsCredential object itself. + */ + public ApnsCredential withApnsCertificate(String apnsCertificate) { + this.apnsCertificate = apnsCertificate; + return this; + } + + /** + * Get the certificate key. + * + * @return the certificateKey value + */ + public String certificateKey() { + return this.certificateKey; + } + + /** + * Set the certificate key. + * + * @param certificateKey the certificateKey value to set + * @return the ApnsCredential object itself. + */ + public ApnsCredential withCertificateKey(String certificateKey) { + this.certificateKey = certificateKey; + return this; + } + + /** + * Get the endpoint of this credential. + * + * @return the endpoint value + */ + public String endpoint() { + return this.endpoint; + } + + /** + * Set the endpoint of this credential. + * + * @param endpoint the endpoint value to set + * @return the ApnsCredential object itself. + */ + public ApnsCredential withEndpoint(String endpoint) { + this.endpoint = endpoint; + return this; + } + + /** + * Get the Apns certificate Thumbprint. + * + * @return the thumbprint value + */ + public String thumbprint() { + return this.thumbprint; + } + + /** + * Set the Apns certificate Thumbprint. + * + * @param thumbprint the thumbprint value to set + * @return the ApnsCredential object itself. + */ + public ApnsCredential withThumbprint(String thumbprint) { + this.thumbprint = thumbprint; + return this; + } + +} diff --git a/notificationhubs/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2016_03_01/BaiduCredential.java b/notificationhubs/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2016_03_01/BaiduCredential.java new file mode 100644 index 000000000000..0969ac14da56 --- /dev/null +++ b/notificationhubs/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2016_03_01/BaiduCredential.java @@ -0,0 +1,97 @@ +/** + * 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.notificationhubs.v2016_03_01; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * Description of a NotificationHub BaiduCredential. + */ +@JsonFlatten +public class BaiduCredential { + /** + * Baidu Api Key. + */ + @JsonProperty(value = "properties.baiduApiKey") + private String baiduApiKey; + + /** + * Baidu Endpoint. + */ + @JsonProperty(value = "properties.baiduEndPoint") + private String baiduEndPoint; + + /** + * Baidu Secret Key. + */ + @JsonProperty(value = "properties.baiduSecretKey") + private String baiduSecretKey; + + /** + * Get baidu Api Key. + * + * @return the baiduApiKey value + */ + public String baiduApiKey() { + return this.baiduApiKey; + } + + /** + * Set baidu Api Key. + * + * @param baiduApiKey the baiduApiKey value to set + * @return the BaiduCredential object itself. + */ + public BaiduCredential withBaiduApiKey(String baiduApiKey) { + this.baiduApiKey = baiduApiKey; + return this; + } + + /** + * Get baidu Endpoint. + * + * @return the baiduEndPoint value + */ + public String baiduEndPoint() { + return this.baiduEndPoint; + } + + /** + * Set baidu Endpoint. + * + * @param baiduEndPoint the baiduEndPoint value to set + * @return the BaiduCredential object itself. + */ + public BaiduCredential withBaiduEndPoint(String baiduEndPoint) { + this.baiduEndPoint = baiduEndPoint; + return this; + } + + /** + * Get baidu Secret Key. + * + * @return the baiduSecretKey value + */ + public String baiduSecretKey() { + return this.baiduSecretKey; + } + + /** + * Set baidu Secret Key. + * + * @param baiduSecretKey the baiduSecretKey value to set + * @return the BaiduCredential object itself. + */ + public BaiduCredential withBaiduSecretKey(String baiduSecretKey) { + this.baiduSecretKey = baiduSecretKey; + return this; + } + +} diff --git a/notificationhubs/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2016_03_01/CheckAvailabilityParameters.java b/notificationhubs/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2016_03_01/CheckAvailabilityParameters.java new file mode 100644 index 000000000000..c1b1c76dcf86 --- /dev/null +++ b/notificationhubs/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2016_03_01/CheckAvailabilityParameters.java @@ -0,0 +1,180 @@ +/** + * 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.notificationhubs.v2016_03_01; + +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Parameters supplied to the Check Name Availability for Namespace and + * NotificationHubs. + */ +public class CheckAvailabilityParameters { + /** + * Resource Id. + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /** + * Resource name. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /** + * Resource type. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /** + * Resource location. + */ + @JsonProperty(value = "location", required = true) + private String location; + + /** + * Resource tags. + */ + @JsonProperty(value = "tags") + private Map tags; + + /** + * The sku of the created namespace. + */ + @JsonProperty(value = "sku") + private Sku sku; + + /** + * True if the name is available and can be used to create new + * Namespace/NotificationHub. Otherwise false. + */ + @JsonProperty(value = "isAvailiable") + private Boolean isAvailiable; + + /** + * Get resource Id. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Get resource name. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set resource name. + * + * @param name the name value to set + * @return the CheckAvailabilityParameters object itself. + */ + public CheckAvailabilityParameters withName(String name) { + this.name = name; + return this; + } + + /** + * Get resource type. + * + * @return the type value + */ + public String type() { + return this.type; + } + + /** + * Get resource location. + * + * @return the location value + */ + public String location() { + return this.location; + } + + /** + * Set resource location. + * + * @param location the location value to set + * @return the CheckAvailabilityParameters object itself. + */ + public CheckAvailabilityParameters withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get resource tags. + * + * @return the tags value + */ + public Map tags() { + return this.tags; + } + + /** + * Set resource tags. + * + * @param tags the tags value to set + * @return the CheckAvailabilityParameters object itself. + */ + public CheckAvailabilityParameters withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Get the sku of the created namespace. + * + * @return the sku value + */ + public Sku sku() { + return this.sku; + } + + /** + * Set the sku of the created namespace. + * + * @param sku the sku value to set + * @return the CheckAvailabilityParameters object itself. + */ + public CheckAvailabilityParameters withSku(Sku sku) { + this.sku = sku; + return this; + } + + /** + * Get true if the name is available and can be used to create new Namespace/NotificationHub. Otherwise false. + * + * @return the isAvailiable value + */ + public Boolean isAvailiable() { + return this.isAvailiable; + } + + /** + * Set true if the name is available and can be used to create new Namespace/NotificationHub. Otherwise false. + * + * @param isAvailiable the isAvailiable value to set + * @return the CheckAvailabilityParameters object itself. + */ + public CheckAvailabilityParameters withIsAvailiable(Boolean isAvailiable) { + this.isAvailiable = isAvailiable; + return this; + } + +} diff --git a/notificationhubs/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2016_03_01/CheckAvailabilityResult.java b/notificationhubs/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2016_03_01/CheckAvailabilityResult.java new file mode 100644 index 000000000000..220afa297feb --- /dev/null +++ b/notificationhubs/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2016_03_01/CheckAvailabilityResult.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.notificationhubs.v2016_03_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.notificationhubs.v2016_03_01.implementation.NotificationHubsManager; +import com.microsoft.azure.management.notificationhubs.v2016_03_01.implementation.CheckAvailabilityResultInner; +import java.util.Map; + +/** + * Type representing CheckAvailabilityResult. + */ +public interface CheckAvailabilityResult extends HasInner, HasManager { + /** + * @return the id value. + */ + String id(); + + /** + * @return the isAvailiable value. + */ + Boolean isAvailiable(); + + /** + * @return the location value. + */ + String location(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the sku value. + */ + Sku sku(); + + /** + * @return the tags value. + */ + Map tags(); + + /** + * @return the type value. + */ + String type(); + +} diff --git a/notificationhubs/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2016_03_01/GcmCredential.java b/notificationhubs/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2016_03_01/GcmCredential.java new file mode 100644 index 000000000000..343bf7a3781c --- /dev/null +++ b/notificationhubs/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2016_03_01/GcmCredential.java @@ -0,0 +1,71 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.notificationhubs.v2016_03_01; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * Description of a NotificationHub GcmCredential. + */ +@JsonFlatten +public class GcmCredential { + /** + * The GCM endpoint. + */ + @JsonProperty(value = "properties.gcmEndpoint") + private String gcmEndpoint; + + /** + * The Google API key. + */ + @JsonProperty(value = "properties.googleApiKey") + private String googleApiKey; + + /** + * Get the GCM endpoint. + * + * @return the gcmEndpoint value + */ + public String gcmEndpoint() { + return this.gcmEndpoint; + } + + /** + * Set the GCM endpoint. + * + * @param gcmEndpoint the gcmEndpoint value to set + * @return the GcmCredential object itself. + */ + public GcmCredential withGcmEndpoint(String gcmEndpoint) { + this.gcmEndpoint = gcmEndpoint; + return this; + } + + /** + * Get the Google API key. + * + * @return the googleApiKey value + */ + public String googleApiKey() { + return this.googleApiKey; + } + + /** + * Set the Google API key. + * + * @param googleApiKey the googleApiKey value to set + * @return the GcmCredential object itself. + */ + public GcmCredential withGoogleApiKey(String googleApiKey) { + this.googleApiKey = googleApiKey; + return this; + } + +} diff --git a/notificationhubs/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2016_03_01/MpnsCredential.java b/notificationhubs/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2016_03_01/MpnsCredential.java new file mode 100644 index 000000000000..a8e911936376 --- /dev/null +++ b/notificationhubs/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2016_03_01/MpnsCredential.java @@ -0,0 +1,97 @@ +/** + * 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.notificationhubs.v2016_03_01; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * Description of a NotificationHub MpnsCredential. + */ +@JsonFlatten +public class MpnsCredential { + /** + * The MPNS certificate. + */ + @JsonProperty(value = "properties.mpnsCertificate") + private String mpnsCertificate; + + /** + * The certificate key for this credential. + */ + @JsonProperty(value = "properties.certificateKey") + private String certificateKey; + + /** + * The Mpns certificate Thumbprint. + */ + @JsonProperty(value = "properties.thumbprint") + private String thumbprint; + + /** + * Get the MPNS certificate. + * + * @return the mpnsCertificate value + */ + public String mpnsCertificate() { + return this.mpnsCertificate; + } + + /** + * Set the MPNS certificate. + * + * @param mpnsCertificate the mpnsCertificate value to set + * @return the MpnsCredential object itself. + */ + public MpnsCredential withMpnsCertificate(String mpnsCertificate) { + this.mpnsCertificate = mpnsCertificate; + return this; + } + + /** + * Get the certificate key for this credential. + * + * @return the certificateKey value + */ + public String certificateKey() { + return this.certificateKey; + } + + /** + * Set the certificate key for this credential. + * + * @param certificateKey the certificateKey value to set + * @return the MpnsCredential object itself. + */ + public MpnsCredential withCertificateKey(String certificateKey) { + this.certificateKey = certificateKey; + return this; + } + + /** + * Get the Mpns certificate Thumbprint. + * + * @return the thumbprint value + */ + public String thumbprint() { + return this.thumbprint; + } + + /** + * Set the Mpns certificate Thumbprint. + * + * @param thumbprint the thumbprint value to set + * @return the MpnsCredential object itself. + */ + public MpnsCredential withThumbprint(String thumbprint) { + this.thumbprint = thumbprint; + return this; + } + +} diff --git a/notificationhubs/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2016_03_01/NamespaceCreateOrUpdateParameters.java b/notificationhubs/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2016_03_01/NamespaceCreateOrUpdateParameters.java new file mode 100644 index 000000000000..fe6a1cbb5365 --- /dev/null +++ b/notificationhubs/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2016_03_01/NamespaceCreateOrUpdateParameters.java @@ -0,0 +1,339 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.notificationhubs.v2016_03_01; + +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.Resource; + +/** + * Parameters supplied to the CreateOrUpdate Namespace operation. + */ +@JsonFlatten +public class NamespaceCreateOrUpdateParameters extends Resource { + /** + * The name of the namespace. + */ + @JsonProperty(value = "properties.name") + private String namespaceCreateOrUpdateParametersName; + + /** + * Provisioning state of the Namespace. + */ + @JsonProperty(value = "properties.provisioningState") + private String provisioningState; + + /** + * Specifies the targeted region in which the namespace should be created. + * It can be any of the following values: Australia EastAustralia + * SoutheastCentral USEast USEast US 2West USNorth Central USSouth Central + * USEast AsiaSoutheast AsiaBrazil SouthJapan EastJapan WestNorth + * EuropeWest Europe. + */ + @JsonProperty(value = "properties.region") + private String region; + + /** + * Status of the namespace. It can be any of these values:1 = + * Created/Active2 = Creating3 = Suspended4 = Deleting. + */ + @JsonProperty(value = "properties.status") + private String status; + + /** + * The time the namespace was created. + */ + @JsonProperty(value = "properties.createdAt") + private DateTime createdAt; + + /** + * Endpoint you can use to perform NotificationHub operations. + */ + @JsonProperty(value = "properties.serviceBusEndpoint") + private String serviceBusEndpoint; + + /** + * The Id of the Azure subscription associated with the namespace. + */ + @JsonProperty(value = "properties.subscriptionId") + private String subscriptionId; + + /** + * ScaleUnit where the namespace gets created. + */ + @JsonProperty(value = "properties.scaleUnit") + private String scaleUnit; + + /** + * Whether or not the namespace is currently enabled. + */ + @JsonProperty(value = "properties.enabled") + private Boolean enabled; + + /** + * Whether or not the namespace is set as Critical. + */ + @JsonProperty(value = "properties.critical") + private Boolean critical; + + /** + * The namespace type. Possible values include: 'Messaging', + * 'NotificationHub'. + */ + @JsonProperty(value = "properties.namespaceType") + private NamespaceType namespaceType; + + /** + * The sku of the created namespace. + */ + @JsonProperty(value = "sku") + private Sku sku; + + /** + * Get the name of the namespace. + * + * @return the namespaceCreateOrUpdateParametersName value + */ + public String namespaceCreateOrUpdateParametersName() { + return this.namespaceCreateOrUpdateParametersName; + } + + /** + * Set the name of the namespace. + * + * @param namespaceCreateOrUpdateParametersName the namespaceCreateOrUpdateParametersName value to set + * @return the NamespaceCreateOrUpdateParameters object itself. + */ + public NamespaceCreateOrUpdateParameters withNamespaceCreateOrUpdateParametersName(String namespaceCreateOrUpdateParametersName) { + this.namespaceCreateOrUpdateParametersName = namespaceCreateOrUpdateParametersName; + return this; + } + + /** + * Get provisioning state of the Namespace. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Set provisioning state of the Namespace. + * + * @param provisioningState the provisioningState value to set + * @return the NamespaceCreateOrUpdateParameters object itself. + */ + public NamespaceCreateOrUpdateParameters withProvisioningState(String provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * Get specifies the targeted region in which the namespace should be created. It can be any of the following values: Australia EastAustralia SoutheastCentral USEast USEast US 2West USNorth Central USSouth Central USEast AsiaSoutheast AsiaBrazil SouthJapan EastJapan WestNorth EuropeWest Europe. + * + * @return the region value + */ + public String region() { + return this.region; + } + + /** + * Set specifies the targeted region in which the namespace should be created. It can be any of the following values: Australia EastAustralia SoutheastCentral USEast USEast US 2West USNorth Central USSouth Central USEast AsiaSoutheast AsiaBrazil SouthJapan EastJapan WestNorth EuropeWest Europe. + * + * @param region the region value to set + * @return the NamespaceCreateOrUpdateParameters object itself. + */ + public NamespaceCreateOrUpdateParameters withRegion(String region) { + this.region = region; + return this; + } + + /** + * Get status of the namespace. It can be any of these values:1 = Created/Active2 = Creating3 = Suspended4 = Deleting. + * + * @return the status value + */ + public String status() { + return this.status; + } + + /** + * Set status of the namespace. It can be any of these values:1 = Created/Active2 = Creating3 = Suspended4 = Deleting. + * + * @param status the status value to set + * @return the NamespaceCreateOrUpdateParameters object itself. + */ + public NamespaceCreateOrUpdateParameters withStatus(String status) { + this.status = status; + return this; + } + + /** + * Get the time the namespace was created. + * + * @return the createdAt value + */ + public DateTime createdAt() { + return this.createdAt; + } + + /** + * Set the time the namespace was created. + * + * @param createdAt the createdAt value to set + * @return the NamespaceCreateOrUpdateParameters object itself. + */ + public NamespaceCreateOrUpdateParameters withCreatedAt(DateTime createdAt) { + this.createdAt = createdAt; + return this; + } + + /** + * Get endpoint you can use to perform NotificationHub operations. + * + * @return the serviceBusEndpoint value + */ + public String serviceBusEndpoint() { + return this.serviceBusEndpoint; + } + + /** + * Set endpoint you can use to perform NotificationHub operations. + * + * @param serviceBusEndpoint the serviceBusEndpoint value to set + * @return the NamespaceCreateOrUpdateParameters object itself. + */ + public NamespaceCreateOrUpdateParameters withServiceBusEndpoint(String serviceBusEndpoint) { + this.serviceBusEndpoint = serviceBusEndpoint; + return this; + } + + /** + * Get the Id of the Azure subscription associated with the namespace. + * + * @return the subscriptionId value + */ + public String subscriptionId() { + return this.subscriptionId; + } + + /** + * Set the Id of the Azure subscription associated with the namespace. + * + * @param subscriptionId the subscriptionId value to set + * @return the NamespaceCreateOrUpdateParameters object itself. + */ + public NamespaceCreateOrUpdateParameters withSubscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; + return this; + } + + /** + * Get scaleUnit where the namespace gets created. + * + * @return the scaleUnit value + */ + public String scaleUnit() { + return this.scaleUnit; + } + + /** + * Set scaleUnit where the namespace gets created. + * + * @param scaleUnit the scaleUnit value to set + * @return the NamespaceCreateOrUpdateParameters object itself. + */ + public NamespaceCreateOrUpdateParameters withScaleUnit(String scaleUnit) { + this.scaleUnit = scaleUnit; + return this; + } + + /** + * Get whether or not the namespace is currently enabled. + * + * @return the enabled value + */ + public Boolean enabled() { + return this.enabled; + } + + /** + * Set whether or not the namespace is currently enabled. + * + * @param enabled the enabled value to set + * @return the NamespaceCreateOrUpdateParameters object itself. + */ + public NamespaceCreateOrUpdateParameters withEnabled(Boolean enabled) { + this.enabled = enabled; + return this; + } + + /** + * Get whether or not the namespace is set as Critical. + * + * @return the critical value + */ + public Boolean critical() { + return this.critical; + } + + /** + * Set whether or not the namespace is set as Critical. + * + * @param critical the critical value to set + * @return the NamespaceCreateOrUpdateParameters object itself. + */ + public NamespaceCreateOrUpdateParameters withCritical(Boolean critical) { + this.critical = critical; + return this; + } + + /** + * Get the namespace type. Possible values include: 'Messaging', 'NotificationHub'. + * + * @return the namespaceType value + */ + public NamespaceType namespaceType() { + return this.namespaceType; + } + + /** + * Set the namespace type. Possible values include: 'Messaging', 'NotificationHub'. + * + * @param namespaceType the namespaceType value to set + * @return the NamespaceCreateOrUpdateParameters object itself. + */ + public NamespaceCreateOrUpdateParameters withNamespaceType(NamespaceType namespaceType) { + this.namespaceType = namespaceType; + return this; + } + + /** + * Get the sku of the created namespace. + * + * @return the sku value + */ + public Sku sku() { + return this.sku; + } + + /** + * Set the sku of the created namespace. + * + * @param sku the sku value to set + * @return the NamespaceCreateOrUpdateParameters object itself. + */ + public NamespaceCreateOrUpdateParameters withSku(Sku sku) { + this.sku = sku; + return this; + } + +} diff --git a/notificationhubs/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2016_03_01/NamespacePatchParameters.java b/notificationhubs/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2016_03_01/NamespacePatchParameters.java new file mode 100644 index 000000000000..b4e64c173466 --- /dev/null +++ b/notificationhubs/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2016_03_01/NamespacePatchParameters.java @@ -0,0 +1,70 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.notificationhubs.v2016_03_01; + +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Parameters supplied to the Patch Namespace operation. + */ +public class NamespacePatchParameters { + /** + * Resource tags. + */ + @JsonProperty(value = "tags") + private Map tags; + + /** + * The sku of the created namespace. + */ + @JsonProperty(value = "sku") + private Sku sku; + + /** + * Get resource tags. + * + * @return the tags value + */ + public Map tags() { + return this.tags; + } + + /** + * Set resource tags. + * + * @param tags the tags value to set + * @return the NamespacePatchParameters object itself. + */ + public NamespacePatchParameters withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Get the sku of the created namespace. + * + * @return the sku value + */ + public Sku sku() { + return this.sku; + } + + /** + * Set the sku of the created namespace. + * + * @param sku the sku value to set + * @return the NamespacePatchParameters object itself. + */ + public NamespacePatchParameters withSku(Sku sku) { + this.sku = sku; + return this; + } + +} diff --git a/notificationhubs/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2016_03_01/NamespaceResource.java b/notificationhubs/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2016_03_01/NamespaceResource.java new file mode 100644 index 000000000000..20fa7154eb7a --- /dev/null +++ b/notificationhubs/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2016_03_01/NamespaceResource.java @@ -0,0 +1,268 @@ +/** + * 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.notificationhubs.v2016_03_01; + +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.notificationhubs.v2016_03_01.implementation.NotificationHubsManager; +import org.joda.time.DateTime; +import com.microsoft.azure.management.notificationhubs.v2016_03_01.implementation.NamespaceResourceInner; + +/** + * Type representing NamespaceResource. + */ +public interface NamespaceResource extends HasInner, Resource, GroupableResourceCore, HasResourceGroup, Refreshable, Updatable, HasManager { + /** + * @return the createdAt value. + */ + DateTime createdAt(); + + /** + * @return the critical value. + */ + Boolean critical(); + + /** + * @return the enabled value. + */ + Boolean enabled(); + + /** + * @return the namespaceResourceName value. + */ + String namespaceResourceName(); + + /** + * @return the namespaceType value. + */ + NamespaceType namespaceType(); + + /** + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * @return the scaleUnit value. + */ + String scaleUnit(); + + /** + * @return the serviceBusEndpoint value. + */ + String serviceBusEndpoint(); + + /** + * @return the sku value. + */ + Sku sku(); + + /** + * @return the status value. + */ + String status(); + + /** + * @return the subscriptionId value. + */ + String subscriptionId(); + + /** + * The entirety of the NamespaceResource definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithGroup, DefinitionStages.WithCreate { + } + + /** + * Grouping of NamespaceResource definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a NamespaceResource definition. + */ + interface Blank extends GroupableResourceCore.DefinitionWithRegion { + } + + /** + * The stage of the NamespaceResource definition allowing to specify the resource group. + */ + interface WithGroup extends GroupableResourceCore.DefinitionStages.WithGroup { + } + + /** + * The stage of the namespaceresource definition allowing to specify CreatedAt. + */ + interface WithCreatedAt { + /** + * Specifies createdAt. + * @param createdAt The time the namespace was created + * @return the next definition stage + */ + WithCreate withCreatedAt(DateTime createdAt); + } + + /** + * The stage of the namespaceresource definition allowing to specify Critical. + */ + interface WithCritical { + /** + * Specifies critical. + * @param critical Whether or not the namespace is set as Critical + * @return the next definition stage + */ + WithCreate withCritical(Boolean critical); + } + + /** + * The stage of the namespaceresource definition allowing to specify Enabled. + */ + interface WithEnabled { + /** + * Specifies enabled. + * @param enabled Whether or not the namespace is currently enabled + * @return the next definition stage + */ + WithCreate withEnabled(Boolean enabled); + } + + /** + * The stage of the namespaceresource definition allowing to specify NamespaceCreateOrUpdateParametersName. + */ + interface WithNamespaceCreateOrUpdateParametersName { + /** + * Specifies namespaceCreateOrUpdateParametersName. + * @param namespaceCreateOrUpdateParametersName The name of the namespace + * @return the next definition stage + */ + WithCreate withNamespaceCreateOrUpdateParametersName(String namespaceCreateOrUpdateParametersName); + } + + /** + * The stage of the namespaceresource definition allowing to specify NamespaceType. + */ + interface WithNamespaceType { + /** + * Specifies namespaceType. + * @param namespaceType The namespace type. Possible values include: 'Messaging', 'NotificationHub' + * @return the next definition stage + */ + WithCreate withNamespaceType(NamespaceType namespaceType); + } + + /** + * The stage of the namespaceresource definition allowing to specify ProvisioningState. + */ + interface WithProvisioningState { + /** + * Specifies provisioningState. + * @param provisioningState Provisioning state of the Namespace + * @return the next definition stage + */ + WithCreate withProvisioningState(String provisioningState); + } + + /** + * The stage of the namespaceresource definition allowing to specify ScaleUnit. + */ + interface WithScaleUnit { + /** + * Specifies scaleUnit. + * @param scaleUnit ScaleUnit where the namespace gets created + * @return the next definition stage + */ + WithCreate withScaleUnit(String scaleUnit); + } + + /** + * The stage of the namespaceresource definition allowing to specify ServiceBusEndpoint. + */ + interface WithServiceBusEndpoint { + /** + * Specifies serviceBusEndpoint. + * @param serviceBusEndpoint Endpoint you can use to perform NotificationHub operations + * @return the next definition stage + */ + WithCreate withServiceBusEndpoint(String serviceBusEndpoint); + } + + /** + * The stage of the namespaceresource definition allowing to specify Sku. + */ + interface WithSku { + /** + * Specifies sku. + * @param sku The sku of the created namespace + * @return the next definition stage + */ + WithCreate withSku(Sku sku); + } + + /** + * The stage of the namespaceresource definition allowing to specify Status. + */ + interface WithStatus { + /** + * Specifies status. + * @param status Status of the namespace. It can be any of these values:1 = Created/Active2 = Creating3 = Suspended4 = Deleting + * @return the next definition stage + */ + WithCreate withStatus(String status); + } + + /** + * The stage of the namespaceresource definition allowing to specify SubscriptionId. + */ + interface WithSubscriptionId { + /** + * Specifies subscriptionId. + * @param subscriptionId The Id of the Azure subscription associated with the namespace + * @return the next definition stage + */ + WithCreate withSubscriptionId(String subscriptionId); + } + + /** + * 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.WithCreatedAt, DefinitionStages.WithCritical, DefinitionStages.WithEnabled, DefinitionStages.WithNamespaceCreateOrUpdateParametersName, DefinitionStages.WithNamespaceType, DefinitionStages.WithProvisioningState, DefinitionStages.WithScaleUnit, DefinitionStages.WithServiceBusEndpoint, DefinitionStages.WithSku, DefinitionStages.WithStatus, DefinitionStages.WithSubscriptionId { + } + } + /** + * The template for a NamespaceResource update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, Resource.UpdateWithTags, UpdateStages.WithSku { + } + + /** + * Grouping of NamespaceResource update stages. + */ + interface UpdateStages { + /** + * The stage of the namespaceresource update allowing to specify Sku. + */ + interface WithSku { + /** + * Specifies sku. + * @param sku The sku of the created namespace + * @return the next update stage + */ + Update withSku(Sku sku); + } + + } +} diff --git a/notificationhubs/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2016_03_01/NamespaceSharedAccessAuthorizationRuleResource.java b/notificationhubs/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2016_03_01/NamespaceSharedAccessAuthorizationRuleResource.java new file mode 100644 index 000000000000..5545186ed919 --- /dev/null +++ b/notificationhubs/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2016_03_01/NamespaceSharedAccessAuthorizationRuleResource.java @@ -0,0 +1,182 @@ +/** + * 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.notificationhubs.v2016_03_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.notificationhubs.v2016_03_01.implementation.SharedAccessAuthorizationRuleResourceInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.notificationhubs.v2016_03_01.implementation.NotificationHubsManager; +import java.util.Map; +import java.util.List; + +/** + * Type representing NamespaceSharedAccessAuthorizationRuleResource. + */ +public interface NamespaceSharedAccessAuthorizationRuleResource extends HasInner, Indexable, Refreshable, Updatable, HasManager { + /** + * @return the id value. + */ + String id(); + + /** + * @return the location value. + */ + String location(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the rights value. + */ + List rights(); + + /** + * @return the sku value. + */ + Sku sku(); + + /** + * @return the tags value. + */ + Map tags(); + + /** + * @return the type value. + */ + String type(); + + /** + * The entirety of the NamespaceSharedAccessAuthorizationRuleResource definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithNamespace, DefinitionStages.WithLocation, DefinitionStages.WithProperties, DefinitionStages.WithCreate { + } + + /** + * Grouping of NamespaceSharedAccessAuthorizationRuleResource definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a NamespaceSharedAccessAuthorizationRuleResource definition. + */ + interface Blank extends WithNamespace { + } + + /** + * The stage of the namespacesharedaccessauthorizationruleresource definition allowing to specify Namespace. + */ + interface WithNamespace { + /** + * Specifies resourceGroupName, namespaceName. + * @param resourceGroupName The name of the resource group + * @param namespaceName The namespace name + * @return the next definition stage + */ + WithLocation withExistingNamespace(String resourceGroupName, String namespaceName); + } + + /** + * The stage of the namespacesharedaccessauthorizationruleresource definition allowing to specify Location. + */ + interface WithLocation { + /** + * Specifies location. + * @param location Resource location + * @return the next definition stage + */ + WithProperties withLocation(String location); + } + + /** + * The stage of the namespacesharedaccessauthorizationruleresource definition allowing to specify Properties. + */ + interface WithProperties { + /** + * Specifies properties. + * @param properties Properties of the Namespace AuthorizationRules + * @return the next definition stage + */ + WithCreate withProperties(SharedAccessAuthorizationRuleProperties properties); + } + + /** + * The stage of the namespacesharedaccessauthorizationruleresource definition allowing to specify Sku. + */ + interface WithSku { + /** + * Specifies sku. + * @param sku The sku of the created namespace + * @return the next definition stage + */ + WithCreate withSku(Sku sku); + } + + /** + * The stage of the namespacesharedaccessauthorizationruleresource definition allowing to specify Tags. + */ + interface WithTags { + /** + * Specifies tags. + * @param tags Resource tags + * @return the next definition stage + */ + WithCreate withTags(Map tags); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, DefinitionStages.WithSku, DefinitionStages.WithTags { + } + } + /** + * The template for a NamespaceSharedAccessAuthorizationRuleResource update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, UpdateStages.WithSku, UpdateStages.WithTags { + } + + /** + * Grouping of NamespaceSharedAccessAuthorizationRuleResource update stages. + */ + interface UpdateStages { + /** + * The stage of the namespacesharedaccessauthorizationruleresource update allowing to specify Sku. + */ + interface WithSku { + /** + * Specifies sku. + * @param sku The sku of the created namespace + * @return the next update stage + */ + Update withSku(Sku sku); + } + + /** + * The stage of the namespacesharedaccessauthorizationruleresource update allowing to specify Tags. + */ + interface WithTags { + /** + * Specifies tags. + * @param tags Resource tags + * @return the next update stage + */ + Update withTags(Map tags); + } + + } +} diff --git a/notificationhubs/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2016_03_01/NamespaceType.java b/notificationhubs/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2016_03_01/NamespaceType.java new file mode 100644 index 000000000000..08b0e95efd66 --- /dev/null +++ b/notificationhubs/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2016_03_01/NamespaceType.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.notificationhubs.v2016_03_01; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for NamespaceType. + */ +public enum NamespaceType { + /** Enum value Messaging. */ + MESSAGING("Messaging"), + + /** Enum value NotificationHub. */ + NOTIFICATION_HUB("NotificationHub"); + + /** The actual serialized value for a NamespaceType instance. */ + private String value; + + NamespaceType(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a NamespaceType instance. + * + * @param value the serialized value to parse. + * @return the parsed NamespaceType object, or null if unable to parse. + */ + @JsonCreator + public static NamespaceType fromString(String value) { + NamespaceType[] items = NamespaceType.values(); + for (NamespaceType item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/notificationhubs/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2016_03_01/Namespaces.java b/notificationhubs/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2016_03_01/Namespaces.java new file mode 100644 index 000000000000..026bb60b6ba7 --- /dev/null +++ b/notificationhubs/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2016_03_01/Namespaces.java @@ -0,0 +1,97 @@ +/** + * 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.notificationhubs.v2016_03_01; + +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.notificationhubs.v2016_03_01.implementation.NamespacesInner; +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.notificationhubs.v2016_03_01.NamespaceSharedAccessAuthorizationRuleResource; +import rx.Completable; + +/** + * Type representing Namespaces. + */ +public interface Namespaces extends SupportsCreating, SupportsDeletingByResourceGroup, SupportsBatchDeletion, SupportsGettingByResourceGroup, SupportsListingByResourceGroup, SupportsListing, HasInner { + /** + * Begins definition for a new AuthorizationRule resource. + * @param name resource name. + * @return the first stage of the new AuthorizationRule definition. + */ + NamespaceSharedAccessAuthorizationRuleResource.DefinitionStages.Blank defineAuthorizationRule(String name); + + /** + * Checks the availability of the given service namespace across all Azure subscriptions. This is useful because the domain name is created based on the service namespace name. + * + * @param parameters The namespace name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable checkAvailabilityAsync(CheckAvailabilityParameters parameters); + + /** + * Gets an authorization rule for a namespace by name. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name + * @param authorizationRuleName Authorization rule name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAuthorizationRuleAsync(String resourceGroupName, String namespaceName, String authorizationRuleName); + + /** + * Gets the authorization rules for a namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAuthorizationRulesAsync(final String resourceGroupName, final String namespaceName); + + /** + * Deletes a namespace authorization rule. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param authorizationRuleName Authorization Rule Name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable deleteAuthorizationRuleAsync(String resourceGroupName, String namespaceName, String authorizationRuleName); + + /** + * Gets the Primary and Secondary ConnectionStrings to the namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param authorizationRuleName The connection string of the namespace for the specified authorizationRule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listKeysAsync(String resourceGroupName, String namespaceName, String authorizationRuleName); + + /** + * Regenerates the Primary/Secondary Keys to the Namespace Authorization Rule. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param authorizationRuleName The connection string of the namespace for the specified authorizationRule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable regenerateKeysAsync(String resourceGroupName, String namespaceName, String authorizationRuleName); + +} diff --git a/notificationhubs/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2016_03_01/NotificationHubCreateOrUpdateParameters.java b/notificationhubs/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2016_03_01/NotificationHubCreateOrUpdateParameters.java new file mode 100644 index 000000000000..fde1f4233842 --- /dev/null +++ b/notificationhubs/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2016_03_01/NotificationHubCreateOrUpdateParameters.java @@ -0,0 +1,281 @@ +/** + * 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.notificationhubs.v2016_03_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.Resource; + +/** + * Parameters supplied to the CreateOrUpdate NotificationHub operation. + */ +@JsonFlatten +public class NotificationHubCreateOrUpdateParameters extends Resource { + /** + * The NotificationHub name. + */ + @JsonProperty(value = "properties.name") + private String notificationHubCreateOrUpdateParametersName; + + /** + * The RegistrationTtl of the created NotificationHub. + */ + @JsonProperty(value = "properties.registrationTtl") + private String registrationTtl; + + /** + * The AuthorizationRules of the created NotificationHub. + */ + @JsonProperty(value = "properties.authorizationRules") + private List authorizationRules; + + /** + * The ApnsCredential of the created NotificationHub. + */ + @JsonProperty(value = "properties.apnsCredential") + private ApnsCredential apnsCredential; + + /** + * The WnsCredential of the created NotificationHub. + */ + @JsonProperty(value = "properties.wnsCredential") + private WnsCredential wnsCredential; + + /** + * The GcmCredential of the created NotificationHub. + */ + @JsonProperty(value = "properties.gcmCredential") + private GcmCredential gcmCredential; + + /** + * The MpnsCredential of the created NotificationHub. + */ + @JsonProperty(value = "properties.mpnsCredential") + private MpnsCredential mpnsCredential; + + /** + * The AdmCredential of the created NotificationHub. + */ + @JsonProperty(value = "properties.admCredential") + private AdmCredential admCredential; + + /** + * The BaiduCredential of the created NotificationHub. + */ + @JsonProperty(value = "properties.baiduCredential") + private BaiduCredential baiduCredential; + + /** + * The sku of the created namespace. + */ + @JsonProperty(value = "sku") + private Sku sku; + + /** + * Get the NotificationHub name. + * + * @return the notificationHubCreateOrUpdateParametersName value + */ + public String notificationHubCreateOrUpdateParametersName() { + return this.notificationHubCreateOrUpdateParametersName; + } + + /** + * Set the NotificationHub name. + * + * @param notificationHubCreateOrUpdateParametersName the notificationHubCreateOrUpdateParametersName value to set + * @return the NotificationHubCreateOrUpdateParameters object itself. + */ + public NotificationHubCreateOrUpdateParameters withNotificationHubCreateOrUpdateParametersName(String notificationHubCreateOrUpdateParametersName) { + this.notificationHubCreateOrUpdateParametersName = notificationHubCreateOrUpdateParametersName; + return this; + } + + /** + * Get the RegistrationTtl of the created NotificationHub. + * + * @return the registrationTtl value + */ + public String registrationTtl() { + return this.registrationTtl; + } + + /** + * Set the RegistrationTtl of the created NotificationHub. + * + * @param registrationTtl the registrationTtl value to set + * @return the NotificationHubCreateOrUpdateParameters object itself. + */ + public NotificationHubCreateOrUpdateParameters withRegistrationTtl(String registrationTtl) { + this.registrationTtl = registrationTtl; + return this; + } + + /** + * Get the AuthorizationRules of the created NotificationHub. + * + * @return the authorizationRules value + */ + public List authorizationRules() { + return this.authorizationRules; + } + + /** + * Set the AuthorizationRules of the created NotificationHub. + * + * @param authorizationRules the authorizationRules value to set + * @return the NotificationHubCreateOrUpdateParameters object itself. + */ + public NotificationHubCreateOrUpdateParameters withAuthorizationRules(List authorizationRules) { + this.authorizationRules = authorizationRules; + return this; + } + + /** + * Get the ApnsCredential of the created NotificationHub. + * + * @return the apnsCredential value + */ + public ApnsCredential apnsCredential() { + return this.apnsCredential; + } + + /** + * Set the ApnsCredential of the created NotificationHub. + * + * @param apnsCredential the apnsCredential value to set + * @return the NotificationHubCreateOrUpdateParameters object itself. + */ + public NotificationHubCreateOrUpdateParameters withApnsCredential(ApnsCredential apnsCredential) { + this.apnsCredential = apnsCredential; + return this; + } + + /** + * Get the WnsCredential of the created NotificationHub. + * + * @return the wnsCredential value + */ + public WnsCredential wnsCredential() { + return this.wnsCredential; + } + + /** + * Set the WnsCredential of the created NotificationHub. + * + * @param wnsCredential the wnsCredential value to set + * @return the NotificationHubCreateOrUpdateParameters object itself. + */ + public NotificationHubCreateOrUpdateParameters withWnsCredential(WnsCredential wnsCredential) { + this.wnsCredential = wnsCredential; + return this; + } + + /** + * Get the GcmCredential of the created NotificationHub. + * + * @return the gcmCredential value + */ + public GcmCredential gcmCredential() { + return this.gcmCredential; + } + + /** + * Set the GcmCredential of the created NotificationHub. + * + * @param gcmCredential the gcmCredential value to set + * @return the NotificationHubCreateOrUpdateParameters object itself. + */ + public NotificationHubCreateOrUpdateParameters withGcmCredential(GcmCredential gcmCredential) { + this.gcmCredential = gcmCredential; + return this; + } + + /** + * Get the MpnsCredential of the created NotificationHub. + * + * @return the mpnsCredential value + */ + public MpnsCredential mpnsCredential() { + return this.mpnsCredential; + } + + /** + * Set the MpnsCredential of the created NotificationHub. + * + * @param mpnsCredential the mpnsCredential value to set + * @return the NotificationHubCreateOrUpdateParameters object itself. + */ + public NotificationHubCreateOrUpdateParameters withMpnsCredential(MpnsCredential mpnsCredential) { + this.mpnsCredential = mpnsCredential; + return this; + } + + /** + * Get the AdmCredential of the created NotificationHub. + * + * @return the admCredential value + */ + public AdmCredential admCredential() { + return this.admCredential; + } + + /** + * Set the AdmCredential of the created NotificationHub. + * + * @param admCredential the admCredential value to set + * @return the NotificationHubCreateOrUpdateParameters object itself. + */ + public NotificationHubCreateOrUpdateParameters withAdmCredential(AdmCredential admCredential) { + this.admCredential = admCredential; + return this; + } + + /** + * Get the BaiduCredential of the created NotificationHub. + * + * @return the baiduCredential value + */ + public BaiduCredential baiduCredential() { + return this.baiduCredential; + } + + /** + * Set the BaiduCredential of the created NotificationHub. + * + * @param baiduCredential the baiduCredential value to set + * @return the NotificationHubCreateOrUpdateParameters object itself. + */ + public NotificationHubCreateOrUpdateParameters withBaiduCredential(BaiduCredential baiduCredential) { + this.baiduCredential = baiduCredential; + return this; + } + + /** + * Get the sku of the created namespace. + * + * @return the sku value + */ + public Sku sku() { + return this.sku; + } + + /** + * Set the sku of the created namespace. + * + * @param sku the sku value to set + * @return the NotificationHubCreateOrUpdateParameters object itself. + */ + public NotificationHubCreateOrUpdateParameters withSku(Sku sku) { + this.sku = sku; + return this; + } + +} diff --git a/notificationhubs/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2016_03_01/NotificationHubNamespaceSharedAccessAuthorizationRuleResource.java b/notificationhubs/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2016_03_01/NotificationHubNamespaceSharedAccessAuthorizationRuleResource.java new file mode 100644 index 000000000000..1b8fd8b7dc14 --- /dev/null +++ b/notificationhubs/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2016_03_01/NotificationHubNamespaceSharedAccessAuthorizationRuleResource.java @@ -0,0 +1,183 @@ +/** + * 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.notificationhubs.v2016_03_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.notificationhubs.v2016_03_01.implementation.SharedAccessAuthorizationRuleResourceInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.notificationhubs.v2016_03_01.implementation.NotificationHubsManager; +import java.util.Map; +import java.util.List; + +/** + * Type representing NotificationHubNamespaceSharedAccessAuthorizationRuleResource. + */ +public interface NotificationHubNamespaceSharedAccessAuthorizationRuleResource extends HasInner, Indexable, Refreshable, Updatable, HasManager { + /** + * @return the id value. + */ + String id(); + + /** + * @return the location value. + */ + String location(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the rights value. + */ + List rights(); + + /** + * @return the sku value. + */ + Sku sku(); + + /** + * @return the tags value. + */ + Map tags(); + + /** + * @return the type value. + */ + String type(); + + /** + * The entirety of the NotificationHubNamespaceSharedAccessAuthorizationRuleResource definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithNotificationHub, DefinitionStages.WithLocation, DefinitionStages.WithProperties, DefinitionStages.WithCreate { + } + + /** + * Grouping of NotificationHubNamespaceSharedAccessAuthorizationRuleResource definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a NotificationHubNamespaceSharedAccessAuthorizationRuleResource definition. + */ + interface Blank extends WithNotificationHub { + } + + /** + * The stage of the notificationhubnamespacesharedaccessauthorizationruleresource definition allowing to specify NotificationHub. + */ + interface WithNotificationHub { + /** + * Specifies resourceGroupName, namespaceName, notificationHubName. + * @param resourceGroupName The name of the resource group + * @param namespaceName The namespace name + * @param notificationHubName The notification hub name + * @return the next definition stage + */ + WithLocation withExistingNotificationHub(String resourceGroupName, String namespaceName, String notificationHubName); + } + + /** + * The stage of the notificationhubnamespacesharedaccessauthorizationruleresource definition allowing to specify Location. + */ + interface WithLocation { + /** + * Specifies location. + * @param location Resource location + * @return the next definition stage + */ + WithProperties withLocation(String location); + } + + /** + * The stage of the notificationhubnamespacesharedaccessauthorizationruleresource definition allowing to specify Properties. + */ + interface WithProperties { + /** + * Specifies properties. + * @param properties Properties of the Namespace AuthorizationRules + * @return the next definition stage + */ + WithCreate withProperties(SharedAccessAuthorizationRuleProperties properties); + } + + /** + * The stage of the notificationhubnamespacesharedaccessauthorizationruleresource definition allowing to specify Sku. + */ + interface WithSku { + /** + * Specifies sku. + * @param sku The sku of the created namespace + * @return the next definition stage + */ + WithCreate withSku(Sku sku); + } + + /** + * The stage of the notificationhubnamespacesharedaccessauthorizationruleresource definition allowing to specify Tags. + */ + interface WithTags { + /** + * Specifies tags. + * @param tags Resource tags + * @return the next definition stage + */ + WithCreate withTags(Map tags); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, DefinitionStages.WithSku, DefinitionStages.WithTags { + } + } + /** + * The template for a NotificationHubNamespaceSharedAccessAuthorizationRuleResource update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, UpdateStages.WithSku, UpdateStages.WithTags { + } + + /** + * Grouping of NotificationHubNamespaceSharedAccessAuthorizationRuleResource update stages. + */ + interface UpdateStages { + /** + * The stage of the notificationhubnamespacesharedaccessauthorizationruleresource update allowing to specify Sku. + */ + interface WithSku { + /** + * Specifies sku. + * @param sku The sku of the created namespace + * @return the next update stage + */ + Update withSku(Sku sku); + } + + /** + * The stage of the notificationhubnamespacesharedaccessauthorizationruleresource update allowing to specify Tags. + */ + interface WithTags { + /** + * Specifies tags. + * @param tags Resource tags + * @return the next update stage + */ + Update withTags(Map tags); + } + + } +} diff --git a/notificationhubs/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2016_03_01/NotificationHubResource.java b/notificationhubs/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2016_03_01/NotificationHubResource.java new file mode 100644 index 000000000000..33c26b5a6136 --- /dev/null +++ b/notificationhubs/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2016_03_01/NotificationHubResource.java @@ -0,0 +1,426 @@ +/** + * 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.notificationhubs.v2016_03_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.notificationhubs.v2016_03_01.implementation.NotificationHubResourceInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.notificationhubs.v2016_03_01.implementation.NotificationHubsManager; +import java.util.Map; +import java.util.List; + +/** + * Type representing NotificationHubResource. + */ +public interface NotificationHubResource extends HasInner, Indexable, Refreshable, Updatable, HasManager { + /** + * @return the admCredential value. + */ + AdmCredential admCredential(); + + /** + * @return the apnsCredential value. + */ + ApnsCredential apnsCredential(); + + /** + * @return the authorizationRules value. + */ + List authorizationRules(); + + /** + * @return the baiduCredential value. + */ + BaiduCredential baiduCredential(); + + /** + * @return the gcmCredential value. + */ + GcmCredential gcmCredential(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the location value. + */ + String location(); + + /** + * @return the mpnsCredential value. + */ + MpnsCredential mpnsCredential(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the notificationHubResourceName value. + */ + String notificationHubResourceName(); + + /** + * @return the registrationTtl value. + */ + String registrationTtl(); + + /** + * @return the sku value. + */ + Sku sku(); + + /** + * @return the tags value. + */ + Map tags(); + + /** + * @return the type value. + */ + String type(); + + /** + * @return the wnsCredential value. + */ + WnsCredential wnsCredential(); + + /** + * The entirety of the NotificationHubResource definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithNamespace, DefinitionStages.WithLocation, DefinitionStages.WithCreate { + } + + /** + * Grouping of NotificationHubResource definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a NotificationHubResource definition. + */ + interface Blank extends WithNamespace { + } + + /** + * The stage of the notificationhubresource definition allowing to specify Namespace. + */ + interface WithNamespace { + /** + * Specifies resourceGroupName, namespaceName. + * @param resourceGroupName The name of the resource group + * @param namespaceName The namespace name + * @return the next definition stage + */ + WithLocation withExistingNamespace(String resourceGroupName, String namespaceName); + } + + /** + * The stage of the notificationhubresource definition allowing to specify Location. + */ + interface WithLocation { + /** + * Specifies location. + * @param location Resource location + * @return the next definition stage + */ + WithCreate withLocation(String location); + } + + /** + * The stage of the notificationhubresource definition allowing to specify AdmCredential. + */ + interface WithAdmCredential { + /** + * Specifies admCredential. + * @param admCredential The AdmCredential of the created NotificationHub + * @return the next definition stage + */ + WithCreate withAdmCredential(AdmCredential admCredential); + } + + /** + * The stage of the notificationhubresource definition allowing to specify ApnsCredential. + */ + interface WithApnsCredential { + /** + * Specifies apnsCredential. + * @param apnsCredential The ApnsCredential of the created NotificationHub + * @return the next definition stage + */ + WithCreate withApnsCredential(ApnsCredential apnsCredential); + } + + /** + * The stage of the notificationhubresource definition allowing to specify AuthorizationRules. + */ + interface WithAuthorizationRules { + /** + * Specifies authorizationRules. + * @param authorizationRules The AuthorizationRules of the created NotificationHub + * @return the next definition stage + */ + WithCreate withAuthorizationRules(List authorizationRules); + } + + /** + * The stage of the notificationhubresource definition allowing to specify BaiduCredential. + */ + interface WithBaiduCredential { + /** + * Specifies baiduCredential. + * @param baiduCredential The BaiduCredential of the created NotificationHub + * @return the next definition stage + */ + WithCreate withBaiduCredential(BaiduCredential baiduCredential); + } + + /** + * The stage of the notificationhubresource definition allowing to specify GcmCredential. + */ + interface WithGcmCredential { + /** + * Specifies gcmCredential. + * @param gcmCredential The GcmCredential of the created NotificationHub + * @return the next definition stage + */ + WithCreate withGcmCredential(GcmCredential gcmCredential); + } + + /** + * The stage of the notificationhubresource definition allowing to specify MpnsCredential. + */ + interface WithMpnsCredential { + /** + * Specifies mpnsCredential. + * @param mpnsCredential The MpnsCredential of the created NotificationHub + * @return the next definition stage + */ + WithCreate withMpnsCredential(MpnsCredential mpnsCredential); + } + + /** + * The stage of the notificationhubresource definition allowing to specify NotificationHubCreateOrUpdateParametersName. + */ + interface WithNotificationHubCreateOrUpdateParametersName { + /** + * Specifies notificationHubCreateOrUpdateParametersName. + * @param notificationHubCreateOrUpdateParametersName The NotificationHub name + * @return the next definition stage + */ + WithCreate withNotificationHubCreateOrUpdateParametersName(String notificationHubCreateOrUpdateParametersName); + } + + /** + * The stage of the notificationhubresource definition allowing to specify RegistrationTtl. + */ + interface WithRegistrationTtl { + /** + * Specifies registrationTtl. + * @param registrationTtl The RegistrationTtl of the created NotificationHub + * @return the next definition stage + */ + WithCreate withRegistrationTtl(String registrationTtl); + } + + /** + * The stage of the notificationhubresource definition allowing to specify Sku. + */ + interface WithSku { + /** + * Specifies sku. + * @param sku The sku of the created namespace + * @return the next definition stage + */ + WithCreate withSku(Sku sku); + } + + /** + * The stage of the notificationhubresource definition allowing to specify Tags. + */ + interface WithTags { + /** + * Specifies tags. + * @param tags Resource tags + * @return the next definition stage + */ + WithCreate withTags(Map tags); + } + + /** + * The stage of the notificationhubresource definition allowing to specify WnsCredential. + */ + interface WithWnsCredential { + /** + * Specifies wnsCredential. + * @param wnsCredential The WnsCredential of the created NotificationHub + * @return the next definition stage + */ + WithCreate withWnsCredential(WnsCredential wnsCredential); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, DefinitionStages.WithAdmCredential, DefinitionStages.WithApnsCredential, DefinitionStages.WithAuthorizationRules, DefinitionStages.WithBaiduCredential, DefinitionStages.WithGcmCredential, DefinitionStages.WithMpnsCredential, DefinitionStages.WithNotificationHubCreateOrUpdateParametersName, DefinitionStages.WithRegistrationTtl, DefinitionStages.WithSku, DefinitionStages.WithTags, DefinitionStages.WithWnsCredential { + } + } + /** + * The template for a NotificationHubResource update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, UpdateStages.WithAdmCredential, UpdateStages.WithApnsCredential, UpdateStages.WithAuthorizationRules, UpdateStages.WithBaiduCredential, UpdateStages.WithGcmCredential, UpdateStages.WithMpnsCredential, UpdateStages.WithNotificationHubCreateOrUpdateParametersName, UpdateStages.WithRegistrationTtl, UpdateStages.WithSku, UpdateStages.WithTags, UpdateStages.WithWnsCredential { + } + + /** + * Grouping of NotificationHubResource update stages. + */ + interface UpdateStages { + /** + * The stage of the notificationhubresource update allowing to specify AdmCredential. + */ + interface WithAdmCredential { + /** + * Specifies admCredential. + * @param admCredential The AdmCredential of the created NotificationHub + * @return the next update stage + */ + Update withAdmCredential(AdmCredential admCredential); + } + + /** + * The stage of the notificationhubresource update allowing to specify ApnsCredential. + */ + interface WithApnsCredential { + /** + * Specifies apnsCredential. + * @param apnsCredential The ApnsCredential of the created NotificationHub + * @return the next update stage + */ + Update withApnsCredential(ApnsCredential apnsCredential); + } + + /** + * The stage of the notificationhubresource update allowing to specify AuthorizationRules. + */ + interface WithAuthorizationRules { + /** + * Specifies authorizationRules. + * @param authorizationRules The AuthorizationRules of the created NotificationHub + * @return the next update stage + */ + Update withAuthorizationRules(List authorizationRules); + } + + /** + * The stage of the notificationhubresource update allowing to specify BaiduCredential. + */ + interface WithBaiduCredential { + /** + * Specifies baiduCredential. + * @param baiduCredential The BaiduCredential of the created NotificationHub + * @return the next update stage + */ + Update withBaiduCredential(BaiduCredential baiduCredential); + } + + /** + * The stage of the notificationhubresource update allowing to specify GcmCredential. + */ + interface WithGcmCredential { + /** + * Specifies gcmCredential. + * @param gcmCredential The GcmCredential of the created NotificationHub + * @return the next update stage + */ + Update withGcmCredential(GcmCredential gcmCredential); + } + + /** + * The stage of the notificationhubresource update allowing to specify MpnsCredential. + */ + interface WithMpnsCredential { + /** + * Specifies mpnsCredential. + * @param mpnsCredential The MpnsCredential of the created NotificationHub + * @return the next update stage + */ + Update withMpnsCredential(MpnsCredential mpnsCredential); + } + + /** + * The stage of the notificationhubresource update allowing to specify NotificationHubCreateOrUpdateParametersName. + */ + interface WithNotificationHubCreateOrUpdateParametersName { + /** + * Specifies notificationHubCreateOrUpdateParametersName. + * @param notificationHubCreateOrUpdateParametersName The NotificationHub name + * @return the next update stage + */ + Update withNotificationHubCreateOrUpdateParametersName(String notificationHubCreateOrUpdateParametersName); + } + + /** + * The stage of the notificationhubresource update allowing to specify RegistrationTtl. + */ + interface WithRegistrationTtl { + /** + * Specifies registrationTtl. + * @param registrationTtl The RegistrationTtl of the created NotificationHub + * @return the next update stage + */ + Update withRegistrationTtl(String registrationTtl); + } + + /** + * The stage of the notificationhubresource update allowing to specify Sku. + */ + interface WithSku { + /** + * Specifies sku. + * @param sku The sku of the created namespace + * @return the next update stage + */ + Update withSku(Sku sku); + } + + /** + * The stage of the notificationhubresource update allowing to specify Tags. + */ + interface WithTags { + /** + * Specifies tags. + * @param tags Resource tags + * @return the next update stage + */ + Update withTags(Map tags); + } + + /** + * The stage of the notificationhubresource update allowing to specify WnsCredential. + */ + interface WithWnsCredential { + /** + * Specifies wnsCredential. + * @param wnsCredential The WnsCredential of the created NotificationHub + * @return the next update stage + */ + Update withWnsCredential(WnsCredential wnsCredential); + } + + } +} diff --git a/notificationhubs/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2016_03_01/NotificationHubs.java b/notificationhubs/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2016_03_01/NotificationHubs.java new file mode 100644 index 000000000000..6583d42136b1 --- /dev/null +++ b/notificationhubs/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2016_03_01/NotificationHubs.java @@ -0,0 +1,142 @@ +/** + * 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.notificationhubs.v2016_03_01; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import rx.Completable; +import rx.Observable; +import com.microsoft.azure.management.notificationhubs.v2016_03_01.implementation.NotificationHubsInner; +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.notificationhubs.v2016_03_01.NotificationHubNamespaceSharedAccessAuthorizationRuleResource; + +/** + * Type representing NotificationHubs. + */ +public interface NotificationHubs extends SupportsCreating, HasInner { + /** + * Begins definition for a new AuthorizationRule resource. + * @param name resource name. + * @return the first stage of the new AuthorizationRule definition. + */ + NotificationHubNamespaceSharedAccessAuthorizationRuleResource.DefinitionStages.Blank defineAuthorizationRule(String name); + + /** + * Lists the PNS Credentials associated with a notification hub . + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param notificationHubName The notification hub name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getPnsCredentialsAsync(String resourceGroupName, String namespaceName, String notificationHubName); + + /** + * Lists the notification hubs associated with a namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param notificationHubName The notification hub name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String namespaceName, String notificationHubName); + + /** + * Lists the notification hubs associated with a namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(final String resourceGroupName, final String namespaceName); + + /** + * Deletes a notification hub associated with a namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param notificationHubName The notification hub name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable deleteAsync(String resourceGroupName, String namespaceName, String notificationHubName); + + /** + * Checks the availability of the given notificationHub in a namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param parameters The notificationHub name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable checkAvailabilityAsync(String resourceGroupName, String namespaceName, CheckAvailabilityParameters parameters); + + /** + * Gets an authorization rule for a NotificationHub by name. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name + * @param notificationHubName The notification hub name. + * @param authorizationRuleName authorization rule name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAuthorizationRuleAsync(String resourceGroupName, String namespaceName, String notificationHubName, String authorizationRuleName); + + /** + * Gets the authorization rules for a NotificationHub. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name + * @param notificationHubName The notification hub name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAuthorizationRulesAsync(final String resourceGroupName, final String namespaceName, final String notificationHubName); + + /** + * Deletes a notificationHub authorization rule. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param notificationHubName The notification hub name. + * @param authorizationRuleName Authorization Rule Name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable deleteAuthorizationRuleAsync(String resourceGroupName, String namespaceName, String notificationHubName, String authorizationRuleName); + + /** + * Gets the Primary and Secondary ConnectionStrings to the NotificationHub. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param notificationHubName The notification hub name. + * @param authorizationRuleName The connection string of the NotificationHub for the specified authorizationRule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listKeysAsync(String resourceGroupName, String namespaceName, String notificationHubName, String authorizationRuleName); + + /** + * Regenerates the Primary/Secondary Keys to the NotificationHub Authorization Rule. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param notificationHubName The notification hub name. + * @param authorizationRuleName The connection string of the NotificationHub for the specified authorizationRule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable regenerateKeysAsync(String resourceGroupName, String namespaceName, String notificationHubName, String authorizationRuleName); + +} diff --git a/notificationhubs/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2016_03_01/PnsCredentialsResource.java b/notificationhubs/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2016_03_01/PnsCredentialsResource.java new file mode 100644 index 000000000000..4ce71231cc1b --- /dev/null +++ b/notificationhubs/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2016_03_01/PnsCredentialsResource.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.notificationhubs.v2016_03_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.notificationhubs.v2016_03_01.implementation.NotificationHubsManager; +import com.microsoft.azure.management.notificationhubs.v2016_03_01.implementation.PnsCredentialsResourceInner; +import java.util.Map; + +/** + * Type representing PnsCredentialsResource. + */ +public interface PnsCredentialsResource extends HasInner, HasManager { + /** + * @return the admCredential value. + */ + AdmCredential admCredential(); + + /** + * @return the apnsCredential value. + */ + ApnsCredential apnsCredential(); + + /** + * @return the baiduCredential value. + */ + BaiduCredential baiduCredential(); + + /** + * @return the gcmCredential value. + */ + GcmCredential gcmCredential(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the location value. + */ + String location(); + + /** + * @return the mpnsCredential value. + */ + MpnsCredential mpnsCredential(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the sku value. + */ + Sku sku(); + + /** + * @return the tags value. + */ + Map tags(); + + /** + * @return the type value. + */ + String type(); + + /** + * @return the wnsCredential value. + */ + WnsCredential wnsCredential(); + +} diff --git a/notificationhubs/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2016_03_01/PolicykeyResource.java b/notificationhubs/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2016_03_01/PolicykeyResource.java new file mode 100644 index 000000000000..70367b235729 --- /dev/null +++ b/notificationhubs/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2016_03_01/PolicykeyResource.java @@ -0,0 +1,45 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.notificationhubs.v2016_03_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Namespace/NotificationHub Regenerate Keys. + */ +public class PolicykeyResource { + /** + * Name of the key that has to be regenerated for the + * Namespace/Notification Hub Authorization Rule. The value can be Primary + * Key/Secondary Key. + */ + @JsonProperty(value = "policyKey") + private String policyKey; + + /** + * Get name of the key that has to be regenerated for the Namespace/Notification Hub Authorization Rule. The value can be Primary Key/Secondary Key. + * + * @return the policyKey value + */ + public String policyKey() { + return this.policyKey; + } + + /** + * Set name of the key that has to be regenerated for the Namespace/Notification Hub Authorization Rule. The value can be Primary Key/Secondary Key. + * + * @param policyKey the policyKey value to set + * @return the PolicykeyResource object itself. + */ + public PolicykeyResource withPolicyKey(String policyKey) { + this.policyKey = policyKey; + return this; + } + +} diff --git a/notificationhubs/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2016_03_01/ResourceListKeys.java b/notificationhubs/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2016_03_01/ResourceListKeys.java new file mode 100644 index 000000000000..0f93caf21d5c --- /dev/null +++ b/notificationhubs/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2016_03_01/ResourceListKeys.java @@ -0,0 +1,45 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.notificationhubs.v2016_03_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.notificationhubs.v2016_03_01.implementation.NotificationHubsManager; +import com.microsoft.azure.management.notificationhubs.v2016_03_01.implementation.ResourceListKeysInner; + +/** + * Type representing ResourceListKeys. + */ +public interface ResourceListKeys extends HasInner, HasManager { + /** + * @return the keyName value. + */ + String keyName(); + + /** + * @return the primaryConnectionString value. + */ + String primaryConnectionString(); + + /** + * @return the primaryKey value. + */ + String primaryKey(); + + /** + * @return the secondaryConnectionString value. + */ + String secondaryConnectionString(); + + /** + * @return the secondaryKey value. + */ + String secondaryKey(); + +} diff --git a/notificationhubs/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2016_03_01/SharedAccessAuthorizationRuleCreateOrUpdateParameters.java b/notificationhubs/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2016_03_01/SharedAccessAuthorizationRuleCreateOrUpdateParameters.java new file mode 100644 index 000000000000..91f8c40aade4 --- /dev/null +++ b/notificationhubs/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2016_03_01/SharedAccessAuthorizationRuleCreateOrUpdateParameters.java @@ -0,0 +1,70 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.notificationhubs.v2016_03_01; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.azure.Resource; + +/** + * Parameters supplied to the CreateOrUpdate Namespace AuthorizationRules. + */ +public class SharedAccessAuthorizationRuleCreateOrUpdateParameters extends Resource { + /** + * Properties of the Namespace AuthorizationRules. + */ + @JsonProperty(value = "properties", required = true) + private SharedAccessAuthorizationRuleProperties properties; + + /** + * The sku of the created namespace. + */ + @JsonProperty(value = "sku") + private Sku sku; + + /** + * Get properties of the Namespace AuthorizationRules. + * + * @return the properties value + */ + public SharedAccessAuthorizationRuleProperties properties() { + return this.properties; + } + + /** + * Set properties of the Namespace AuthorizationRules. + * + * @param properties the properties value to set + * @return the SharedAccessAuthorizationRuleCreateOrUpdateParameters object itself. + */ + public SharedAccessAuthorizationRuleCreateOrUpdateParameters withProperties(SharedAccessAuthorizationRuleProperties properties) { + this.properties = properties; + return this; + } + + /** + * Get the sku of the created namespace. + * + * @return the sku value + */ + public Sku sku() { + return this.sku; + } + + /** + * Set the sku of the created namespace. + * + * @param sku the sku value to set + * @return the SharedAccessAuthorizationRuleCreateOrUpdateParameters object itself. + */ + public SharedAccessAuthorizationRuleCreateOrUpdateParameters withSku(Sku sku) { + this.sku = sku; + return this; + } + +} diff --git a/notificationhubs/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2016_03_01/SharedAccessAuthorizationRuleProperties.java b/notificationhubs/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2016_03_01/SharedAccessAuthorizationRuleProperties.java new file mode 100644 index 000000000000..9f241953cb9a --- /dev/null +++ b/notificationhubs/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2016_03_01/SharedAccessAuthorizationRuleProperties.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.notificationhubs.v2016_03_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * SharedAccessAuthorizationRule properties. + */ +public class SharedAccessAuthorizationRuleProperties { + /** + * The rights associated with the rule. + */ + @JsonProperty(value = "rights") + private List rights; + + /** + * Get the rights associated with the rule. + * + * @return the rights value + */ + public List rights() { + return this.rights; + } + + /** + * Set the rights associated with the rule. + * + * @param rights the rights value to set + * @return the SharedAccessAuthorizationRuleProperties object itself. + */ + public SharedAccessAuthorizationRuleProperties withRights(List rights) { + this.rights = rights; + return this; + } + +} diff --git a/notificationhubs/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2016_03_01/Sku.java b/notificationhubs/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2016_03_01/Sku.java new file mode 100644 index 000000000000..66bd4294d24b --- /dev/null +++ b/notificationhubs/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2016_03_01/Sku.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.notificationhubs.v2016_03_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The Sku description for a namespace. + */ +public class Sku { + /** + * Name of the notification hub sku. Possible values include: 'Free', + * 'Basic', 'Standard'. + */ + @JsonProperty(value = "name", required = true) + private SkuName name; + + /** + * The tier of particular sku. + */ + @JsonProperty(value = "tier") + private String tier; + + /** + * The Sku size. + */ + @JsonProperty(value = "size") + private String size; + + /** + * The Sku Family. + */ + @JsonProperty(value = "family") + private String family; + + /** + * The capacity of the resource. + */ + @JsonProperty(value = "capacity") + private Integer capacity; + + /** + * Get name of the notification hub sku. Possible values include: 'Free', 'Basic', 'Standard'. + * + * @return the name value + */ + public SkuName name() { + return this.name; + } + + /** + * Set name of the notification hub sku. Possible values include: 'Free', 'Basic', 'Standard'. + * + * @param name the name value to set + * @return the Sku object itself. + */ + public Sku withName(SkuName name) { + this.name = name; + return this; + } + + /** + * Get the tier of particular sku. + * + * @return the tier value + */ + public String tier() { + return this.tier; + } + + /** + * Set the tier of particular sku. + * + * @param tier the tier value to set + * @return the Sku object itself. + */ + public Sku withTier(String tier) { + this.tier = tier; + return this; + } + + /** + * Get the Sku size. + * + * @return the size value + */ + public String size() { + return this.size; + } + + /** + * Set the Sku size. + * + * @param size the size value to set + * @return the Sku object itself. + */ + public Sku withSize(String size) { + this.size = size; + return this; + } + + /** + * Get the Sku Family. + * + * @return the family value + */ + public String family() { + return this.family; + } + + /** + * Set the Sku Family. + * + * @param family the family value to set + * @return the Sku object itself. + */ + public Sku withFamily(String family) { + this.family = family; + return this; + } + + /** + * Get the capacity of the resource. + * + * @return the capacity value + */ + public Integer capacity() { + return this.capacity; + } + + /** + * Set the capacity of the resource. + * + * @param capacity the capacity value to set + * @return the Sku object itself. + */ + public Sku withCapacity(Integer capacity) { + this.capacity = capacity; + return this; + } + +} diff --git a/notificationhubs/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2016_03_01/SkuName.java b/notificationhubs/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2016_03_01/SkuName.java new file mode 100644 index 000000000000..5b81ec73258a --- /dev/null +++ b/notificationhubs/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2016_03_01/SkuName.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.notificationhubs.v2016_03_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for SkuName. + */ +public final class SkuName extends ExpandableStringEnum { + /** Static value Free for SkuName. */ + public static final SkuName FREE = fromString("Free"); + + /** Static value Basic for SkuName. */ + public static final SkuName BASIC = fromString("Basic"); + + /** Static value Standard for SkuName. */ + public static final SkuName STANDARD = fromString("Standard"); + + /** + * Creates or finds a SkuName from its string representation. + * @param name a name to look for + * @return the corresponding SkuName + */ + @JsonCreator + public static SkuName fromString(String name) { + return fromString(name, SkuName.class); + } + + /** + * @return known SkuName values + */ + public static Collection values() { + return values(SkuName.class); + } +} diff --git a/notificationhubs/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2016_03_01/WnsCredential.java b/notificationhubs/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2016_03_01/WnsCredential.java new file mode 100644 index 000000000000..d5e07d3aafab --- /dev/null +++ b/notificationhubs/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2016_03_01/WnsCredential.java @@ -0,0 +1,97 @@ +/** + * 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.notificationhubs.v2016_03_01; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * Description of a NotificationHub WnsCredential. + */ +@JsonFlatten +public class WnsCredential { + /** + * The package ID for this credential. + */ + @JsonProperty(value = "properties.packageSid") + private String packageSid; + + /** + * The secret key. + */ + @JsonProperty(value = "properties.secretKey") + private String secretKey; + + /** + * The Windows Live endpoint. + */ + @JsonProperty(value = "properties.windowsLiveEndpoint") + private String windowsLiveEndpoint; + + /** + * Get the package ID for this credential. + * + * @return the packageSid value + */ + public String packageSid() { + return this.packageSid; + } + + /** + * Set the package ID for this credential. + * + * @param packageSid the packageSid value to set + * @return the WnsCredential object itself. + */ + public WnsCredential withPackageSid(String packageSid) { + this.packageSid = packageSid; + return this; + } + + /** + * Get the secret key. + * + * @return the secretKey value + */ + public String secretKey() { + return this.secretKey; + } + + /** + * Set the secret key. + * + * @param secretKey the secretKey value to set + * @return the WnsCredential object itself. + */ + public WnsCredential withSecretKey(String secretKey) { + this.secretKey = secretKey; + return this; + } + + /** + * Get the Windows Live endpoint. + * + * @return the windowsLiveEndpoint value + */ + public String windowsLiveEndpoint() { + return this.windowsLiveEndpoint; + } + + /** + * Set the Windows Live endpoint. + * + * @param windowsLiveEndpoint the windowsLiveEndpoint value to set + * @return the WnsCredential object itself. + */ + public WnsCredential withWindowsLiveEndpoint(String windowsLiveEndpoint) { + this.windowsLiveEndpoint = windowsLiveEndpoint; + return this; + } + +} diff --git a/notificationhubs/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2016_03_01/implementation/CheckAvailabilityResultImpl.java b/notificationhubs/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2016_03_01/implementation/CheckAvailabilityResultImpl.java new file mode 100644 index 000000000000..2f82b7fce8f3 --- /dev/null +++ b/notificationhubs/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2016_03_01/implementation/CheckAvailabilityResultImpl.java @@ -0,0 +1,63 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.notificationhubs.v2016_03_01.implementation; + +import com.microsoft.azure.management.notificationhubs.v2016_03_01.CheckAvailabilityResult; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.notificationhubs.v2016_03_01.Sku; +import java.util.Map; + +class CheckAvailabilityResultImpl extends WrapperImpl implements CheckAvailabilityResult { + private final NotificationHubsManager manager; + CheckAvailabilityResultImpl(CheckAvailabilityResultInner inner, NotificationHubsManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public NotificationHubsManager manager() { + return this.manager; + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public Boolean isAvailiable() { + return this.inner().isAvailiable(); + } + + @Override + public String location() { + return this.inner().location(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public Sku sku() { + return this.inner().sku(); + } + + @Override + public Map tags() { + return this.inner().getTags(); + } + + @Override + public String type() { + return this.inner().type(); + } + +} diff --git a/notificationhubs/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2016_03_01/implementation/CheckAvailabilityResultInner.java b/notificationhubs/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2016_03_01/implementation/CheckAvailabilityResultInner.java new file mode 100644 index 000000000000..979fed683288 --- /dev/null +++ b/notificationhubs/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2016_03_01/implementation/CheckAvailabilityResultInner.java @@ -0,0 +1,72 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.notificationhubs.v2016_03_01.implementation; + +import com.microsoft.azure.management.notificationhubs.v2016_03_01.Sku; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.azure.Resource; + +/** + * Description of a CheckAvailibility resource. + */ +public class CheckAvailabilityResultInner extends Resource { + /** + * True if the name is available and can be used to create new + * Namespace/NotificationHub. Otherwise false. + */ + @JsonProperty(value = "isAvailiable") + private Boolean isAvailiable; + + /** + * The sku of the created namespace. + */ + @JsonProperty(value = "sku") + private Sku sku; + + /** + * Get true if the name is available and can be used to create new Namespace/NotificationHub. Otherwise false. + * + * @return the isAvailiable value + */ + public Boolean isAvailiable() { + return this.isAvailiable; + } + + /** + * Set true if the name is available and can be used to create new Namespace/NotificationHub. Otherwise false. + * + * @param isAvailiable the isAvailiable value to set + * @return the CheckAvailabilityResultInner object itself. + */ + public CheckAvailabilityResultInner withIsAvailiable(Boolean isAvailiable) { + this.isAvailiable = isAvailiable; + return this; + } + + /** + * Get the sku of the created namespace. + * + * @return the sku value + */ + public Sku sku() { + return this.sku; + } + + /** + * Set the sku of the created namespace. + * + * @param sku the sku value to set + * @return the CheckAvailabilityResultInner object itself. + */ + public CheckAvailabilityResultInner withSku(Sku sku) { + this.sku = sku; + return this; + } + +} diff --git a/notificationhubs/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2016_03_01/implementation/IdParsingUtils.java b/notificationhubs/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2016_03_01/implementation/IdParsingUtils.java new file mode 100644 index 000000000000..fcc80df14750 --- /dev/null +++ b/notificationhubs/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2016_03_01/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.notificationhubs.v2016_03_01.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/notificationhubs/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2016_03_01/implementation/NamespaceResourceImpl.java b/notificationhubs/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2016_03_01/implementation/NamespaceResourceImpl.java new file mode 100644 index 000000000000..4a37d24faade --- /dev/null +++ b/notificationhubs/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2016_03_01/implementation/NamespaceResourceImpl.java @@ -0,0 +1,201 @@ +/** + * 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.notificationhubs.v2016_03_01.implementation; + +import com.microsoft.azure.arm.resources.models.implementation.GroupableResourceCoreImpl; +import com.microsoft.azure.management.notificationhubs.v2016_03_01.NamespaceResource; +import rx.Observable; +import com.microsoft.azure.management.notificationhubs.v2016_03_01.NamespacePatchParameters; +import com.microsoft.azure.management.notificationhubs.v2016_03_01.NamespaceCreateOrUpdateParameters; +import org.joda.time.DateTime; +import com.microsoft.azure.management.notificationhubs.v2016_03_01.NamespaceType; +import com.microsoft.azure.management.notificationhubs.v2016_03_01.Sku; +import rx.functions.Func1; + +class NamespaceResourceImpl extends GroupableResourceCoreImpl implements NamespaceResource, NamespaceResource.Definition, NamespaceResource.Update { + private NamespaceCreateOrUpdateParameters createParameter; + private NamespacePatchParameters updateParameter; + NamespaceResourceImpl(String name, NamespaceResourceInner inner, NotificationHubsManager manager) { + super(name, inner, manager); + this.createParameter = new NamespaceCreateOrUpdateParameters(); + this.updateParameter = new NamespacePatchParameters(); + } + + @Override + public Observable createResourceAsync() { + NamespacesInner client = this.manager().inner().namespaces(); + this.createParameter.withLocation(inner().location()); + this.createParameter.withTags(inner().getTags()); + return client.createOrUpdateAsync(this.resourceGroupName(), this.name(), this.createParameter) + .map(new Func1() { + @Override + public NamespaceResourceInner call(NamespaceResourceInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + NamespacesInner client = this.manager().inner().namespaces(); + return client.patchAsync(this.resourceGroupName(), this.name(), this.updateParameter) + .map(new Func1() { + @Override + public NamespaceResourceInner call(NamespaceResourceInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + NamespacesInner client = this.manager().inner().namespaces(); + return client.getByResourceGroupAsync(this.resourceGroupName(), this.name()); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + private void resetCreateUpdateParameters() { + this.createParameter = new NamespaceCreateOrUpdateParameters(); + this.updateParameter = new NamespacePatchParameters(); + } + + @Override + public DateTime createdAt() { + return this.inner().createdAt(); + } + + @Override + public Boolean critical() { + return this.inner().critical(); + } + + @Override + public Boolean enabled() { + return this.inner().enabled(); + } + + @Override + public String namespaceResourceName() { + return this.inner().namespaceResourceName(); + } + + @Override + public NamespaceType namespaceType() { + return this.inner().namespaceType(); + } + + @Override + public String provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public String scaleUnit() { + return this.inner().scaleUnit(); + } + + @Override + public String serviceBusEndpoint() { + return this.inner().serviceBusEndpoint(); + } + + @Override + public Sku sku() { + return this.inner().sku(); + } + + @Override + public String status() { + return this.inner().status(); + } + + @Override + public String subscriptionId() { + return this.inner().subscriptionId(); + } + + @Override + public NamespaceResourceImpl withCreatedAt(DateTime createdAt) { + this.createParameter.withCreatedAt(createdAt); + return this; + } + + @Override + public NamespaceResourceImpl withCritical(Boolean critical) { + this.createParameter.withCritical(critical); + return this; + } + + @Override + public NamespaceResourceImpl withEnabled(Boolean enabled) { + this.createParameter.withEnabled(enabled); + return this; + } + + @Override + public NamespaceResourceImpl withNamespaceCreateOrUpdateParametersName(String namespaceCreateOrUpdateParametersName) { + this.createParameter.withNamespaceCreateOrUpdateParametersName(namespaceCreateOrUpdateParametersName); + return this; + } + + @Override + public NamespaceResourceImpl withNamespaceType(NamespaceType namespaceType) { + this.createParameter.withNamespaceType(namespaceType); + return this; + } + + @Override + public NamespaceResourceImpl withProvisioningState(String provisioningState) { + this.createParameter.withProvisioningState(provisioningState); + return this; + } + + @Override + public NamespaceResourceImpl withScaleUnit(String scaleUnit) { + this.createParameter.withScaleUnit(scaleUnit); + return this; + } + + @Override + public NamespaceResourceImpl withServiceBusEndpoint(String serviceBusEndpoint) { + this.createParameter.withServiceBusEndpoint(serviceBusEndpoint); + return this; + } + + @Override + public NamespaceResourceImpl withStatus(String status) { + this.createParameter.withStatus(status); + return this; + } + + @Override + public NamespaceResourceImpl withSubscriptionId(String subscriptionId) { + this.createParameter.withSubscriptionId(subscriptionId); + return this; + } + + @Override + public NamespaceResourceImpl withSku(Sku sku) { + if (isInCreateMode()) { + this.createParameter.withSku(sku); + } else { + this.updateParameter.withSku(sku); + } + return this; + } + +} diff --git a/notificationhubs/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2016_03_01/implementation/NamespaceResourceInner.java b/notificationhubs/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2016_03_01/implementation/NamespaceResourceInner.java new file mode 100644 index 000000000000..52aa12e268b5 --- /dev/null +++ b/notificationhubs/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2016_03_01/implementation/NamespaceResourceInner.java @@ -0,0 +1,341 @@ +/** + * 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.notificationhubs.v2016_03_01.implementation; + +import org.joda.time.DateTime; +import com.microsoft.azure.management.notificationhubs.v2016_03_01.NamespaceType; +import com.microsoft.azure.management.notificationhubs.v2016_03_01.Sku; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.Resource; + +/** + * Description of a Namespace resource. + */ +@JsonFlatten +public class NamespaceResourceInner extends Resource { + /** + * The name of the namespace. + */ + @JsonProperty(value = "properties.name") + private String namespaceResourceName; + + /** + * Provisioning state of the Namespace. + */ + @JsonProperty(value = "properties.provisioningState") + private String provisioningState; + + /** + * Specifies the targeted region in which the namespace should be created. + * It can be any of the following values: Australia EastAustralia + * SoutheastCentral USEast USEast US 2West USNorth Central USSouth Central + * USEast AsiaSoutheast AsiaBrazil SouthJapan EastJapan WestNorth + * EuropeWest Europe. + */ + @JsonProperty(value = "properties.region") + private String region; + + /** + * Status of the namespace. It can be any of these values:1 = + * Created/Active2 = Creating3 = Suspended4 = Deleting. + */ + @JsonProperty(value = "properties.status") + private String status; + + /** + * The time the namespace was created. + */ + @JsonProperty(value = "properties.createdAt") + private DateTime createdAt; + + /** + * Endpoint you can use to perform NotificationHub operations. + */ + @JsonProperty(value = "properties.serviceBusEndpoint") + private String serviceBusEndpoint; + + /** + * The Id of the Azure subscription associated with the namespace. + */ + @JsonProperty(value = "properties.subscriptionId") + private String subscriptionId; + + /** + * ScaleUnit where the namespace gets created. + */ + @JsonProperty(value = "properties.scaleUnit") + private String scaleUnit; + + /** + * Whether or not the namespace is currently enabled. + */ + @JsonProperty(value = "properties.enabled") + private Boolean enabled; + + /** + * Whether or not the namespace is set as Critical. + */ + @JsonProperty(value = "properties.critical") + private Boolean critical; + + /** + * The namespace type. Possible values include: 'Messaging', + * 'NotificationHub'. + */ + @JsonProperty(value = "properties.namespaceType") + private NamespaceType namespaceType; + + /** + * The sku of the created namespace. + */ + @JsonProperty(value = "sku") + private Sku sku; + + /** + * Get the name of the namespace. + * + * @return the namespaceResourceName value + */ + public String namespaceResourceName() { + return this.namespaceResourceName; + } + + /** + * Set the name of the namespace. + * + * @param namespaceResourceName the namespaceResourceName value to set + * @return the NamespaceResourceInner object itself. + */ + public NamespaceResourceInner withNamespaceResourceName(String namespaceResourceName) { + this.namespaceResourceName = namespaceResourceName; + return this; + } + + /** + * Get provisioning state of the Namespace. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Set provisioning state of the Namespace. + * + * @param provisioningState the provisioningState value to set + * @return the NamespaceResourceInner object itself. + */ + public NamespaceResourceInner withProvisioningState(String provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * Get specifies the targeted region in which the namespace should be created. It can be any of the following values: Australia EastAustralia SoutheastCentral USEast USEast US 2West USNorth Central USSouth Central USEast AsiaSoutheast AsiaBrazil SouthJapan EastJapan WestNorth EuropeWest Europe. + * + * @return the region value + */ + public String region() { + return this.region; + } + + /** + * Set specifies the targeted region in which the namespace should be created. It can be any of the following values: Australia EastAustralia SoutheastCentral USEast USEast US 2West USNorth Central USSouth Central USEast AsiaSoutheast AsiaBrazil SouthJapan EastJapan WestNorth EuropeWest Europe. + * + * @param region the region value to set + * @return the NamespaceResourceInner object itself. + */ + public NamespaceResourceInner withRegion(String region) { + this.region = region; + return this; + } + + /** + * Get status of the namespace. It can be any of these values:1 = Created/Active2 = Creating3 = Suspended4 = Deleting. + * + * @return the status value + */ + public String status() { + return this.status; + } + + /** + * Set status of the namespace. It can be any of these values:1 = Created/Active2 = Creating3 = Suspended4 = Deleting. + * + * @param status the status value to set + * @return the NamespaceResourceInner object itself. + */ + public NamespaceResourceInner withStatus(String status) { + this.status = status; + return this; + } + + /** + * Get the time the namespace was created. + * + * @return the createdAt value + */ + public DateTime createdAt() { + return this.createdAt; + } + + /** + * Set the time the namespace was created. + * + * @param createdAt the createdAt value to set + * @return the NamespaceResourceInner object itself. + */ + public NamespaceResourceInner withCreatedAt(DateTime createdAt) { + this.createdAt = createdAt; + return this; + } + + /** + * Get endpoint you can use to perform NotificationHub operations. + * + * @return the serviceBusEndpoint value + */ + public String serviceBusEndpoint() { + return this.serviceBusEndpoint; + } + + /** + * Set endpoint you can use to perform NotificationHub operations. + * + * @param serviceBusEndpoint the serviceBusEndpoint value to set + * @return the NamespaceResourceInner object itself. + */ + public NamespaceResourceInner withServiceBusEndpoint(String serviceBusEndpoint) { + this.serviceBusEndpoint = serviceBusEndpoint; + return this; + } + + /** + * Get the Id of the Azure subscription associated with the namespace. + * + * @return the subscriptionId value + */ + public String subscriptionId() { + return this.subscriptionId; + } + + /** + * Set the Id of the Azure subscription associated with the namespace. + * + * @param subscriptionId the subscriptionId value to set + * @return the NamespaceResourceInner object itself. + */ + public NamespaceResourceInner withSubscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; + return this; + } + + /** + * Get scaleUnit where the namespace gets created. + * + * @return the scaleUnit value + */ + public String scaleUnit() { + return this.scaleUnit; + } + + /** + * Set scaleUnit where the namespace gets created. + * + * @param scaleUnit the scaleUnit value to set + * @return the NamespaceResourceInner object itself. + */ + public NamespaceResourceInner withScaleUnit(String scaleUnit) { + this.scaleUnit = scaleUnit; + return this; + } + + /** + * Get whether or not the namespace is currently enabled. + * + * @return the enabled value + */ + public Boolean enabled() { + return this.enabled; + } + + /** + * Set whether or not the namespace is currently enabled. + * + * @param enabled the enabled value to set + * @return the NamespaceResourceInner object itself. + */ + public NamespaceResourceInner withEnabled(Boolean enabled) { + this.enabled = enabled; + return this; + } + + /** + * Get whether or not the namespace is set as Critical. + * + * @return the critical value + */ + public Boolean critical() { + return this.critical; + } + + /** + * Set whether or not the namespace is set as Critical. + * + * @param critical the critical value to set + * @return the NamespaceResourceInner object itself. + */ + public NamespaceResourceInner withCritical(Boolean critical) { + this.critical = critical; + return this; + } + + /** + * Get the namespace type. Possible values include: 'Messaging', 'NotificationHub'. + * + * @return the namespaceType value + */ + public NamespaceType namespaceType() { + return this.namespaceType; + } + + /** + * Set the namespace type. Possible values include: 'Messaging', 'NotificationHub'. + * + * @param namespaceType the namespaceType value to set + * @return the NamespaceResourceInner object itself. + */ + public NamespaceResourceInner withNamespaceType(NamespaceType namespaceType) { + this.namespaceType = namespaceType; + return this; + } + + /** + * Get the sku of the created namespace. + * + * @return the sku value + */ + public Sku sku() { + return this.sku; + } + + /** + * Set the sku of the created namespace. + * + * @param sku the sku value to set + * @return the NamespaceResourceInner object itself. + */ + public NamespaceResourceInner withSku(Sku sku) { + this.sku = sku; + return this; + } + +} diff --git a/notificationhubs/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2016_03_01/implementation/NamespaceSharedAccessAuthorizationRuleResourceImpl.java b/notificationhubs/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2016_03_01/implementation/NamespaceSharedAccessAuthorizationRuleResourceImpl.java new file mode 100644 index 000000000000..59750521a20b --- /dev/null +++ b/notificationhubs/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2016_03_01/implementation/NamespaceSharedAccessAuthorizationRuleResourceImpl.java @@ -0,0 +1,165 @@ +/** + * 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.notificationhubs.v2016_03_01.implementation; + +import com.microsoft.azure.management.notificationhubs.v2016_03_01.NamespaceSharedAccessAuthorizationRuleResource; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import com.microsoft.azure.management.notificationhubs.v2016_03_01.SharedAccessAuthorizationRuleCreateOrUpdateParameters; +import java.util.Map; +import java.util.List; +import com.microsoft.azure.management.notificationhubs.v2016_03_01.AccessRights; +import com.microsoft.azure.management.notificationhubs.v2016_03_01.Sku; +import com.microsoft.azure.management.notificationhubs.v2016_03_01.SharedAccessAuthorizationRuleProperties; +import rx.functions.Func1; + +class NamespaceSharedAccessAuthorizationRuleResourceImpl extends CreatableUpdatableImpl implements NamespaceSharedAccessAuthorizationRuleResource, NamespaceSharedAccessAuthorizationRuleResource.Definition, NamespaceSharedAccessAuthorizationRuleResource.Update { + private final NotificationHubsManager manager; + private String resourceGroupName; + private String namespaceName; + private String authorizationRuleName; + private SharedAccessAuthorizationRuleCreateOrUpdateParameters createOrUpdateParameter; + + NamespaceSharedAccessAuthorizationRuleResourceImpl(String name, NotificationHubsManager manager) { + super(name, new SharedAccessAuthorizationRuleResourceInner()); + this.manager = manager; + // Set resource name + this.authorizationRuleName = name; + // + this.createOrUpdateParameter = new SharedAccessAuthorizationRuleCreateOrUpdateParameters(); + } + + NamespaceSharedAccessAuthorizationRuleResourceImpl(SharedAccessAuthorizationRuleResourceInner inner, NotificationHubsManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.authorizationRuleName = inner.name(); + // resource ancestor names + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.namespaceName = IdParsingUtils.getValueFromIdByName(inner.id(), "namespaces"); + this.authorizationRuleName = IdParsingUtils.getValueFromIdByName(inner.id(), "AuthorizationRules"); + // + this.createOrUpdateParameter = new SharedAccessAuthorizationRuleCreateOrUpdateParameters(); + } + + @Override + public NotificationHubsManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + NamespacesInner client = this.manager().inner().namespaces(); + return client.createOrUpdateAuthorizationRuleAsync(this.resourceGroupName, this.namespaceName, this.authorizationRuleName, this.createOrUpdateParameter) + .map(new Func1() { + @Override + public SharedAccessAuthorizationRuleResourceInner call(SharedAccessAuthorizationRuleResourceInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + NamespacesInner client = this.manager().inner().namespaces(); + return client.createOrUpdateAuthorizationRuleAsync(this.resourceGroupName, this.namespaceName, this.authorizationRuleName, this.createOrUpdateParameter) + .map(new Func1() { + @Override + public SharedAccessAuthorizationRuleResourceInner call(SharedAccessAuthorizationRuleResourceInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + NamespacesInner client = this.manager().inner().namespaces(); + return client.getAuthorizationRuleAsync(this.resourceGroupName, this.namespaceName, this.authorizationRuleName); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + private void resetCreateUpdateParameters() { + this.createOrUpdateParameter = new SharedAccessAuthorizationRuleCreateOrUpdateParameters(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String location() { + return this.inner().location(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public List rights() { + return this.inner().rights(); + } + + @Override + public Sku sku() { + return this.inner().sku(); + } + + @Override + public Map tags() { + return this.inner().getTags(); + } + + @Override + public String type() { + return this.inner().type(); + } + + @Override + public NamespaceSharedAccessAuthorizationRuleResourceImpl withExistingNamespace(String resourceGroupName, String namespaceName) { + this.resourceGroupName = resourceGroupName; + this.namespaceName = namespaceName; + return this; + } + + @Override + public NamespaceSharedAccessAuthorizationRuleResourceImpl withLocation(String location) { + this.createOrUpdateParameter.withLocation(location); + return this; + } + + @Override + public NamespaceSharedAccessAuthorizationRuleResourceImpl withProperties(SharedAccessAuthorizationRuleProperties properties) { + this.createOrUpdateParameter.withProperties(properties); + return this; + } + + @Override + public NamespaceSharedAccessAuthorizationRuleResourceImpl withSku(Sku sku) { + this.createOrUpdateParameter.withSku(sku); + return this; + } + + @Override + public NamespaceSharedAccessAuthorizationRuleResourceImpl withTags(Map tags) { + this.createOrUpdateParameter.withTags(tags); + return this; + } + +} diff --git a/notificationhubs/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2016_03_01/implementation/NamespacesImpl.java b/notificationhubs/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2016_03_01/implementation/NamespacesImpl.java new file mode 100644 index 000000000000..569fbfb3fad2 --- /dev/null +++ b/notificationhubs/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2016_03_01/implementation/NamespacesImpl.java @@ -0,0 +1,235 @@ +/** + * 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.notificationhubs.v2016_03_01.implementation; + +import com.microsoft.azure.arm.resources.collection.implementation.GroupableResourcesCoreImpl; +import com.microsoft.azure.management.notificationhubs.v2016_03_01.Namespaces; +import com.microsoft.azure.management.notificationhubs.v2016_03_01.NamespaceResource; +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.notificationhubs.v2016_03_01.CheckAvailabilityResult; +import com.microsoft.azure.management.notificationhubs.v2016_03_01.CheckAvailabilityParameters; +import com.microsoft.azure.management.notificationhubs.v2016_03_01.NamespaceSharedAccessAuthorizationRuleResource; +import com.microsoft.azure.management.notificationhubs.v2016_03_01.ResourceListKeys; + +class NamespacesImpl extends GroupableResourcesCoreImpl implements Namespaces { + protected NamespacesImpl(NotificationHubsManager manager) { + super(manager.inner().namespaces(), manager); + } + + @Override + protected Observable getInnerAsync(String resourceGroupName, String name) { + NamespacesInner client = this.inner(); + return client.getByResourceGroupAsync(resourceGroupName, name); + } + + @Override + protected Completable deleteInnerAsync(String resourceGroupName, String name) { + NamespacesInner 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) { + NamespacesInner client = this.inner(); + return this.wrapList(client.listByResourceGroup(resourceGroupName)); + } + + @Override + public Observable listByResourceGroupAsync(String resourceGroupName) { + NamespacesInner 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 NamespaceResource call(NamespaceResourceInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public PagedList list() { + NamespacesInner client = this.inner(); + return this.wrapList(client.list()); + } + + @Override + public Observable listAsync() { + NamespacesInner client = this.inner(); + return client.listAsync() + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public NamespaceResource call(NamespaceResourceInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public NamespaceResourceImpl define(String name) { + return wrapModel(name); + } + + @Override + public Observable checkAvailabilityAsync(CheckAvailabilityParameters parameters) { + NamespacesInner client = this.inner(); + return client.checkAvailabilityAsync(parameters) + .map(new Func1() { + @Override + public CheckAvailabilityResult call(CheckAvailabilityResultInner inner) { + return new CheckAvailabilityResultImpl(inner, manager()); + } + }); + } + + @Override + protected NamespaceResourceImpl wrapModel(NamespaceResourceInner inner) { + return new NamespaceResourceImpl(inner.name(), inner, manager()); + } + + @Override + protected NamespaceResourceImpl wrapModel(String name) { + return new NamespaceResourceImpl(name, new NamespaceResourceInner(), this.manager()); + } + + @Override + public NamespaceSharedAccessAuthorizationRuleResourceImpl defineAuthorizationRule(String name) { + return wrapAuthorizationRuleModel(name); + } + + private NamespaceSharedAccessAuthorizationRuleResourceImpl wrapAuthorizationRuleModel(String name) { + return new NamespaceSharedAccessAuthorizationRuleResourceImpl(name, this.manager()); + } + + private NamespaceSharedAccessAuthorizationRuleResourceImpl wrapNamespaceSharedAccessAuthorizationRuleResourceModel(SharedAccessAuthorizationRuleResourceInner inner) { + return new NamespaceSharedAccessAuthorizationRuleResourceImpl(inner, manager()); + } + + private Observable getSharedAccessAuthorizationRuleResourceInnerUsingNamespacesInnerAsync(String id) { + String resourceGroupName = IdParsingUtils.getValueFromIdByName(id, "resourceGroups"); + String namespaceName = IdParsingUtils.getValueFromIdByName(id, "namespaces"); + String authorizationRuleName = IdParsingUtils.getValueFromIdByName(id, "AuthorizationRules"); + NamespacesInner client = this.inner(); + return client.getAuthorizationRuleAsync(resourceGroupName, namespaceName, authorizationRuleName); + } + + @Override + public Observable getAuthorizationRuleAsync(String resourceGroupName, String namespaceName, String authorizationRuleName) { + NamespacesInner client = this.inner(); + return client.getAuthorizationRuleAsync(resourceGroupName, namespaceName, authorizationRuleName) + .map(new Func1() { + @Override + public NamespaceSharedAccessAuthorizationRuleResource call(SharedAccessAuthorizationRuleResourceInner inner) { + return wrapNamespaceSharedAccessAuthorizationRuleResourceModel(inner); + } + }); + } + + @Override + public Observable listAuthorizationRulesAsync(final String resourceGroupName, final String namespaceName) { + NamespacesInner client = this.inner(); + return client.listAuthorizationRulesAsync(resourceGroupName, namespaceName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public NamespaceSharedAccessAuthorizationRuleResource call(SharedAccessAuthorizationRuleResourceInner inner) { + return wrapNamespaceSharedAccessAuthorizationRuleResourceModel(inner); + } + }); + } + + @Override + public Completable deleteAuthorizationRuleAsync(String resourceGroupName, String namespaceName, String authorizationRuleName) { + NamespacesInner client = this.inner(); + return client.deleteAuthorizationRuleAsync(resourceGroupName, namespaceName, authorizationRuleName).toCompletable(); + } + + @Override + public Observable listKeysAsync(String resourceGroupName, String namespaceName, String authorizationRuleName) { + NamespacesInner client = this.inner(); + return client.listKeysAsync(resourceGroupName, namespaceName, authorizationRuleName) + .map(new Func1() { + @Override + public ResourceListKeys call(ResourceListKeysInner inner) { + return new ResourceListKeysImpl(inner, manager()); + } + }); + } + + @Override + public Observable regenerateKeysAsync(String resourceGroupName, String namespaceName, String authorizationRuleName) { + NamespacesInner client = this.inner(); + return client.regenerateKeysAsync(resourceGroupName, namespaceName, authorizationRuleName) + .map(new Func1() { + @Override + public ResourceListKeys call(ResourceListKeysInner inner) { + return new ResourceListKeysImpl(inner, manager()); + } + }); + } + +} diff --git a/notificationhubs/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2016_03_01/implementation/NamespacesInner.java b/notificationhubs/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2016_03_01/implementation/NamespacesInner.java new file mode 100644 index 000000000000..c0e28aa7fe51 --- /dev/null +++ b/notificationhubs/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2016_03_01/implementation/NamespacesInner.java @@ -0,0 +1,1900 @@ +/** + * 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.notificationhubs.v2016_03_01.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.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.notificationhubs.v2016_03_01.CheckAvailabilityParameters; +import com.microsoft.azure.management.notificationhubs.v2016_03_01.NamespaceCreateOrUpdateParameters; +import com.microsoft.azure.management.notificationhubs.v2016_03_01.NamespacePatchParameters; +import com.microsoft.azure.management.notificationhubs.v2016_03_01.PolicykeyResource; +import com.microsoft.azure.management.notificationhubs.v2016_03_01.SharedAccessAuthorizationRuleCreateOrUpdateParameters; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.PATCH; +import retrofit2.http.Path; +import retrofit2.http.POST; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Namespaces. + */ +public class NamespacesInner implements InnerSupportsGet, InnerSupportsDelete, InnerSupportsListing { + /** The Retrofit service to perform REST calls. */ + private NamespacesService service; + /** The service client containing this operation class. */ + private NotificationHubsManagementClientImpl client; + + /** + * Initializes an instance of NamespacesInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public NamespacesInner(Retrofit retrofit, NotificationHubsManagementClientImpl client) { + this.service = retrofit.create(NamespacesService.class); + this.client = client; + } + + /** + * The interface defining all the services for Namespaces to be + * used by Retrofit to perform actually REST calls. + */ + interface NamespacesService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.notificationhubs.v2016_03_01.Namespaces checkAvailability" }) + @POST("subscriptions/{subscriptionId}/providers/Microsoft.NotificationHubs/checkNamespaceAvailability") + Observable> checkAvailability(@Path("subscriptionId") String subscriptionId, @Body CheckAvailabilityParameters parameters, @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.notificationhubs.v2016_03_01.Namespaces createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}") + Observable> createOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @Path("subscriptionId") String subscriptionId, @Body NamespaceCreateOrUpdateParameters parameters, @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.notificationhubs.v2016_03_01.Namespaces patch" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}") + Observable> patch(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @Path("subscriptionId") String subscriptionId, @Body NamespacePatchParameters parameters, @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.notificationhubs.v2016_03_01.Namespaces delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @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.notificationhubs.v2016_03_01.Namespaces beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @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.notificationhubs.v2016_03_01.Namespaces getByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}") + Observable> getByResourceGroup(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @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.notificationhubs.v2016_03_01.Namespaces createOrUpdateAuthorizationRule" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/AuthorizationRules/{authorizationRuleName}") + Observable> createOrUpdateAuthorizationRule(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @Path("authorizationRuleName") String authorizationRuleName, @Path("subscriptionId") String subscriptionId, @Body SharedAccessAuthorizationRuleCreateOrUpdateParameters parameters, @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.notificationhubs.v2016_03_01.Namespaces deleteAuthorizationRule" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/AuthorizationRules/{authorizationRuleName}", method = "DELETE", hasBody = true) + Observable> deleteAuthorizationRule(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @Path("authorizationRuleName") String authorizationRuleName, @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.notificationhubs.v2016_03_01.Namespaces getAuthorizationRule" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/AuthorizationRules/{authorizationRuleName}") + Observable> getAuthorizationRule(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @Path("authorizationRuleName") String authorizationRuleName, @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.notificationhubs.v2016_03_01.Namespaces listByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces") + Observable> listByResourceGroup(@Path("resourceGroupName") String resourceGroupName, @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.notificationhubs.v2016_03_01.Namespaces list" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.NotificationHubs/namespaces") + 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.notificationhubs.v2016_03_01.Namespaces listAuthorizationRules" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/AuthorizationRules") + Observable> listAuthorizationRules(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @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.notificationhubs.v2016_03_01.Namespaces listKeys" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/AuthorizationRules/{authorizationRuleName}/listKeys") + Observable> listKeys(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @Path("authorizationRuleName") String authorizationRuleName, @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.notificationhubs.v2016_03_01.Namespaces regenerateKeys" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/AuthorizationRules/{authorizationRuleName}/regenerateKeys") + Observable> regenerateKeys(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @Path("authorizationRuleName") String authorizationRuleName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body PolicykeyResource parameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.notificationhubs.v2016_03_01.Namespaces listByResourceGroupNext" }) + @GET + Observable> listByResourceGroupNext(@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.notificationhubs.v2016_03_01.Namespaces 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.notificationhubs.v2016_03_01.Namespaces listAuthorizationRulesNext" }) + @GET + Observable> listAuthorizationRulesNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Checks the availability of the given service namespace across all Azure subscriptions. This is useful because the domain name is created based on the service namespace name. + * + * @param parameters The namespace name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the CheckAvailabilityResultInner object if successful. + */ + public CheckAvailabilityResultInner checkAvailability(CheckAvailabilityParameters parameters) { + return checkAvailabilityWithServiceResponseAsync(parameters).toBlocking().single().body(); + } + + /** + * Checks the availability of the given service namespace across all Azure subscriptions. This is useful because the domain name is created based on the service namespace name. + * + * @param parameters The namespace name. + * @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 checkAvailabilityAsync(CheckAvailabilityParameters parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(checkAvailabilityWithServiceResponseAsync(parameters), serviceCallback); + } + + /** + * Checks the availability of the given service namespace across all Azure subscriptions. This is useful because the domain name is created based on the service namespace name. + * + * @param parameters The namespace name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the CheckAvailabilityResultInner object + */ + public Observable checkAvailabilityAsync(CheckAvailabilityParameters parameters) { + return checkAvailabilityWithServiceResponseAsync(parameters).map(new Func1, CheckAvailabilityResultInner>() { + @Override + public CheckAvailabilityResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Checks the availability of the given service namespace across all Azure subscriptions. This is useful because the domain name is created based on the service namespace name. + * + * @param parameters The namespace name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the CheckAvailabilityResultInner object + */ + public Observable> checkAvailabilityWithServiceResponseAsync(CheckAvailabilityParameters parameters) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters 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(parameters); + return service.checkAvailability(this.client.subscriptionId(), parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = checkAvailabilityDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse checkAvailabilityDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Creates/Updates a service namespace. Once created, this namespace's resource manifest is immutable. This operation is idempotent. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param parameters Parameters supplied to create a Namespace Resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the NamespaceResourceInner object if successful. + */ + public NamespaceResourceInner createOrUpdate(String resourceGroupName, String namespaceName, NamespaceCreateOrUpdateParameters parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, namespaceName, parameters).toBlocking().single().body(); + } + + /** + * Creates/Updates a service namespace. Once created, this namespace's resource manifest is immutable. This operation is idempotent. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param parameters Parameters supplied to create a Namespace Resource. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String resourceGroupName, String namespaceName, NamespaceCreateOrUpdateParameters parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, namespaceName, parameters), serviceCallback); + } + + /** + * Creates/Updates a service namespace. Once created, this namespace's resource manifest is immutable. This operation is idempotent. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param parameters Parameters supplied to create a Namespace Resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the NamespaceResourceInner object + */ + public Observable createOrUpdateAsync(String resourceGroupName, String namespaceName, NamespaceCreateOrUpdateParameters parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, namespaceName, parameters).map(new Func1, NamespaceResourceInner>() { + @Override + public NamespaceResourceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates/Updates a service namespace. Once created, this namespace's resource manifest is immutable. This operation is idempotent. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param parameters Parameters supplied to create a Namespace Resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the NamespaceResourceInner object + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String namespaceName, NamespaceCreateOrUpdateParameters parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (namespaceName == null) { + throw new IllegalArgumentException("Parameter namespaceName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters 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(parameters); + return service.createOrUpdate(resourceGroupName, namespaceName, this.client.subscriptionId(), parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = createOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse createOrUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Patches the existing namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param parameters Parameters supplied to patch a Namespace Resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the NamespaceResourceInner object if successful. + */ + public NamespaceResourceInner patch(String resourceGroupName, String namespaceName, NamespacePatchParameters parameters) { + return patchWithServiceResponseAsync(resourceGroupName, namespaceName, parameters).toBlocking().single().body(); + } + + /** + * Patches the existing namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param parameters Parameters supplied to patch a Namespace Resource. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture patchAsync(String resourceGroupName, String namespaceName, NamespacePatchParameters parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(patchWithServiceResponseAsync(resourceGroupName, namespaceName, parameters), serviceCallback); + } + + /** + * Patches the existing namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param parameters Parameters supplied to patch a Namespace Resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the NamespaceResourceInner object + */ + public Observable patchAsync(String resourceGroupName, String namespaceName, NamespacePatchParameters parameters) { + return patchWithServiceResponseAsync(resourceGroupName, namespaceName, parameters).map(new Func1, NamespaceResourceInner>() { + @Override + public NamespaceResourceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Patches the existing namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param parameters Parameters supplied to patch a Namespace Resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the NamespaceResourceInner object + */ + public Observable> patchWithServiceResponseAsync(String resourceGroupName, String namespaceName, NamespacePatchParameters parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (namespaceName == null) { + throw new IllegalArgumentException("Parameter namespaceName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters 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(parameters); + return service.patch(resourceGroupName, namespaceName, this.client.subscriptionId(), parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = patchDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse patchDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Deletes an existing namespace. This operation also removes all associated notificationHubs under the namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException 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 namespaceName) { + deleteWithServiceResponseAsync(resourceGroupName, namespaceName).toBlocking().last().body(); + } + + /** + * Deletes an existing namespace. This operation also removes all associated notificationHubs under the namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @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 namespaceName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, namespaceName), serviceCallback); + } + + /** + * Deletes an existing namespace. This operation also removes all associated notificationHubs under the namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String namespaceName) { + return deleteWithServiceResponseAsync(resourceGroupName, namespaceName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes an existing namespace. This operation also removes all associated notificationHubs under the namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String namespaceName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (namespaceName == null) { + throw new IllegalArgumentException("Parameter namespaceName is required and cannot be null."); + } + 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."); + } + Observable> observable = service.delete(resourceGroupName, namespaceName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Deletes an existing namespace. This operation also removes all associated notificationHubs under the namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException 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 namespaceName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, namespaceName).toBlocking().single().body(); + } + + /** + * Deletes an existing namespace. This operation also removes all associated notificationHubs under the namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @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 namespaceName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, namespaceName), serviceCallback); + } + + /** + * Deletes an existing namespace. This operation also removes all associated notificationHubs under the namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String namespaceName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, namespaceName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes an existing namespace. This operation also removes all associated notificationHubs under the namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String namespaceName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (namespaceName == null) { + throw new IllegalArgumentException("Parameter namespaceName is required and cannot be null."); + } + 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.beginDelete(resourceGroupName, namespaceName, this.client.subscriptionId(), 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 CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Returns the description for the specified namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the NamespaceResourceInner object if successful. + */ + public NamespaceResourceInner getByResourceGroup(String resourceGroupName, String namespaceName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, namespaceName).toBlocking().single().body(); + } + + /** + * Returns the description for the specified namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @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 namespaceName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getByResourceGroupWithServiceResponseAsync(resourceGroupName, namespaceName), serviceCallback); + } + + /** + * Returns the description for the specified namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the NamespaceResourceInner object + */ + public Observable getByResourceGroupAsync(String resourceGroupName, String namespaceName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, namespaceName).map(new Func1, NamespaceResourceInner>() { + @Override + public NamespaceResourceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Returns the description for the specified namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the NamespaceResourceInner object + */ + public Observable> getByResourceGroupWithServiceResponseAsync(String resourceGroupName, String namespaceName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (namespaceName == null) { + throw new IllegalArgumentException("Parameter namespaceName is required and cannot be null."); + } + 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.getByResourceGroup(resourceGroupName, namespaceName, this.client.subscriptionId(), 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 CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Creates an authorization rule for a namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param authorizationRuleName Aauthorization Rule Name. + * @param parameters The shared access authorization rule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the SharedAccessAuthorizationRuleResourceInner object if successful. + */ + public SharedAccessAuthorizationRuleResourceInner createOrUpdateAuthorizationRule(String resourceGroupName, String namespaceName, String authorizationRuleName, SharedAccessAuthorizationRuleCreateOrUpdateParameters parameters) { + return createOrUpdateAuthorizationRuleWithServiceResponseAsync(resourceGroupName, namespaceName, authorizationRuleName, parameters).toBlocking().single().body(); + } + + /** + * Creates an authorization rule for a namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param authorizationRuleName Aauthorization Rule Name. + * @param parameters The shared access authorization rule. + * @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 createOrUpdateAuthorizationRuleAsync(String resourceGroupName, String namespaceName, String authorizationRuleName, SharedAccessAuthorizationRuleCreateOrUpdateParameters parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateAuthorizationRuleWithServiceResponseAsync(resourceGroupName, namespaceName, authorizationRuleName, parameters), serviceCallback); + } + + /** + * Creates an authorization rule for a namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param authorizationRuleName Aauthorization Rule Name. + * @param parameters The shared access authorization rule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SharedAccessAuthorizationRuleResourceInner object + */ + public Observable createOrUpdateAuthorizationRuleAsync(String resourceGroupName, String namespaceName, String authorizationRuleName, SharedAccessAuthorizationRuleCreateOrUpdateParameters parameters) { + return createOrUpdateAuthorizationRuleWithServiceResponseAsync(resourceGroupName, namespaceName, authorizationRuleName, parameters).map(new Func1, SharedAccessAuthorizationRuleResourceInner>() { + @Override + public SharedAccessAuthorizationRuleResourceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates an authorization rule for a namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param authorizationRuleName Aauthorization Rule Name. + * @param parameters The shared access authorization rule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SharedAccessAuthorizationRuleResourceInner object + */ + public Observable> createOrUpdateAuthorizationRuleWithServiceResponseAsync(String resourceGroupName, String namespaceName, String authorizationRuleName, SharedAccessAuthorizationRuleCreateOrUpdateParameters parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (namespaceName == null) { + throw new IllegalArgumentException("Parameter namespaceName is required and cannot be null."); + } + if (authorizationRuleName == null) { + throw new IllegalArgumentException("Parameter authorizationRuleName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters 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(parameters); + return service.createOrUpdateAuthorizationRule(resourceGroupName, namespaceName, authorizationRuleName, this.client.subscriptionId(), parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = createOrUpdateAuthorizationRuleDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse createOrUpdateAuthorizationRuleDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Deletes a namespace authorization rule. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param authorizationRuleName Authorization Rule Name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void deleteAuthorizationRule(String resourceGroupName, String namespaceName, String authorizationRuleName) { + deleteAuthorizationRuleWithServiceResponseAsync(resourceGroupName, namespaceName, authorizationRuleName).toBlocking().single().body(); + } + + /** + * Deletes a namespace authorization rule. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param authorizationRuleName Authorization Rule Name. + * @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 deleteAuthorizationRuleAsync(String resourceGroupName, String namespaceName, String authorizationRuleName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteAuthorizationRuleWithServiceResponseAsync(resourceGroupName, namespaceName, authorizationRuleName), serviceCallback); + } + + /** + * Deletes a namespace authorization rule. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param authorizationRuleName Authorization Rule Name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable deleteAuthorizationRuleAsync(String resourceGroupName, String namespaceName, String authorizationRuleName) { + return deleteAuthorizationRuleWithServiceResponseAsync(resourceGroupName, namespaceName, authorizationRuleName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes a namespace authorization rule. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param authorizationRuleName Authorization Rule Name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> deleteAuthorizationRuleWithServiceResponseAsync(String resourceGroupName, String namespaceName, String authorizationRuleName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (namespaceName == null) { + throw new IllegalArgumentException("Parameter namespaceName is required and cannot be null."); + } + if (authorizationRuleName == null) { + throw new IllegalArgumentException("Parameter authorizationRuleName is required and cannot be null."); + } + 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.deleteAuthorizationRule(resourceGroupName, namespaceName, authorizationRuleName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = deleteAuthorizationRuleDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse deleteAuthorizationRuleDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets an authorization rule for a namespace by name. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name + * @param authorizationRuleName Authorization rule name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the SharedAccessAuthorizationRuleResourceInner object if successful. + */ + public SharedAccessAuthorizationRuleResourceInner getAuthorizationRule(String resourceGroupName, String namespaceName, String authorizationRuleName) { + return getAuthorizationRuleWithServiceResponseAsync(resourceGroupName, namespaceName, authorizationRuleName).toBlocking().single().body(); + } + + /** + * Gets an authorization rule for a namespace by name. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name + * @param authorizationRuleName Authorization rule name. + * @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 getAuthorizationRuleAsync(String resourceGroupName, String namespaceName, String authorizationRuleName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getAuthorizationRuleWithServiceResponseAsync(resourceGroupName, namespaceName, authorizationRuleName), serviceCallback); + } + + /** + * Gets an authorization rule for a namespace by name. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name + * @param authorizationRuleName Authorization rule name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SharedAccessAuthorizationRuleResourceInner object + */ + public Observable getAuthorizationRuleAsync(String resourceGroupName, String namespaceName, String authorizationRuleName) { + return getAuthorizationRuleWithServiceResponseAsync(resourceGroupName, namespaceName, authorizationRuleName).map(new Func1, SharedAccessAuthorizationRuleResourceInner>() { + @Override + public SharedAccessAuthorizationRuleResourceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets an authorization rule for a namespace by name. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name + * @param authorizationRuleName Authorization rule name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SharedAccessAuthorizationRuleResourceInner object + */ + public Observable> getAuthorizationRuleWithServiceResponseAsync(String resourceGroupName, String namespaceName, String authorizationRuleName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (namespaceName == null) { + throw new IllegalArgumentException("Parameter namespaceName is required and cannot be null."); + } + if (authorizationRuleName == null) { + throw new IllegalArgumentException("Parameter authorizationRuleName is required and cannot be null."); + } + 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.getAuthorizationRule(resourceGroupName, namespaceName, authorizationRuleName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getAuthorizationRuleDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getAuthorizationRuleDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Lists the available namespaces within a resourceGroup. + * + * @param resourceGroupName The name of the resource group. If resourceGroupName value is null the method lists all the namespaces within subscription + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException 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<NamespaceResourceInner> 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(); + } + }; + } + + /** + * Lists the available namespaces within a resourceGroup. + * + * @param resourceGroupName The name of the resource group. If resourceGroupName value is null the method lists all the namespaces within 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> listByResourceGroupAsync(final String resourceGroupName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupSinglePageAsync(resourceGroupName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists the available namespaces within a resourceGroup. + * + * @param resourceGroupName The name of the resource group. If resourceGroupName value is null the method lists all the namespaces within subscription + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<NamespaceResourceInner> object + */ + public Observable> listByResourceGroupAsync(final String resourceGroupName) { + return listByResourceGroupWithServiceResponseAsync(resourceGroupName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists the available namespaces within a resourceGroup. + * + * @param resourceGroupName The name of the resource group. If resourceGroupName value is null the method lists all the namespaces within subscription + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<NamespaceResourceInner> 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)); + } + }); + } + + /** + * Lists the available namespaces within a resourceGroup. + * + ServiceResponse> * @param resourceGroupName The name of the resource group. If resourceGroupName value is null the method lists all the namespaces within subscription + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<NamespaceResourceInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupSinglePageAsync(final String resourceGroupName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + 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.listByResourceGroup(resourceGroupName, 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 = listByResourceGroupDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Lists all the available namespaces within the subscription irrespective of the resourceGroups. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException 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<NamespaceResourceInner> 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 the available namespaces within the subscription irrespective of the resourceGroups. + * + * @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 the available namespaces within the subscription irrespective of the resourceGroups. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<NamespaceResourceInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all the available namespaces within the subscription irrespective of the resourceGroups. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<NamespaceResourceInner> 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 the available namespaces within the subscription irrespective of the resourceGroups. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<NamespaceResourceInner> 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 CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets the authorization rules for a namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException 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<SharedAccessAuthorizationRuleResourceInner> object if successful. + */ + public PagedList listAuthorizationRules(final String resourceGroupName, final String namespaceName) { + ServiceResponse> response = listAuthorizationRulesSinglePageAsync(resourceGroupName, namespaceName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listAuthorizationRulesNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets the authorization rules for a namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name + * @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> listAuthorizationRulesAsync(final String resourceGroupName, final String namespaceName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listAuthorizationRulesSinglePageAsync(resourceGroupName, namespaceName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listAuthorizationRulesNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets the authorization rules for a namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<SharedAccessAuthorizationRuleResourceInner> object + */ + public Observable> listAuthorizationRulesAsync(final String resourceGroupName, final String namespaceName) { + return listAuthorizationRulesWithServiceResponseAsync(resourceGroupName, namespaceName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets the authorization rules for a namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<SharedAccessAuthorizationRuleResourceInner> object + */ + public Observable>> listAuthorizationRulesWithServiceResponseAsync(final String resourceGroupName, final String namespaceName) { + return listAuthorizationRulesSinglePageAsync(resourceGroupName, namespaceName) + .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(listAuthorizationRulesNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets the authorization rules for a namespace. + * + ServiceResponse> * @param resourceGroupName The name of the resource group. + ServiceResponse> * @param namespaceName The namespace name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<SharedAccessAuthorizationRuleResourceInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listAuthorizationRulesSinglePageAsync(final String resourceGroupName, final String namespaceName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (namespaceName == null) { + throw new IllegalArgumentException("Parameter namespaceName is required and cannot be null."); + } + 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.listAuthorizationRules(resourceGroupName, namespaceName, 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 = listAuthorizationRulesDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listAuthorizationRulesDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets the Primary and Secondary ConnectionStrings to the namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param authorizationRuleName The connection string of the namespace for the specified authorizationRule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ResourceListKeysInner object if successful. + */ + public ResourceListKeysInner listKeys(String resourceGroupName, String namespaceName, String authorizationRuleName) { + return listKeysWithServiceResponseAsync(resourceGroupName, namespaceName, authorizationRuleName).toBlocking().single().body(); + } + + /** + * Gets the Primary and Secondary ConnectionStrings to the namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param authorizationRuleName The connection string of the namespace for the specified authorizationRule. + * @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 listKeysAsync(String resourceGroupName, String namespaceName, String authorizationRuleName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(listKeysWithServiceResponseAsync(resourceGroupName, namespaceName, authorizationRuleName), serviceCallback); + } + + /** + * Gets the Primary and Secondary ConnectionStrings to the namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param authorizationRuleName The connection string of the namespace for the specified authorizationRule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ResourceListKeysInner object + */ + public Observable listKeysAsync(String resourceGroupName, String namespaceName, String authorizationRuleName) { + return listKeysWithServiceResponseAsync(resourceGroupName, namespaceName, authorizationRuleName).map(new Func1, ResourceListKeysInner>() { + @Override + public ResourceListKeysInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the Primary and Secondary ConnectionStrings to the namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param authorizationRuleName The connection string of the namespace for the specified authorizationRule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ResourceListKeysInner object + */ + public Observable> listKeysWithServiceResponseAsync(String resourceGroupName, String namespaceName, String authorizationRuleName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (namespaceName == null) { + throw new IllegalArgumentException("Parameter namespaceName is required and cannot be null."); + } + if (authorizationRuleName == null) { + throw new IllegalArgumentException("Parameter authorizationRuleName is required and cannot be null."); + } + 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.listKeys(resourceGroupName, namespaceName, authorizationRuleName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = listKeysDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse listKeysDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Regenerates the Primary/Secondary Keys to the Namespace Authorization Rule. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param authorizationRuleName The connection string of the namespace for the specified authorizationRule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ResourceListKeysInner object if successful. + */ + public ResourceListKeysInner regenerateKeys(String resourceGroupName, String namespaceName, String authorizationRuleName) { + return regenerateKeysWithServiceResponseAsync(resourceGroupName, namespaceName, authorizationRuleName).toBlocking().single().body(); + } + + /** + * Regenerates the Primary/Secondary Keys to the Namespace Authorization Rule. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param authorizationRuleName The connection string of the namespace for the specified authorizationRule. + * @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 regenerateKeysAsync(String resourceGroupName, String namespaceName, String authorizationRuleName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(regenerateKeysWithServiceResponseAsync(resourceGroupName, namespaceName, authorizationRuleName), serviceCallback); + } + + /** + * Regenerates the Primary/Secondary Keys to the Namespace Authorization Rule. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param authorizationRuleName The connection string of the namespace for the specified authorizationRule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ResourceListKeysInner object + */ + public Observable regenerateKeysAsync(String resourceGroupName, String namespaceName, String authorizationRuleName) { + return regenerateKeysWithServiceResponseAsync(resourceGroupName, namespaceName, authorizationRuleName).map(new Func1, ResourceListKeysInner>() { + @Override + public ResourceListKeysInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Regenerates the Primary/Secondary Keys to the Namespace Authorization Rule. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param authorizationRuleName The connection string of the namespace for the specified authorizationRule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ResourceListKeysInner object + */ + public Observable> regenerateKeysWithServiceResponseAsync(String resourceGroupName, String namespaceName, String authorizationRuleName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (namespaceName == null) { + throw new IllegalArgumentException("Parameter namespaceName is required and cannot be null."); + } + if (authorizationRuleName == null) { + throw new IllegalArgumentException("Parameter authorizationRuleName is required and cannot be null."); + } + 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."); + } + final String policyKey = null; + PolicykeyResource parameters = new PolicykeyResource(); + parameters.withPolicyKey(null); + return service.regenerateKeys(resourceGroupName, namespaceName, authorizationRuleName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), parameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = regenerateKeysDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Regenerates the Primary/Secondary Keys to the Namespace Authorization Rule. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param authorizationRuleName The connection string of the namespace for the specified authorizationRule. + * @param policyKey Name of the key that has to be regenerated for the Namespace/Notification Hub Authorization Rule. The value can be Primary Key/Secondary Key. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ResourceListKeysInner object if successful. + */ + public ResourceListKeysInner regenerateKeys(String resourceGroupName, String namespaceName, String authorizationRuleName, String policyKey) { + return regenerateKeysWithServiceResponseAsync(resourceGroupName, namespaceName, authorizationRuleName, policyKey).toBlocking().single().body(); + } + + /** + * Regenerates the Primary/Secondary Keys to the Namespace Authorization Rule. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param authorizationRuleName The connection string of the namespace for the specified authorizationRule. + * @param policyKey Name of the key that has to be regenerated for the Namespace/Notification Hub Authorization Rule. The value can be Primary Key/Secondary Key. + * @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 regenerateKeysAsync(String resourceGroupName, String namespaceName, String authorizationRuleName, String policyKey, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(regenerateKeysWithServiceResponseAsync(resourceGroupName, namespaceName, authorizationRuleName, policyKey), serviceCallback); + } + + /** + * Regenerates the Primary/Secondary Keys to the Namespace Authorization Rule. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param authorizationRuleName The connection string of the namespace for the specified authorizationRule. + * @param policyKey Name of the key that has to be regenerated for the Namespace/Notification Hub Authorization Rule. The value can be Primary Key/Secondary Key. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ResourceListKeysInner object + */ + public Observable regenerateKeysAsync(String resourceGroupName, String namespaceName, String authorizationRuleName, String policyKey) { + return regenerateKeysWithServiceResponseAsync(resourceGroupName, namespaceName, authorizationRuleName, policyKey).map(new Func1, ResourceListKeysInner>() { + @Override + public ResourceListKeysInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Regenerates the Primary/Secondary Keys to the Namespace Authorization Rule. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param authorizationRuleName The connection string of the namespace for the specified authorizationRule. + * @param policyKey Name of the key that has to be regenerated for the Namespace/Notification Hub Authorization Rule. The value can be Primary Key/Secondary Key. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ResourceListKeysInner object + */ + public Observable> regenerateKeysWithServiceResponseAsync(String resourceGroupName, String namespaceName, String authorizationRuleName, String policyKey) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (namespaceName == null) { + throw new IllegalArgumentException("Parameter namespaceName is required and cannot be null."); + } + if (authorizationRuleName == null) { + throw new IllegalArgumentException("Parameter authorizationRuleName is required and cannot be null."); + } + 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."); + } + PolicykeyResource parameters = new PolicykeyResource(); + parameters.withPolicyKey(policyKey); + return service.regenerateKeys(resourceGroupName, namespaceName, authorizationRuleName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), parameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = regenerateKeysDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse regenerateKeysDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Lists the available namespaces within a resourceGroup. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException 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<NamespaceResourceInner> 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(); + } + }; + } + + /** + * Lists the available namespaces within a resourceGroup. + * + * @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); + } + + /** + * Lists the available namespaces within a resourceGroup. + * + * @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<NamespaceResourceInner> object + */ + public Observable> listByResourceGroupNextAsync(final String nextPageLink) { + return listByResourceGroupNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists the available namespaces within a resourceGroup. + * + * @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<NamespaceResourceInner> 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)); + } + }); + } + + /** + * Lists the available namespaces within a resourceGroup. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<NamespaceResourceInner> 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 CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Lists all the available namespaces within the subscription irrespective of the resourceGroups. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException 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<NamespaceResourceInner> 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 the available namespaces within the subscription irrespective of the resourceGroups. + * + * @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 the available namespaces within the subscription irrespective of the resourceGroups. + * + * @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<NamespaceResourceInner> 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 the available namespaces within the subscription irrespective of the resourceGroups. + * + * @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<NamespaceResourceInner> 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 the available namespaces within the subscription irrespective of the resourceGroups. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<NamespaceResourceInner> 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 CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets the authorization rules for a namespace. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException 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<SharedAccessAuthorizationRuleResourceInner> object if successful. + */ + public PagedList listAuthorizationRulesNext(final String nextPageLink) { + ServiceResponse> response = listAuthorizationRulesNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listAuthorizationRulesNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets the authorization rules for a namespace. + * + * @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> listAuthorizationRulesNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listAuthorizationRulesNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listAuthorizationRulesNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets the authorization rules for a namespace. + * + * @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<SharedAccessAuthorizationRuleResourceInner> object + */ + public Observable> listAuthorizationRulesNextAsync(final String nextPageLink) { + return listAuthorizationRulesNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets the authorization rules for a namespace. + * + * @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<SharedAccessAuthorizationRuleResourceInner> object + */ + public Observable>> listAuthorizationRulesNextWithServiceResponseAsync(final String nextPageLink) { + return listAuthorizationRulesNextSinglePageAsync(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(listAuthorizationRulesNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets the authorization rules for a namespace. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<SharedAccessAuthorizationRuleResourceInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listAuthorizationRulesNextSinglePageAsync(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.listAuthorizationRulesNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listAuthorizationRulesNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listAuthorizationRulesNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/notificationhubs/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2016_03_01/implementation/NotificationHubNamespaceSharedAccessAuthorizationRuleResourceImpl.java b/notificationhubs/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2016_03_01/implementation/NotificationHubNamespaceSharedAccessAuthorizationRuleResourceImpl.java new file mode 100644 index 000000000000..dda48a5d9726 --- /dev/null +++ b/notificationhubs/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2016_03_01/implementation/NotificationHubNamespaceSharedAccessAuthorizationRuleResourceImpl.java @@ -0,0 +1,168 @@ +/** + * 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.notificationhubs.v2016_03_01.implementation; + +import com.microsoft.azure.management.notificationhubs.v2016_03_01.NotificationHubNamespaceSharedAccessAuthorizationRuleResource; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import com.microsoft.azure.management.notificationhubs.v2016_03_01.SharedAccessAuthorizationRuleCreateOrUpdateParameters; +import java.util.Map; +import java.util.List; +import com.microsoft.azure.management.notificationhubs.v2016_03_01.AccessRights; +import com.microsoft.azure.management.notificationhubs.v2016_03_01.Sku; +import com.microsoft.azure.management.notificationhubs.v2016_03_01.SharedAccessAuthorizationRuleProperties; +import rx.functions.Func1; + +class NotificationHubNamespaceSharedAccessAuthorizationRuleResourceImpl extends CreatableUpdatableImpl implements NotificationHubNamespaceSharedAccessAuthorizationRuleResource, NotificationHubNamespaceSharedAccessAuthorizationRuleResource.Definition, NotificationHubNamespaceSharedAccessAuthorizationRuleResource.Update { + private final NotificationHubsManager manager; + private String resourceGroupName; + private String namespaceName; + private String notificationHubName; + private String authorizationRuleName; + private SharedAccessAuthorizationRuleCreateOrUpdateParameters createOrUpdateParameter; + + NotificationHubNamespaceSharedAccessAuthorizationRuleResourceImpl(String name, NotificationHubsManager manager) { + super(name, new SharedAccessAuthorizationRuleResourceInner()); + this.manager = manager; + // Set resource name + this.authorizationRuleName = name; + // + this.createOrUpdateParameter = new SharedAccessAuthorizationRuleCreateOrUpdateParameters(); + } + + NotificationHubNamespaceSharedAccessAuthorizationRuleResourceImpl(SharedAccessAuthorizationRuleResourceInner inner, NotificationHubsManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.authorizationRuleName = inner.name(); + // resource ancestor names + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.namespaceName = IdParsingUtils.getValueFromIdByName(inner.id(), "namespaces"); + this.notificationHubName = IdParsingUtils.getValueFromIdByName(inner.id(), "notificationHubs"); + this.authorizationRuleName = IdParsingUtils.getValueFromIdByName(inner.id(), "AuthorizationRules"); + // + this.createOrUpdateParameter = new SharedAccessAuthorizationRuleCreateOrUpdateParameters(); + } + + @Override + public NotificationHubsManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + NotificationHubsInner client = this.manager().inner().notificationHubs(); + return client.createOrUpdateAuthorizationRuleAsync(this.resourceGroupName, this.namespaceName, this.notificationHubName, this.authorizationRuleName, this.createOrUpdateParameter) + .map(new Func1() { + @Override + public SharedAccessAuthorizationRuleResourceInner call(SharedAccessAuthorizationRuleResourceInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + NotificationHubsInner client = this.manager().inner().notificationHubs(); + return client.createOrUpdateAuthorizationRuleAsync(this.resourceGroupName, this.namespaceName, this.notificationHubName, this.authorizationRuleName, this.createOrUpdateParameter) + .map(new Func1() { + @Override + public SharedAccessAuthorizationRuleResourceInner call(SharedAccessAuthorizationRuleResourceInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + NotificationHubsInner client = this.manager().inner().notificationHubs(); + return client.getAuthorizationRuleAsync(this.resourceGroupName, this.namespaceName, this.notificationHubName, this.authorizationRuleName); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + private void resetCreateUpdateParameters() { + this.createOrUpdateParameter = new SharedAccessAuthorizationRuleCreateOrUpdateParameters(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String location() { + return this.inner().location(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public List rights() { + return this.inner().rights(); + } + + @Override + public Sku sku() { + return this.inner().sku(); + } + + @Override + public Map tags() { + return this.inner().getTags(); + } + + @Override + public String type() { + return this.inner().type(); + } + + @Override + public NotificationHubNamespaceSharedAccessAuthorizationRuleResourceImpl withExistingNotificationHub(String resourceGroupName, String namespaceName, String notificationHubName) { + this.resourceGroupName = resourceGroupName; + this.namespaceName = namespaceName; + this.notificationHubName = notificationHubName; + return this; + } + + @Override + public NotificationHubNamespaceSharedAccessAuthorizationRuleResourceImpl withLocation(String location) { + this.createOrUpdateParameter.withLocation(location); + return this; + } + + @Override + public NotificationHubNamespaceSharedAccessAuthorizationRuleResourceImpl withProperties(SharedAccessAuthorizationRuleProperties properties) { + this.createOrUpdateParameter.withProperties(properties); + return this; + } + + @Override + public NotificationHubNamespaceSharedAccessAuthorizationRuleResourceImpl withSku(Sku sku) { + this.createOrUpdateParameter.withSku(sku); + return this; + } + + @Override + public NotificationHubNamespaceSharedAccessAuthorizationRuleResourceImpl withTags(Map tags) { + this.createOrUpdateParameter.withTags(tags); + return this; + } + +} diff --git a/notificationhubs/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2016_03_01/implementation/NotificationHubResourceImpl.java b/notificationhubs/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2016_03_01/implementation/NotificationHubResourceImpl.java new file mode 100644 index 000000000000..d3a79e76f4e8 --- /dev/null +++ b/notificationhubs/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2016_03_01/implementation/NotificationHubResourceImpl.java @@ -0,0 +1,258 @@ +/** + * 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.notificationhubs.v2016_03_01.implementation; + +import com.microsoft.azure.management.notificationhubs.v2016_03_01.NotificationHubResource; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import com.microsoft.azure.management.notificationhubs.v2016_03_01.NotificationHubCreateOrUpdateParameters; +import java.util.Map; +import java.util.List; +import com.microsoft.azure.management.notificationhubs.v2016_03_01.AdmCredential; +import com.microsoft.azure.management.notificationhubs.v2016_03_01.ApnsCredential; +import com.microsoft.azure.management.notificationhubs.v2016_03_01.SharedAccessAuthorizationRuleProperties; +import com.microsoft.azure.management.notificationhubs.v2016_03_01.BaiduCredential; +import com.microsoft.azure.management.notificationhubs.v2016_03_01.GcmCredential; +import com.microsoft.azure.management.notificationhubs.v2016_03_01.MpnsCredential; +import com.microsoft.azure.management.notificationhubs.v2016_03_01.WnsCredential; +import com.microsoft.azure.management.notificationhubs.v2016_03_01.Sku; +import rx.functions.Func1; + +class NotificationHubResourceImpl extends CreatableUpdatableImpl implements NotificationHubResource, NotificationHubResource.Definition, NotificationHubResource.Update { + private final NotificationHubsManager manager; + private String resourceGroupName; + private String namespaceName; + private String notificationHubName; + private NotificationHubCreateOrUpdateParameters createOrUpdateParameter; + + NotificationHubResourceImpl(String name, NotificationHubsManager manager) { + super(name, new NotificationHubResourceInner()); + this.manager = manager; + // Set resource name + this.notificationHubName = name; + // + this.createOrUpdateParameter = new NotificationHubCreateOrUpdateParameters(); + } + + NotificationHubResourceImpl(NotificationHubResourceInner inner, NotificationHubsManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.notificationHubName = inner.name(); + // resource ancestor names + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.namespaceName = IdParsingUtils.getValueFromIdByName(inner.id(), "namespaces"); + this.notificationHubName = IdParsingUtils.getValueFromIdByName(inner.id(), "notificationHubs"); + // + this.createOrUpdateParameter = new NotificationHubCreateOrUpdateParameters(); + } + + @Override + public NotificationHubsManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + NotificationHubsInner client = this.manager().inner().notificationHubs(); + return client.createOrUpdateAsync(this.resourceGroupName, this.namespaceName, this.notificationHubName, this.createOrUpdateParameter) + .map(new Func1() { + @Override + public NotificationHubResourceInner call(NotificationHubResourceInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + NotificationHubsInner client = this.manager().inner().notificationHubs(); + return client.createOrUpdateAsync(this.resourceGroupName, this.namespaceName, this.notificationHubName, this.createOrUpdateParameter) + .map(new Func1() { + @Override + public NotificationHubResourceInner call(NotificationHubResourceInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + NotificationHubsInner client = this.manager().inner().notificationHubs(); + return client.getAsync(this.resourceGroupName, this.namespaceName, this.notificationHubName); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + private void resetCreateUpdateParameters() { + this.createOrUpdateParameter = new NotificationHubCreateOrUpdateParameters(); + } + + @Override + public AdmCredential admCredential() { + return this.inner().admCredential(); + } + + @Override + public ApnsCredential apnsCredential() { + return this.inner().apnsCredential(); + } + + @Override + public List authorizationRules() { + return this.inner().authorizationRules(); + } + + @Override + public BaiduCredential baiduCredential() { + return this.inner().baiduCredential(); + } + + @Override + public GcmCredential gcmCredential() { + return this.inner().gcmCredential(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String location() { + return this.inner().location(); + } + + @Override + public MpnsCredential mpnsCredential() { + return this.inner().mpnsCredential(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public String notificationHubResourceName() { + return this.inner().notificationHubResourceName(); + } + + @Override + public String registrationTtl() { + return this.inner().registrationTtl(); + } + + @Override + public Sku sku() { + return this.inner().sku(); + } + + @Override + public Map tags() { + return this.inner().getTags(); + } + + @Override + public String type() { + return this.inner().type(); + } + + @Override + public WnsCredential wnsCredential() { + return this.inner().wnsCredential(); + } + + @Override + public NotificationHubResourceImpl withExistingNamespace(String resourceGroupName, String namespaceName) { + this.resourceGroupName = resourceGroupName; + this.namespaceName = namespaceName; + return this; + } + + @Override + public NotificationHubResourceImpl withLocation(String location) { + this.createOrUpdateParameter.withLocation(location); + return this; + } + + @Override + public NotificationHubResourceImpl withAdmCredential(AdmCredential admCredential) { + this.createOrUpdateParameter.withAdmCredential(admCredential); + return this; + } + + @Override + public NotificationHubResourceImpl withApnsCredential(ApnsCredential apnsCredential) { + this.createOrUpdateParameter.withApnsCredential(apnsCredential); + return this; + } + + @Override + public NotificationHubResourceImpl withAuthorizationRules(List authorizationRules) { + this.createOrUpdateParameter.withAuthorizationRules(authorizationRules); + return this; + } + + @Override + public NotificationHubResourceImpl withBaiduCredential(BaiduCredential baiduCredential) { + this.createOrUpdateParameter.withBaiduCredential(baiduCredential); + return this; + } + + @Override + public NotificationHubResourceImpl withGcmCredential(GcmCredential gcmCredential) { + this.createOrUpdateParameter.withGcmCredential(gcmCredential); + return this; + } + + @Override + public NotificationHubResourceImpl withMpnsCredential(MpnsCredential mpnsCredential) { + this.createOrUpdateParameter.withMpnsCredential(mpnsCredential); + return this; + } + + @Override + public NotificationHubResourceImpl withNotificationHubCreateOrUpdateParametersName(String notificationHubCreateOrUpdateParametersName) { + this.createOrUpdateParameter.withNotificationHubCreateOrUpdateParametersName(notificationHubCreateOrUpdateParametersName); + return this; + } + + @Override + public NotificationHubResourceImpl withRegistrationTtl(String registrationTtl) { + this.createOrUpdateParameter.withRegistrationTtl(registrationTtl); + return this; + } + + @Override + public NotificationHubResourceImpl withSku(Sku sku) { + this.createOrUpdateParameter.withSku(sku); + return this; + } + + @Override + public NotificationHubResourceImpl withTags(Map tags) { + this.createOrUpdateParameter.withTags(tags); + return this; + } + + @Override + public NotificationHubResourceImpl withWnsCredential(WnsCredential wnsCredential) { + this.createOrUpdateParameter.withWnsCredential(wnsCredential); + return this; + } + +} diff --git a/notificationhubs/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2016_03_01/implementation/NotificationHubResourceInner.java b/notificationhubs/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2016_03_01/implementation/NotificationHubResourceInner.java new file mode 100644 index 000000000000..326ae60fd084 --- /dev/null +++ b/notificationhubs/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2016_03_01/implementation/NotificationHubResourceInner.java @@ -0,0 +1,289 @@ +/** + * 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.notificationhubs.v2016_03_01.implementation; + +import java.util.List; +import com.microsoft.azure.management.notificationhubs.v2016_03_01.SharedAccessAuthorizationRuleProperties; +import com.microsoft.azure.management.notificationhubs.v2016_03_01.ApnsCredential; +import com.microsoft.azure.management.notificationhubs.v2016_03_01.WnsCredential; +import com.microsoft.azure.management.notificationhubs.v2016_03_01.GcmCredential; +import com.microsoft.azure.management.notificationhubs.v2016_03_01.MpnsCredential; +import com.microsoft.azure.management.notificationhubs.v2016_03_01.AdmCredential; +import com.microsoft.azure.management.notificationhubs.v2016_03_01.BaiduCredential; +import com.microsoft.azure.management.notificationhubs.v2016_03_01.Sku; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.Resource; + +/** + * Description of a NotificationHub Resource. + */ +@JsonFlatten +public class NotificationHubResourceInner extends Resource { + /** + * The NotificationHub name. + */ + @JsonProperty(value = "properties.name") + private String notificationHubResourceName; + + /** + * The RegistrationTtl of the created NotificationHub. + */ + @JsonProperty(value = "properties.registrationTtl") + private String registrationTtl; + + /** + * The AuthorizationRules of the created NotificationHub. + */ + @JsonProperty(value = "properties.authorizationRules") + private List authorizationRules; + + /** + * The ApnsCredential of the created NotificationHub. + */ + @JsonProperty(value = "properties.apnsCredential") + private ApnsCredential apnsCredential; + + /** + * The WnsCredential of the created NotificationHub. + */ + @JsonProperty(value = "properties.wnsCredential") + private WnsCredential wnsCredential; + + /** + * The GcmCredential of the created NotificationHub. + */ + @JsonProperty(value = "properties.gcmCredential") + private GcmCredential gcmCredential; + + /** + * The MpnsCredential of the created NotificationHub. + */ + @JsonProperty(value = "properties.mpnsCredential") + private MpnsCredential mpnsCredential; + + /** + * The AdmCredential of the created NotificationHub. + */ + @JsonProperty(value = "properties.admCredential") + private AdmCredential admCredential; + + /** + * The BaiduCredential of the created NotificationHub. + */ + @JsonProperty(value = "properties.baiduCredential") + private BaiduCredential baiduCredential; + + /** + * The sku of the created namespace. + */ + @JsonProperty(value = "sku") + private Sku sku; + + /** + * Get the NotificationHub name. + * + * @return the notificationHubResourceName value + */ + public String notificationHubResourceName() { + return this.notificationHubResourceName; + } + + /** + * Set the NotificationHub name. + * + * @param notificationHubResourceName the notificationHubResourceName value to set + * @return the NotificationHubResourceInner object itself. + */ + public NotificationHubResourceInner withNotificationHubResourceName(String notificationHubResourceName) { + this.notificationHubResourceName = notificationHubResourceName; + return this; + } + + /** + * Get the RegistrationTtl of the created NotificationHub. + * + * @return the registrationTtl value + */ + public String registrationTtl() { + return this.registrationTtl; + } + + /** + * Set the RegistrationTtl of the created NotificationHub. + * + * @param registrationTtl the registrationTtl value to set + * @return the NotificationHubResourceInner object itself. + */ + public NotificationHubResourceInner withRegistrationTtl(String registrationTtl) { + this.registrationTtl = registrationTtl; + return this; + } + + /** + * Get the AuthorizationRules of the created NotificationHub. + * + * @return the authorizationRules value + */ + public List authorizationRules() { + return this.authorizationRules; + } + + /** + * Set the AuthorizationRules of the created NotificationHub. + * + * @param authorizationRules the authorizationRules value to set + * @return the NotificationHubResourceInner object itself. + */ + public NotificationHubResourceInner withAuthorizationRules(List authorizationRules) { + this.authorizationRules = authorizationRules; + return this; + } + + /** + * Get the ApnsCredential of the created NotificationHub. + * + * @return the apnsCredential value + */ + public ApnsCredential apnsCredential() { + return this.apnsCredential; + } + + /** + * Set the ApnsCredential of the created NotificationHub. + * + * @param apnsCredential the apnsCredential value to set + * @return the NotificationHubResourceInner object itself. + */ + public NotificationHubResourceInner withApnsCredential(ApnsCredential apnsCredential) { + this.apnsCredential = apnsCredential; + return this; + } + + /** + * Get the WnsCredential of the created NotificationHub. + * + * @return the wnsCredential value + */ + public WnsCredential wnsCredential() { + return this.wnsCredential; + } + + /** + * Set the WnsCredential of the created NotificationHub. + * + * @param wnsCredential the wnsCredential value to set + * @return the NotificationHubResourceInner object itself. + */ + public NotificationHubResourceInner withWnsCredential(WnsCredential wnsCredential) { + this.wnsCredential = wnsCredential; + return this; + } + + /** + * Get the GcmCredential of the created NotificationHub. + * + * @return the gcmCredential value + */ + public GcmCredential gcmCredential() { + return this.gcmCredential; + } + + /** + * Set the GcmCredential of the created NotificationHub. + * + * @param gcmCredential the gcmCredential value to set + * @return the NotificationHubResourceInner object itself. + */ + public NotificationHubResourceInner withGcmCredential(GcmCredential gcmCredential) { + this.gcmCredential = gcmCredential; + return this; + } + + /** + * Get the MpnsCredential of the created NotificationHub. + * + * @return the mpnsCredential value + */ + public MpnsCredential mpnsCredential() { + return this.mpnsCredential; + } + + /** + * Set the MpnsCredential of the created NotificationHub. + * + * @param mpnsCredential the mpnsCredential value to set + * @return the NotificationHubResourceInner object itself. + */ + public NotificationHubResourceInner withMpnsCredential(MpnsCredential mpnsCredential) { + this.mpnsCredential = mpnsCredential; + return this; + } + + /** + * Get the AdmCredential of the created NotificationHub. + * + * @return the admCredential value + */ + public AdmCredential admCredential() { + return this.admCredential; + } + + /** + * Set the AdmCredential of the created NotificationHub. + * + * @param admCredential the admCredential value to set + * @return the NotificationHubResourceInner object itself. + */ + public NotificationHubResourceInner withAdmCredential(AdmCredential admCredential) { + this.admCredential = admCredential; + return this; + } + + /** + * Get the BaiduCredential of the created NotificationHub. + * + * @return the baiduCredential value + */ + public BaiduCredential baiduCredential() { + return this.baiduCredential; + } + + /** + * Set the BaiduCredential of the created NotificationHub. + * + * @param baiduCredential the baiduCredential value to set + * @return the NotificationHubResourceInner object itself. + */ + public NotificationHubResourceInner withBaiduCredential(BaiduCredential baiduCredential) { + this.baiduCredential = baiduCredential; + return this; + } + + /** + * Get the sku of the created namespace. + * + * @return the sku value + */ + public Sku sku() { + return this.sku; + } + + /** + * Set the sku of the created namespace. + * + * @param sku the sku value to set + * @return the NotificationHubResourceInner object itself. + */ + public NotificationHubResourceInner withSku(Sku sku) { + this.sku = sku; + return this; + } + +} diff --git a/notificationhubs/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2016_03_01/implementation/NotificationHubsImpl.java b/notificationhubs/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2016_03_01/implementation/NotificationHubsImpl.java new file mode 100644 index 000000000000..c58f36591374 --- /dev/null +++ b/notificationhubs/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2016_03_01/implementation/NotificationHubsImpl.java @@ -0,0 +1,192 @@ +/** + * 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.notificationhubs.v2016_03_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.notificationhubs.v2016_03_01.NotificationHubs; +import rx.Completable; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.notificationhubs.v2016_03_01.PnsCredentialsResource; +import com.microsoft.azure.management.notificationhubs.v2016_03_01.NotificationHubResource; +import com.microsoft.azure.management.notificationhubs.v2016_03_01.CheckAvailabilityResult; +import com.microsoft.azure.management.notificationhubs.v2016_03_01.CheckAvailabilityParameters; +import com.microsoft.azure.management.notificationhubs.v2016_03_01.NotificationHubNamespaceSharedAccessAuthorizationRuleResource; +import com.microsoft.azure.management.notificationhubs.v2016_03_01.ResourceListKeys; + +class NotificationHubsImpl extends WrapperImpl implements NotificationHubs { + private final NotificationHubsManager manager; + + NotificationHubsImpl(NotificationHubsManager manager) { + super(manager.inner().notificationHubs()); + this.manager = manager; + } + + public NotificationHubsManager manager() { + return this.manager; + } + + @Override + public NotificationHubResourceImpl define(String name) { + return wrapModel(name); + } + + private NotificationHubResourceImpl wrapModel(NotificationHubResourceInner inner) { + return new NotificationHubResourceImpl(inner, manager()); + } + + private NotificationHubResourceImpl wrapModel(String name) { + return new NotificationHubResourceImpl(name, this.manager()); + } + + @Override + public Observable getPnsCredentialsAsync(String resourceGroupName, String namespaceName, String notificationHubName) { + NotificationHubsInner client = this.inner(); + return client.getPnsCredentialsAsync(resourceGroupName, namespaceName, notificationHubName) + .map(new Func1() { + @Override + public PnsCredentialsResource call(PnsCredentialsResourceInner inner) { + return new PnsCredentialsResourceImpl(inner, manager()); + } + }); + } + + @Override + public Observable listAsync(final String resourceGroupName, final String namespaceName) { + NotificationHubsInner client = this.inner(); + return client.listAsync(resourceGroupName, namespaceName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public NotificationHubResource call(NotificationHubResourceInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Observable getAsync(String resourceGroupName, String namespaceName, String notificationHubName) { + NotificationHubsInner client = this.inner(); + return client.getAsync(resourceGroupName, namespaceName, notificationHubName) + .map(new Func1() { + @Override + public NotificationHubResource call(NotificationHubResourceInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Completable deleteAsync(String resourceGroupName, String namespaceName, String notificationHubName) { + NotificationHubsInner client = this.inner(); + return client.deleteAsync(resourceGroupName, namespaceName, notificationHubName).toCompletable(); + } + + @Override + public NotificationHubNamespaceSharedAccessAuthorizationRuleResourceImpl defineAuthorizationRule(String name) { + return wrapAuthorizationRuleModel(name); + } + + private NotificationHubNamespaceSharedAccessAuthorizationRuleResourceImpl wrapAuthorizationRuleModel(String name) { + return new NotificationHubNamespaceSharedAccessAuthorizationRuleResourceImpl(name, this.manager()); + } + + private NotificationHubNamespaceSharedAccessAuthorizationRuleResourceImpl wrapNotificationHubNamespaceSharedAccessAuthorizationRuleResourceModel(SharedAccessAuthorizationRuleResourceInner inner) { + return new NotificationHubNamespaceSharedAccessAuthorizationRuleResourceImpl(inner, manager()); + } + + private Observable getSharedAccessAuthorizationRuleResourceInnerUsingNotificationHubsInnerAsync(String id) { + String resourceGroupName = IdParsingUtils.getValueFromIdByName(id, "resourceGroups"); + String namespaceName = IdParsingUtils.getValueFromIdByName(id, "namespaces"); + String notificationHubName = IdParsingUtils.getValueFromIdByName(id, "notificationHubs"); + String authorizationRuleName = IdParsingUtils.getValueFromIdByName(id, "AuthorizationRules"); + NotificationHubsInner client = this.inner(); + return client.getAuthorizationRuleAsync(resourceGroupName, namespaceName, notificationHubName, authorizationRuleName); + } + + @Override + public Observable checkAvailabilityAsync(String resourceGroupName, String namespaceName, CheckAvailabilityParameters parameters) { + NotificationHubsInner client = this.inner(); + return client.checkAvailabilityAsync(resourceGroupName, namespaceName, parameters) + .map(new Func1() { + @Override + public CheckAvailabilityResult call(CheckAvailabilityResultInner inner) { + return new CheckAvailabilityResultImpl(inner, manager()); + } + }); + } + + @Override + public Observable getAuthorizationRuleAsync(String resourceGroupName, String namespaceName, String notificationHubName, String authorizationRuleName) { + NotificationHubsInner client = this.inner(); + return client.getAuthorizationRuleAsync(resourceGroupName, namespaceName, notificationHubName, authorizationRuleName) + .map(new Func1() { + @Override + public NotificationHubNamespaceSharedAccessAuthorizationRuleResource call(SharedAccessAuthorizationRuleResourceInner inner) { + return wrapNotificationHubNamespaceSharedAccessAuthorizationRuleResourceModel(inner); + } + }); + } + + @Override + public Observable listAuthorizationRulesAsync(final String resourceGroupName, final String namespaceName, final String notificationHubName) { + NotificationHubsInner client = this.inner(); + return client.listAuthorizationRulesAsync(resourceGroupName, namespaceName, notificationHubName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public NotificationHubNamespaceSharedAccessAuthorizationRuleResource call(SharedAccessAuthorizationRuleResourceInner inner) { + return wrapNotificationHubNamespaceSharedAccessAuthorizationRuleResourceModel(inner); + } + }); + } + + @Override + public Completable deleteAuthorizationRuleAsync(String resourceGroupName, String namespaceName, String notificationHubName, String authorizationRuleName) { + NotificationHubsInner client = this.inner(); + return client.deleteAuthorizationRuleAsync(resourceGroupName, namespaceName, notificationHubName, authorizationRuleName).toCompletable(); + } + + @Override + public Observable listKeysAsync(String resourceGroupName, String namespaceName, String notificationHubName, String authorizationRuleName) { + NotificationHubsInner client = this.inner(); + return client.listKeysAsync(resourceGroupName, namespaceName, notificationHubName, authorizationRuleName) + .map(new Func1() { + @Override + public ResourceListKeys call(ResourceListKeysInner inner) { + return new ResourceListKeysImpl(inner, manager()); + } + }); + } + + @Override + public Observable regenerateKeysAsync(String resourceGroupName, String namespaceName, String notificationHubName, String authorizationRuleName) { + NotificationHubsInner client = this.inner(); + return client.regenerateKeysAsync(resourceGroupName, namespaceName, notificationHubName, authorizationRuleName) + .map(new Func1() { + @Override + public ResourceListKeys call(ResourceListKeysInner inner) { + return new ResourceListKeysImpl(inner, manager()); + } + }); + } + +} diff --git a/notificationhubs/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2016_03_01/implementation/NotificationHubsInner.java b/notificationhubs/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2016_03_01/implementation/NotificationHubsInner.java new file mode 100644 index 000000000000..63c9342c8e11 --- /dev/null +++ b/notificationhubs/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2016_03_01/implementation/NotificationHubsInner.java @@ -0,0 +1,1687 @@ +/** + * 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.notificationhubs.v2016_03_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.notificationhubs.v2016_03_01.CheckAvailabilityParameters; +import com.microsoft.azure.management.notificationhubs.v2016_03_01.NotificationHubCreateOrUpdateParameters; +import com.microsoft.azure.management.notificationhubs.v2016_03_01.PolicykeyResource; +import com.microsoft.azure.management.notificationhubs.v2016_03_01.SharedAccessAuthorizationRuleCreateOrUpdateParameters; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.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 NotificationHubs. + */ +public class NotificationHubsInner { + /** The Retrofit service to perform REST calls. */ + private NotificationHubsService service; + /** The service client containing this operation class. */ + private NotificationHubsManagementClientImpl client; + + /** + * Initializes an instance of NotificationHubsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public NotificationHubsInner(Retrofit retrofit, NotificationHubsManagementClientImpl client) { + this.service = retrofit.create(NotificationHubsService.class); + this.client = client; + } + + /** + * The interface defining all the services for NotificationHubs to be + * used by Retrofit to perform actually REST calls. + */ + interface NotificationHubsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.notificationhubs.v2016_03_01.NotificationHubs checkAvailability" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/checkNotificationHubAvailability") + Observable> checkAvailability(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @Path("subscriptionId") String subscriptionId, @Body CheckAvailabilityParameters parameters, @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.notificationhubs.v2016_03_01.NotificationHubs createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/notificationHubs/{notificationHubName}") + Observable> createOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @Path("notificationHubName") String notificationHubName, @Path("subscriptionId") String subscriptionId, @Body NotificationHubCreateOrUpdateParameters parameters, @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.notificationhubs.v2016_03_01.NotificationHubs delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/notificationHubs/{notificationHubName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @Path("notificationHubName") String notificationHubName, @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.notificationhubs.v2016_03_01.NotificationHubs get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/notificationHubs/{notificationHubName}") + Observable> get(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @Path("notificationHubName") String notificationHubName, @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.notificationhubs.v2016_03_01.NotificationHubs createOrUpdateAuthorizationRule" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/notificationHubs/{notificationHubName}/AuthorizationRules/{authorizationRuleName}") + Observable> createOrUpdateAuthorizationRule(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @Path("notificationHubName") String notificationHubName, @Path("authorizationRuleName") String authorizationRuleName, @Path("subscriptionId") String subscriptionId, @Body SharedAccessAuthorizationRuleCreateOrUpdateParameters parameters, @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.notificationhubs.v2016_03_01.NotificationHubs deleteAuthorizationRule" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/notificationHubs/{notificationHubName}/AuthorizationRules/{authorizationRuleName}", method = "DELETE", hasBody = true) + Observable> deleteAuthorizationRule(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @Path("notificationHubName") String notificationHubName, @Path("authorizationRuleName") String authorizationRuleName, @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.notificationhubs.v2016_03_01.NotificationHubs getAuthorizationRule" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/notificationHubs/{notificationHubName}/AuthorizationRules/{authorizationRuleName}") + Observable> getAuthorizationRule(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @Path("notificationHubName") String notificationHubName, @Path("authorizationRuleName") String authorizationRuleName, @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.notificationhubs.v2016_03_01.NotificationHubs list" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/notificationHubs") + Observable> list(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @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.notificationhubs.v2016_03_01.NotificationHubs listAuthorizationRules" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/notificationHubs/{notificationHubName}/AuthorizationRules") + Observable> listAuthorizationRules(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @Path("notificationHubName") String notificationHubName, @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.notificationhubs.v2016_03_01.NotificationHubs listKeys" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/notificationHubs/{notificationHubName}/AuthorizationRules/{authorizationRuleName}/listKeys") + Observable> listKeys(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @Path("notificationHubName") String notificationHubName, @Path("authorizationRuleName") String authorizationRuleName, @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.notificationhubs.v2016_03_01.NotificationHubs regenerateKeys" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/notificationHubs/{notificationHubName}/AuthorizationRules/{authorizationRuleName}/regenerateKeys") + Observable> regenerateKeys(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @Path("notificationHubName") String notificationHubName, @Path("authorizationRuleName") String authorizationRuleName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body PolicykeyResource parameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.notificationhubs.v2016_03_01.NotificationHubs getPnsCredentials" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/notificationHubs/{notificationHubName}/pnsCredentials") + Observable> getPnsCredentials(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @Path("notificationHubName") String notificationHubName, @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.notificationhubs.v2016_03_01.NotificationHubs 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.notificationhubs.v2016_03_01.NotificationHubs listAuthorizationRulesNext" }) + @GET + Observable> listAuthorizationRulesNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Checks the availability of the given notificationHub in a namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param parameters The notificationHub name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the CheckAvailabilityResultInner object if successful. + */ + public CheckAvailabilityResultInner checkAvailability(String resourceGroupName, String namespaceName, CheckAvailabilityParameters parameters) { + return checkAvailabilityWithServiceResponseAsync(resourceGroupName, namespaceName, parameters).toBlocking().single().body(); + } + + /** + * Checks the availability of the given notificationHub in a namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param parameters The notificationHub name. + * @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 checkAvailabilityAsync(String resourceGroupName, String namespaceName, CheckAvailabilityParameters parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(checkAvailabilityWithServiceResponseAsync(resourceGroupName, namespaceName, parameters), serviceCallback); + } + + /** + * Checks the availability of the given notificationHub in a namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param parameters The notificationHub name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the CheckAvailabilityResultInner object + */ + public Observable checkAvailabilityAsync(String resourceGroupName, String namespaceName, CheckAvailabilityParameters parameters) { + return checkAvailabilityWithServiceResponseAsync(resourceGroupName, namespaceName, parameters).map(new Func1, CheckAvailabilityResultInner>() { + @Override + public CheckAvailabilityResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Checks the availability of the given notificationHub in a namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param parameters The notificationHub name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the CheckAvailabilityResultInner object + */ + public Observable> checkAvailabilityWithServiceResponseAsync(String resourceGroupName, String namespaceName, CheckAvailabilityParameters parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (namespaceName == null) { + throw new IllegalArgumentException("Parameter namespaceName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters 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(parameters); + return service.checkAvailability(resourceGroupName, namespaceName, this.client.subscriptionId(), parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = checkAvailabilityDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse checkAvailabilityDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Creates/Update a NotificationHub in a namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param notificationHubName The notification hub name. + * @param parameters Parameters supplied to the create/update a NotificationHub Resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the NotificationHubResourceInner object if successful. + */ + public NotificationHubResourceInner createOrUpdate(String resourceGroupName, String namespaceName, String notificationHubName, NotificationHubCreateOrUpdateParameters parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, namespaceName, notificationHubName, parameters).toBlocking().single().body(); + } + + /** + * Creates/Update a NotificationHub in a namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param notificationHubName The notification hub name. + * @param parameters Parameters supplied to the create/update a NotificationHub Resource. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String resourceGroupName, String namespaceName, String notificationHubName, NotificationHubCreateOrUpdateParameters parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, namespaceName, notificationHubName, parameters), serviceCallback); + } + + /** + * Creates/Update a NotificationHub in a namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param notificationHubName The notification hub name. + * @param parameters Parameters supplied to the create/update a NotificationHub Resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the NotificationHubResourceInner object + */ + public Observable createOrUpdateAsync(String resourceGroupName, String namespaceName, String notificationHubName, NotificationHubCreateOrUpdateParameters parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, namespaceName, notificationHubName, parameters).map(new Func1, NotificationHubResourceInner>() { + @Override + public NotificationHubResourceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates/Update a NotificationHub in a namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param notificationHubName The notification hub name. + * @param parameters Parameters supplied to the create/update a NotificationHub Resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the NotificationHubResourceInner object + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String namespaceName, String notificationHubName, NotificationHubCreateOrUpdateParameters parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (namespaceName == null) { + throw new IllegalArgumentException("Parameter namespaceName is required and cannot be null."); + } + if (notificationHubName == null) { + throw new IllegalArgumentException("Parameter notificationHubName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters 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(parameters); + return service.createOrUpdate(resourceGroupName, namespaceName, notificationHubName, this.client.subscriptionId(), parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = createOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse createOrUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Deletes a notification hub associated with a namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param notificationHubName The notification hub name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException 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 namespaceName, String notificationHubName) { + deleteWithServiceResponseAsync(resourceGroupName, namespaceName, notificationHubName).toBlocking().single().body(); + } + + /** + * Deletes a notification hub associated with a namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param notificationHubName The notification hub name. + * @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 namespaceName, String notificationHubName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, namespaceName, notificationHubName), serviceCallback); + } + + /** + * Deletes a notification hub associated with a namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param notificationHubName The notification hub name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable deleteAsync(String resourceGroupName, String namespaceName, String notificationHubName) { + return deleteWithServiceResponseAsync(resourceGroupName, namespaceName, notificationHubName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes a notification hub associated with a namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param notificationHubName The notification hub name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String namespaceName, String notificationHubName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (namespaceName == null) { + throw new IllegalArgumentException("Parameter namespaceName is required and cannot be null."); + } + if (notificationHubName == null) { + throw new IllegalArgumentException("Parameter notificationHubName is required and cannot be null."); + } + 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.delete(resourceGroupName, namespaceName, notificationHubName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = deleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse deleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Lists the notification hubs associated with a namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param notificationHubName The notification hub name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the NotificationHubResourceInner object if successful. + */ + public NotificationHubResourceInner get(String resourceGroupName, String namespaceName, String notificationHubName) { + return getWithServiceResponseAsync(resourceGroupName, namespaceName, notificationHubName).toBlocking().single().body(); + } + + /** + * Lists the notification hubs associated with a namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param notificationHubName The notification hub name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String resourceGroupName, String namespaceName, String notificationHubName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, namespaceName, notificationHubName), serviceCallback); + } + + /** + * Lists the notification hubs associated with a namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param notificationHubName The notification hub name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the NotificationHubResourceInner object + */ + public Observable getAsync(String resourceGroupName, String namespaceName, String notificationHubName) { + return getWithServiceResponseAsync(resourceGroupName, namespaceName, notificationHubName).map(new Func1, NotificationHubResourceInner>() { + @Override + public NotificationHubResourceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Lists the notification hubs associated with a namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param notificationHubName The notification hub name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the NotificationHubResourceInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String namespaceName, String notificationHubName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (namespaceName == null) { + throw new IllegalArgumentException("Parameter namespaceName is required and cannot be null."); + } + if (notificationHubName == null) { + throw new IllegalArgumentException("Parameter notificationHubName is required and cannot be null."); + } + 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.get(resourceGroupName, namespaceName, notificationHubName, this.client.subscriptionId(), 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 CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Creates/Updates an authorization rule for a NotificationHub. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param notificationHubName The notification hub name. + * @param authorizationRuleName Authorization Rule Name. + * @param parameters The shared access authorization rule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the SharedAccessAuthorizationRuleResourceInner object if successful. + */ + public SharedAccessAuthorizationRuleResourceInner createOrUpdateAuthorizationRule(String resourceGroupName, String namespaceName, String notificationHubName, String authorizationRuleName, SharedAccessAuthorizationRuleCreateOrUpdateParameters parameters) { + return createOrUpdateAuthorizationRuleWithServiceResponseAsync(resourceGroupName, namespaceName, notificationHubName, authorizationRuleName, parameters).toBlocking().single().body(); + } + + /** + * Creates/Updates an authorization rule for a NotificationHub. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param notificationHubName The notification hub name. + * @param authorizationRuleName Authorization Rule Name. + * @param parameters The shared access authorization rule. + * @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 createOrUpdateAuthorizationRuleAsync(String resourceGroupName, String namespaceName, String notificationHubName, String authorizationRuleName, SharedAccessAuthorizationRuleCreateOrUpdateParameters parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateAuthorizationRuleWithServiceResponseAsync(resourceGroupName, namespaceName, notificationHubName, authorizationRuleName, parameters), serviceCallback); + } + + /** + * Creates/Updates an authorization rule for a NotificationHub. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param notificationHubName The notification hub name. + * @param authorizationRuleName Authorization Rule Name. + * @param parameters The shared access authorization rule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SharedAccessAuthorizationRuleResourceInner object + */ + public Observable createOrUpdateAuthorizationRuleAsync(String resourceGroupName, String namespaceName, String notificationHubName, String authorizationRuleName, SharedAccessAuthorizationRuleCreateOrUpdateParameters parameters) { + return createOrUpdateAuthorizationRuleWithServiceResponseAsync(resourceGroupName, namespaceName, notificationHubName, authorizationRuleName, parameters).map(new Func1, SharedAccessAuthorizationRuleResourceInner>() { + @Override + public SharedAccessAuthorizationRuleResourceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates/Updates an authorization rule for a NotificationHub. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param notificationHubName The notification hub name. + * @param authorizationRuleName Authorization Rule Name. + * @param parameters The shared access authorization rule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SharedAccessAuthorizationRuleResourceInner object + */ + public Observable> createOrUpdateAuthorizationRuleWithServiceResponseAsync(String resourceGroupName, String namespaceName, String notificationHubName, String authorizationRuleName, SharedAccessAuthorizationRuleCreateOrUpdateParameters parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (namespaceName == null) { + throw new IllegalArgumentException("Parameter namespaceName is required and cannot be null."); + } + if (notificationHubName == null) { + throw new IllegalArgumentException("Parameter notificationHubName is required and cannot be null."); + } + if (authorizationRuleName == null) { + throw new IllegalArgumentException("Parameter authorizationRuleName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters 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(parameters); + return service.createOrUpdateAuthorizationRule(resourceGroupName, namespaceName, notificationHubName, authorizationRuleName, this.client.subscriptionId(), parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = createOrUpdateAuthorizationRuleDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse createOrUpdateAuthorizationRuleDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Deletes a notificationHub authorization rule. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param notificationHubName The notification hub name. + * @param authorizationRuleName Authorization Rule Name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void deleteAuthorizationRule(String resourceGroupName, String namespaceName, String notificationHubName, String authorizationRuleName) { + deleteAuthorizationRuleWithServiceResponseAsync(resourceGroupName, namespaceName, notificationHubName, authorizationRuleName).toBlocking().single().body(); + } + + /** + * Deletes a notificationHub authorization rule. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param notificationHubName The notification hub name. + * @param authorizationRuleName Authorization Rule Name. + * @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 deleteAuthorizationRuleAsync(String resourceGroupName, String namespaceName, String notificationHubName, String authorizationRuleName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteAuthorizationRuleWithServiceResponseAsync(resourceGroupName, namespaceName, notificationHubName, authorizationRuleName), serviceCallback); + } + + /** + * Deletes a notificationHub authorization rule. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param notificationHubName The notification hub name. + * @param authorizationRuleName Authorization Rule Name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable deleteAuthorizationRuleAsync(String resourceGroupName, String namespaceName, String notificationHubName, String authorizationRuleName) { + return deleteAuthorizationRuleWithServiceResponseAsync(resourceGroupName, namespaceName, notificationHubName, authorizationRuleName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes a notificationHub authorization rule. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param notificationHubName The notification hub name. + * @param authorizationRuleName Authorization Rule Name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> deleteAuthorizationRuleWithServiceResponseAsync(String resourceGroupName, String namespaceName, String notificationHubName, String authorizationRuleName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (namespaceName == null) { + throw new IllegalArgumentException("Parameter namespaceName is required and cannot be null."); + } + if (notificationHubName == null) { + throw new IllegalArgumentException("Parameter notificationHubName is required and cannot be null."); + } + if (authorizationRuleName == null) { + throw new IllegalArgumentException("Parameter authorizationRuleName is required and cannot be null."); + } + 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.deleteAuthorizationRule(resourceGroupName, namespaceName, notificationHubName, authorizationRuleName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = deleteAuthorizationRuleDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse deleteAuthorizationRuleDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets an authorization rule for a NotificationHub by name. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name + * @param notificationHubName The notification hub name. + * @param authorizationRuleName authorization rule name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the SharedAccessAuthorizationRuleResourceInner object if successful. + */ + public SharedAccessAuthorizationRuleResourceInner getAuthorizationRule(String resourceGroupName, String namespaceName, String notificationHubName, String authorizationRuleName) { + return getAuthorizationRuleWithServiceResponseAsync(resourceGroupName, namespaceName, notificationHubName, authorizationRuleName).toBlocking().single().body(); + } + + /** + * Gets an authorization rule for a NotificationHub by name. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name + * @param notificationHubName The notification hub name. + * @param authorizationRuleName authorization rule name. + * @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 getAuthorizationRuleAsync(String resourceGroupName, String namespaceName, String notificationHubName, String authorizationRuleName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getAuthorizationRuleWithServiceResponseAsync(resourceGroupName, namespaceName, notificationHubName, authorizationRuleName), serviceCallback); + } + + /** + * Gets an authorization rule for a NotificationHub by name. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name + * @param notificationHubName The notification hub name. + * @param authorizationRuleName authorization rule name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SharedAccessAuthorizationRuleResourceInner object + */ + public Observable getAuthorizationRuleAsync(String resourceGroupName, String namespaceName, String notificationHubName, String authorizationRuleName) { + return getAuthorizationRuleWithServiceResponseAsync(resourceGroupName, namespaceName, notificationHubName, authorizationRuleName).map(new Func1, SharedAccessAuthorizationRuleResourceInner>() { + @Override + public SharedAccessAuthorizationRuleResourceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets an authorization rule for a NotificationHub by name. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name + * @param notificationHubName The notification hub name. + * @param authorizationRuleName authorization rule name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SharedAccessAuthorizationRuleResourceInner object + */ + public Observable> getAuthorizationRuleWithServiceResponseAsync(String resourceGroupName, String namespaceName, String notificationHubName, String authorizationRuleName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (namespaceName == null) { + throw new IllegalArgumentException("Parameter namespaceName is required and cannot be null."); + } + if (notificationHubName == null) { + throw new IllegalArgumentException("Parameter notificationHubName is required and cannot be null."); + } + if (authorizationRuleName == null) { + throw new IllegalArgumentException("Parameter authorizationRuleName is required and cannot be null."); + } + 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.getAuthorizationRule(resourceGroupName, namespaceName, notificationHubName, authorizationRuleName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getAuthorizationRuleDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getAuthorizationRuleDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Lists the notification hubs associated with a namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException 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<NotificationHubResourceInner> object if successful. + */ + public PagedList list(final String resourceGroupName, final String namespaceName) { + ServiceResponse> response = listSinglePageAsync(resourceGroupName, namespaceName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists the notification hubs associated with a namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @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 String resourceGroupName, final String namespaceName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(resourceGroupName, namespaceName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists the notification hubs associated with a namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<NotificationHubResourceInner> object + */ + public Observable> listAsync(final String resourceGroupName, final String namespaceName) { + return listWithServiceResponseAsync(resourceGroupName, namespaceName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists the notification hubs associated with a namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<NotificationHubResourceInner> object + */ + public Observable>> listWithServiceResponseAsync(final String resourceGroupName, final String namespaceName) { + return listSinglePageAsync(resourceGroupName, namespaceName) + .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 the notification hubs associated with a namespace. + * + ServiceResponse> * @param resourceGroupName The name of the resource group. + ServiceResponse> * @param namespaceName The namespace name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<NotificationHubResourceInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync(final String resourceGroupName, final String namespaceName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (namespaceName == null) { + throw new IllegalArgumentException("Parameter namespaceName is required and cannot be null."); + } + 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(resourceGroupName, namespaceName, 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 CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets the authorization rules for a NotificationHub. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name + * @param notificationHubName The notification hub name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException 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<SharedAccessAuthorizationRuleResourceInner> object if successful. + */ + public PagedList listAuthorizationRules(final String resourceGroupName, final String namespaceName, final String notificationHubName) { + ServiceResponse> response = listAuthorizationRulesSinglePageAsync(resourceGroupName, namespaceName, notificationHubName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listAuthorizationRulesNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets the authorization rules for a NotificationHub. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name + * @param notificationHubName The notification hub name. + * @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> listAuthorizationRulesAsync(final String resourceGroupName, final String namespaceName, final String notificationHubName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listAuthorizationRulesSinglePageAsync(resourceGroupName, namespaceName, notificationHubName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listAuthorizationRulesNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets the authorization rules for a NotificationHub. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name + * @param notificationHubName The notification hub name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<SharedAccessAuthorizationRuleResourceInner> object + */ + public Observable> listAuthorizationRulesAsync(final String resourceGroupName, final String namespaceName, final String notificationHubName) { + return listAuthorizationRulesWithServiceResponseAsync(resourceGroupName, namespaceName, notificationHubName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets the authorization rules for a NotificationHub. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name + * @param notificationHubName The notification hub name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<SharedAccessAuthorizationRuleResourceInner> object + */ + public Observable>> listAuthorizationRulesWithServiceResponseAsync(final String resourceGroupName, final String namespaceName, final String notificationHubName) { + return listAuthorizationRulesSinglePageAsync(resourceGroupName, namespaceName, notificationHubName) + .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(listAuthorizationRulesNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets the authorization rules for a NotificationHub. + * + ServiceResponse> * @param resourceGroupName The name of the resource group. + ServiceResponse> * @param namespaceName The namespace name + ServiceResponse> * @param notificationHubName The notification hub name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<SharedAccessAuthorizationRuleResourceInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listAuthorizationRulesSinglePageAsync(final String resourceGroupName, final String namespaceName, final String notificationHubName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (namespaceName == null) { + throw new IllegalArgumentException("Parameter namespaceName is required and cannot be null."); + } + if (notificationHubName == null) { + throw new IllegalArgumentException("Parameter notificationHubName is required and cannot be null."); + } + 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.listAuthorizationRules(resourceGroupName, namespaceName, notificationHubName, 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 = listAuthorizationRulesDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listAuthorizationRulesDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets the Primary and Secondary ConnectionStrings to the NotificationHub. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param notificationHubName The notification hub name. + * @param authorizationRuleName The connection string of the NotificationHub for the specified authorizationRule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ResourceListKeysInner object if successful. + */ + public ResourceListKeysInner listKeys(String resourceGroupName, String namespaceName, String notificationHubName, String authorizationRuleName) { + return listKeysWithServiceResponseAsync(resourceGroupName, namespaceName, notificationHubName, authorizationRuleName).toBlocking().single().body(); + } + + /** + * Gets the Primary and Secondary ConnectionStrings to the NotificationHub. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param notificationHubName The notification hub name. + * @param authorizationRuleName The connection string of the NotificationHub for the specified authorizationRule. + * @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 listKeysAsync(String resourceGroupName, String namespaceName, String notificationHubName, String authorizationRuleName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(listKeysWithServiceResponseAsync(resourceGroupName, namespaceName, notificationHubName, authorizationRuleName), serviceCallback); + } + + /** + * Gets the Primary and Secondary ConnectionStrings to the NotificationHub. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param notificationHubName The notification hub name. + * @param authorizationRuleName The connection string of the NotificationHub for the specified authorizationRule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ResourceListKeysInner object + */ + public Observable listKeysAsync(String resourceGroupName, String namespaceName, String notificationHubName, String authorizationRuleName) { + return listKeysWithServiceResponseAsync(resourceGroupName, namespaceName, notificationHubName, authorizationRuleName).map(new Func1, ResourceListKeysInner>() { + @Override + public ResourceListKeysInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the Primary and Secondary ConnectionStrings to the NotificationHub. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param notificationHubName The notification hub name. + * @param authorizationRuleName The connection string of the NotificationHub for the specified authorizationRule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ResourceListKeysInner object + */ + public Observable> listKeysWithServiceResponseAsync(String resourceGroupName, String namespaceName, String notificationHubName, String authorizationRuleName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (namespaceName == null) { + throw new IllegalArgumentException("Parameter namespaceName is required and cannot be null."); + } + if (notificationHubName == null) { + throw new IllegalArgumentException("Parameter notificationHubName is required and cannot be null."); + } + if (authorizationRuleName == null) { + throw new IllegalArgumentException("Parameter authorizationRuleName is required and cannot be null."); + } + 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.listKeys(resourceGroupName, namespaceName, notificationHubName, authorizationRuleName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = listKeysDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse listKeysDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Regenerates the Primary/Secondary Keys to the NotificationHub Authorization Rule. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param notificationHubName The notification hub name. + * @param authorizationRuleName The connection string of the NotificationHub for the specified authorizationRule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ResourceListKeysInner object if successful. + */ + public ResourceListKeysInner regenerateKeys(String resourceGroupName, String namespaceName, String notificationHubName, String authorizationRuleName) { + return regenerateKeysWithServiceResponseAsync(resourceGroupName, namespaceName, notificationHubName, authorizationRuleName).toBlocking().single().body(); + } + + /** + * Regenerates the Primary/Secondary Keys to the NotificationHub Authorization Rule. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param notificationHubName The notification hub name. + * @param authorizationRuleName The connection string of the NotificationHub for the specified authorizationRule. + * @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 regenerateKeysAsync(String resourceGroupName, String namespaceName, String notificationHubName, String authorizationRuleName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(regenerateKeysWithServiceResponseAsync(resourceGroupName, namespaceName, notificationHubName, authorizationRuleName), serviceCallback); + } + + /** + * Regenerates the Primary/Secondary Keys to the NotificationHub Authorization Rule. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param notificationHubName The notification hub name. + * @param authorizationRuleName The connection string of the NotificationHub for the specified authorizationRule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ResourceListKeysInner object + */ + public Observable regenerateKeysAsync(String resourceGroupName, String namespaceName, String notificationHubName, String authorizationRuleName) { + return regenerateKeysWithServiceResponseAsync(resourceGroupName, namespaceName, notificationHubName, authorizationRuleName).map(new Func1, ResourceListKeysInner>() { + @Override + public ResourceListKeysInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Regenerates the Primary/Secondary Keys to the NotificationHub Authorization Rule. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param notificationHubName The notification hub name. + * @param authorizationRuleName The connection string of the NotificationHub for the specified authorizationRule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ResourceListKeysInner object + */ + public Observable> regenerateKeysWithServiceResponseAsync(String resourceGroupName, String namespaceName, String notificationHubName, String authorizationRuleName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (namespaceName == null) { + throw new IllegalArgumentException("Parameter namespaceName is required and cannot be null."); + } + if (notificationHubName == null) { + throw new IllegalArgumentException("Parameter notificationHubName is required and cannot be null."); + } + if (authorizationRuleName == null) { + throw new IllegalArgumentException("Parameter authorizationRuleName is required and cannot be null."); + } + 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."); + } + final String policyKey = null; + PolicykeyResource parameters = new PolicykeyResource(); + parameters.withPolicyKey(null); + return service.regenerateKeys(resourceGroupName, namespaceName, notificationHubName, authorizationRuleName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), parameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = regenerateKeysDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Regenerates the Primary/Secondary Keys to the NotificationHub Authorization Rule. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param notificationHubName The notification hub name. + * @param authorizationRuleName The connection string of the NotificationHub for the specified authorizationRule. + * @param policyKey Name of the key that has to be regenerated for the Namespace/Notification Hub Authorization Rule. The value can be Primary Key/Secondary Key. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ResourceListKeysInner object if successful. + */ + public ResourceListKeysInner regenerateKeys(String resourceGroupName, String namespaceName, String notificationHubName, String authorizationRuleName, String policyKey) { + return regenerateKeysWithServiceResponseAsync(resourceGroupName, namespaceName, notificationHubName, authorizationRuleName, policyKey).toBlocking().single().body(); + } + + /** + * Regenerates the Primary/Secondary Keys to the NotificationHub Authorization Rule. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param notificationHubName The notification hub name. + * @param authorizationRuleName The connection string of the NotificationHub for the specified authorizationRule. + * @param policyKey Name of the key that has to be regenerated for the Namespace/Notification Hub Authorization Rule. The value can be Primary Key/Secondary Key. + * @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 regenerateKeysAsync(String resourceGroupName, String namespaceName, String notificationHubName, String authorizationRuleName, String policyKey, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(regenerateKeysWithServiceResponseAsync(resourceGroupName, namespaceName, notificationHubName, authorizationRuleName, policyKey), serviceCallback); + } + + /** + * Regenerates the Primary/Secondary Keys to the NotificationHub Authorization Rule. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param notificationHubName The notification hub name. + * @param authorizationRuleName The connection string of the NotificationHub for the specified authorizationRule. + * @param policyKey Name of the key that has to be regenerated for the Namespace/Notification Hub Authorization Rule. The value can be Primary Key/Secondary Key. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ResourceListKeysInner object + */ + public Observable regenerateKeysAsync(String resourceGroupName, String namespaceName, String notificationHubName, String authorizationRuleName, String policyKey) { + return regenerateKeysWithServiceResponseAsync(resourceGroupName, namespaceName, notificationHubName, authorizationRuleName, policyKey).map(new Func1, ResourceListKeysInner>() { + @Override + public ResourceListKeysInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Regenerates the Primary/Secondary Keys to the NotificationHub Authorization Rule. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param notificationHubName The notification hub name. + * @param authorizationRuleName The connection string of the NotificationHub for the specified authorizationRule. + * @param policyKey Name of the key that has to be regenerated for the Namespace/Notification Hub Authorization Rule. The value can be Primary Key/Secondary Key. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ResourceListKeysInner object + */ + public Observable> regenerateKeysWithServiceResponseAsync(String resourceGroupName, String namespaceName, String notificationHubName, String authorizationRuleName, String policyKey) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (namespaceName == null) { + throw new IllegalArgumentException("Parameter namespaceName is required and cannot be null."); + } + if (notificationHubName == null) { + throw new IllegalArgumentException("Parameter notificationHubName is required and cannot be null."); + } + if (authorizationRuleName == null) { + throw new IllegalArgumentException("Parameter authorizationRuleName is required and cannot be null."); + } + 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."); + } + PolicykeyResource parameters = new PolicykeyResource(); + parameters.withPolicyKey(policyKey); + return service.regenerateKeys(resourceGroupName, namespaceName, notificationHubName, authorizationRuleName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), parameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = regenerateKeysDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse regenerateKeysDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Lists the PNS Credentials associated with a notification hub . + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param notificationHubName The notification hub name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PnsCredentialsResourceInner object if successful. + */ + public PnsCredentialsResourceInner getPnsCredentials(String resourceGroupName, String namespaceName, String notificationHubName) { + return getPnsCredentialsWithServiceResponseAsync(resourceGroupName, namespaceName, notificationHubName).toBlocking().single().body(); + } + + /** + * Lists the PNS Credentials associated with a notification hub . + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param notificationHubName The notification hub name. + * @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 getPnsCredentialsAsync(String resourceGroupName, String namespaceName, String notificationHubName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getPnsCredentialsWithServiceResponseAsync(resourceGroupName, namespaceName, notificationHubName), serviceCallback); + } + + /** + * Lists the PNS Credentials associated with a notification hub . + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param notificationHubName The notification hub name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PnsCredentialsResourceInner object + */ + public Observable getPnsCredentialsAsync(String resourceGroupName, String namespaceName, String notificationHubName) { + return getPnsCredentialsWithServiceResponseAsync(resourceGroupName, namespaceName, notificationHubName).map(new Func1, PnsCredentialsResourceInner>() { + @Override + public PnsCredentialsResourceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Lists the PNS Credentials associated with a notification hub . + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param notificationHubName The notification hub name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PnsCredentialsResourceInner object + */ + public Observable> getPnsCredentialsWithServiceResponseAsync(String resourceGroupName, String namespaceName, String notificationHubName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (namespaceName == null) { + throw new IllegalArgumentException("Parameter namespaceName is required and cannot be null."); + } + if (notificationHubName == null) { + throw new IllegalArgumentException("Parameter notificationHubName is required and cannot be null."); + } + 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.getPnsCredentials(resourceGroupName, namespaceName, notificationHubName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getPnsCredentialsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getPnsCredentialsDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Lists the notification hubs associated with a namespace. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException 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<NotificationHubResourceInner> 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 the notification hubs associated with a namespace. + * + * @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 the notification hubs associated with a namespace. + * + * @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<NotificationHubResourceInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists the notification hubs associated with a namespace. + * + * @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<NotificationHubResourceInner> 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 the notification hubs associated with a namespace. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<NotificationHubResourceInner> 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 CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets the authorization rules for a NotificationHub. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException 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<SharedAccessAuthorizationRuleResourceInner> object if successful. + */ + public PagedList listAuthorizationRulesNext(final String nextPageLink) { + ServiceResponse> response = listAuthorizationRulesNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listAuthorizationRulesNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets the authorization rules for a NotificationHub. + * + * @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> listAuthorizationRulesNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listAuthorizationRulesNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listAuthorizationRulesNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets the authorization rules for a NotificationHub. + * + * @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<SharedAccessAuthorizationRuleResourceInner> object + */ + public Observable> listAuthorizationRulesNextAsync(final String nextPageLink) { + return listAuthorizationRulesNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets the authorization rules for a NotificationHub. + * + * @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<SharedAccessAuthorizationRuleResourceInner> object + */ + public Observable>> listAuthorizationRulesNextWithServiceResponseAsync(final String nextPageLink) { + return listAuthorizationRulesNextSinglePageAsync(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(listAuthorizationRulesNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets the authorization rules for a NotificationHub. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<SharedAccessAuthorizationRuleResourceInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listAuthorizationRulesNextSinglePageAsync(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.listAuthorizationRulesNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listAuthorizationRulesNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listAuthorizationRulesNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/notificationhubs/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2016_03_01/implementation/NotificationHubsManagementClientImpl.java b/notificationhubs/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2016_03_01/implementation/NotificationHubsManagementClientImpl.java new file mode 100644 index 000000000000..7972c9754f23 --- /dev/null +++ b/notificationhubs/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2016_03_01/implementation/NotificationHubsManagementClientImpl.java @@ -0,0 +1,210 @@ +/** + * 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.notificationhubs.v2016_03_01.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 NotificationHubsManagementClientImpl class. + */ +public class NotificationHubsManagementClientImpl 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; + } + + /** Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. */ + private String subscriptionId; + + /** + * Gets Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + * + * @return the subscriptionId value. + */ + public String subscriptionId() { + return this.subscriptionId; + } + + /** + * Sets Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + * + * @param subscriptionId the subscriptionId value. + * @return the service client itself + */ + public NotificationHubsManagementClientImpl withSubscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; + return this; + } + + /** Client Api Version. */ + private String apiVersion; + + /** + * Gets Client Api Version. + * + * @return the apiVersion value. + */ + public String apiVersion() { + return this.apiVersion; + } + + /** The preferred language for the response. */ + private String acceptLanguage; + + /** + * Gets The preferred language for the response. + * + * @return the acceptLanguage value. + */ + public String acceptLanguage() { + return this.acceptLanguage; + } + + /** + * Sets The preferred language for the response. + * + * @param acceptLanguage the acceptLanguage value. + * @return the service client itself + */ + public NotificationHubsManagementClientImpl 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 NotificationHubsManagementClientImpl 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 NotificationHubsManagementClientImpl withGenerateClientRequestId(boolean generateClientRequestId) { + this.generateClientRequestId = generateClientRequestId; + return this; + } + + /** + * The NamespacesInner object to access its operations. + */ + private NamespacesInner namespaces; + + /** + * Gets the NamespacesInner object to access its operations. + * @return the NamespacesInner object. + */ + public NamespacesInner namespaces() { + return this.namespaces; + } + + /** + * The NotificationHubsInner object to access its operations. + */ + private NotificationHubsInner notificationHubs; + + /** + * Gets the NotificationHubsInner object to access its operations. + * @return the NotificationHubsInner object. + */ + public NotificationHubsInner notificationHubs() { + return this.notificationHubs; + } + + /** + * Initializes an instance of NotificationHubsManagementClient client. + * + * @param credentials the management credentials for Azure + */ + public NotificationHubsManagementClientImpl(ServiceClientCredentials credentials) { + this("https://management.azure.com", credentials); + } + + /** + * Initializes an instance of NotificationHubsManagementClient client. + * + * @param baseUrl the base URL of the host + * @param credentials the management credentials for Azure + */ + public NotificationHubsManagementClientImpl(String baseUrl, ServiceClientCredentials credentials) { + super(baseUrl, credentials); + initialize(); + } + + /** + * Initializes an instance of NotificationHubsManagementClient client. + * + * @param restClient the REST client to connect to Azure. + */ + public NotificationHubsManagementClientImpl(RestClient restClient) { + super(restClient); + initialize(); + } + + protected void initialize() { + this.apiVersion = "2016-03-01"; + this.acceptLanguage = "en-US"; + this.longRunningOperationRetryTimeout = 30; + this.generateClientRequestId = true; + this.namespaces = new NamespacesInner(restClient().retrofit(), this); + this.notificationHubs = new NotificationHubsInner(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(), "NotificationHubsManagementClient", "2016-03-01"); + } +} diff --git a/notificationhubs/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2016_03_01/implementation/NotificationHubsManager.java b/notificationhubs/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2016_03_01/implementation/NotificationHubsManager.java new file mode 100644 index 000000000000..921c4a7bd31f --- /dev/null +++ b/notificationhubs/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2016_03_01/implementation/NotificationHubsManager.java @@ -0,0 +1,111 @@ +/** + * 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.notificationhubs.v2016_03_01.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.notificationhubs.v2016_03_01.Namespaces; +import com.microsoft.azure.management.notificationhubs.v2016_03_01.NotificationHubs; +import com.microsoft.azure.arm.resources.implementation.AzureConfigurableCoreImpl; +import com.microsoft.azure.arm.resources.implementation.ManagerCore; + +/** + * Entry point to Azure NotificationHubs resource management. + */ +public final class NotificationHubsManager extends ManagerCore { + private Namespaces namespaces; + private NotificationHubs notificationHubs; + /** + * Get a Configurable instance that can be used to create NotificationHubsManager with optional configuration. + * + * @return the instance allowing configurations + */ + public static Configurable configure() { + return new NotificationHubsManager.ConfigurableImpl(); + } + /** + * Creates an instance of NotificationHubsManager that exposes NotificationHubs resource management API entry points. + * + * @param credentials the credentials to use + * @param subscriptionId the subscription UUID + * @return the NotificationHubsManager + */ + public static NotificationHubsManager authenticate(AzureTokenCredentials credentials, String subscriptionId) { + return new NotificationHubsManager(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 NotificationHubsManager that exposes NotificationHubs resource management API entry points. + * + * @param restClient the RestClient to be used for API calls. + * @param subscriptionId the subscription UUID + * @return the NotificationHubsManager + */ + public static NotificationHubsManager authenticate(RestClient restClient, String subscriptionId) { + return new NotificationHubsManager(restClient, subscriptionId); + } + /** + * The interface allowing configurations to be set. + */ + public interface Configurable extends AzureConfigurable { + /** + * Creates an instance of NotificationHubsManager that exposes NotificationHubs management API entry points. + * + * @param credentials the credentials to use + * @param subscriptionId the subscription UUID + * @return the interface exposing NotificationHubs management API entry points that work across subscriptions + */ + NotificationHubsManager authenticate(AzureTokenCredentials credentials, String subscriptionId); + } + + /** + * @return Entry point to manage Namespaces. + */ + public Namespaces namespaces() { + if (this.namespaces == null) { + this.namespaces = new NamespacesImpl(this); + } + return this.namespaces; + } + + /** + * @return Entry point to manage NotificationHubs. + */ + public NotificationHubs notificationHubs() { + if (this.notificationHubs == null) { + this.notificationHubs = new NotificationHubsImpl(this); + } + return this.notificationHubs; + } + + /** + * The implementation for Configurable interface. + */ + private static final class ConfigurableImpl extends AzureConfigurableCoreImpl implements Configurable { + public NotificationHubsManager authenticate(AzureTokenCredentials credentials, String subscriptionId) { + return NotificationHubsManager.authenticate(buildRestClient(credentials), subscriptionId); + } + } + private NotificationHubsManager(RestClient restClient, String subscriptionId) { + super( + restClient, + subscriptionId, + new NotificationHubsManagementClientImpl(restClient).withSubscriptionId(subscriptionId)); + } +} diff --git a/notificationhubs/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2016_03_01/implementation/PageImpl.java b/notificationhubs/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2016_03_01/implementation/PageImpl.java new file mode 100644 index 000000000000..ebf3d7afd239 --- /dev/null +++ b/notificationhubs/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2016_03_01/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.notificationhubs.v2016_03_01.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/notificationhubs/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2016_03_01/implementation/PnsCredentialsResourceImpl.java b/notificationhubs/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2016_03_01/implementation/PnsCredentialsResourceImpl.java new file mode 100644 index 000000000000..2bd2ea0ccf57 --- /dev/null +++ b/notificationhubs/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2016_03_01/implementation/PnsCredentialsResourceImpl.java @@ -0,0 +1,94 @@ +/** + * 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.notificationhubs.v2016_03_01.implementation; + +import com.microsoft.azure.management.notificationhubs.v2016_03_01.PnsCredentialsResource; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.notificationhubs.v2016_03_01.AdmCredential; +import com.microsoft.azure.management.notificationhubs.v2016_03_01.ApnsCredential; +import com.microsoft.azure.management.notificationhubs.v2016_03_01.BaiduCredential; +import com.microsoft.azure.management.notificationhubs.v2016_03_01.GcmCredential; +import com.microsoft.azure.management.notificationhubs.v2016_03_01.MpnsCredential; +import com.microsoft.azure.management.notificationhubs.v2016_03_01.Sku; +import java.util.Map; +import com.microsoft.azure.management.notificationhubs.v2016_03_01.WnsCredential; + +class PnsCredentialsResourceImpl extends WrapperImpl implements PnsCredentialsResource { + private final NotificationHubsManager manager; + PnsCredentialsResourceImpl(PnsCredentialsResourceInner inner, NotificationHubsManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public NotificationHubsManager manager() { + return this.manager; + } + + @Override + public AdmCredential admCredential() { + return this.inner().admCredential(); + } + + @Override + public ApnsCredential apnsCredential() { + return this.inner().apnsCredential(); + } + + @Override + public BaiduCredential baiduCredential() { + return this.inner().baiduCredential(); + } + + @Override + public GcmCredential gcmCredential() { + return this.inner().gcmCredential(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String location() { + return this.inner().location(); + } + + @Override + public MpnsCredential mpnsCredential() { + return this.inner().mpnsCredential(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public Sku sku() { + return this.inner().sku(); + } + + @Override + public Map tags() { + return this.inner().getTags(); + } + + @Override + public String type() { + return this.inner().type(); + } + + @Override + public WnsCredential wnsCredential() { + return this.inner().wnsCredential(); + } + +} diff --git a/notificationhubs/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2016_03_01/implementation/PnsCredentialsResourceInner.java b/notificationhubs/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2016_03_01/implementation/PnsCredentialsResourceInner.java new file mode 100644 index 000000000000..4f18a221002e --- /dev/null +++ b/notificationhubs/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2016_03_01/implementation/PnsCredentialsResourceInner.java @@ -0,0 +1,209 @@ +/** + * 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.notificationhubs.v2016_03_01.implementation; + +import com.microsoft.azure.management.notificationhubs.v2016_03_01.ApnsCredential; +import com.microsoft.azure.management.notificationhubs.v2016_03_01.WnsCredential; +import com.microsoft.azure.management.notificationhubs.v2016_03_01.GcmCredential; +import com.microsoft.azure.management.notificationhubs.v2016_03_01.MpnsCredential; +import com.microsoft.azure.management.notificationhubs.v2016_03_01.AdmCredential; +import com.microsoft.azure.management.notificationhubs.v2016_03_01.BaiduCredential; +import com.microsoft.azure.management.notificationhubs.v2016_03_01.Sku; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.Resource; + +/** + * Description of a NotificationHub PNS Credentials. + */ +@JsonFlatten +public class PnsCredentialsResourceInner extends Resource { + /** + * The ApnsCredential of the created NotificationHub. + */ + @JsonProperty(value = "properties.apnsCredential") + private ApnsCredential apnsCredential; + + /** + * The WnsCredential of the created NotificationHub. + */ + @JsonProperty(value = "properties.wnsCredential") + private WnsCredential wnsCredential; + + /** + * The GcmCredential of the created NotificationHub. + */ + @JsonProperty(value = "properties.gcmCredential") + private GcmCredential gcmCredential; + + /** + * The MpnsCredential of the created NotificationHub. + */ + @JsonProperty(value = "properties.mpnsCredential") + private MpnsCredential mpnsCredential; + + /** + * The AdmCredential of the created NotificationHub. + */ + @JsonProperty(value = "properties.admCredential") + private AdmCredential admCredential; + + /** + * The BaiduCredential of the created NotificationHub. + */ + @JsonProperty(value = "properties.baiduCredential") + private BaiduCredential baiduCredential; + + /** + * The sku of the created namespace. + */ + @JsonProperty(value = "sku") + private Sku sku; + + /** + * Get the ApnsCredential of the created NotificationHub. + * + * @return the apnsCredential value + */ + public ApnsCredential apnsCredential() { + return this.apnsCredential; + } + + /** + * Set the ApnsCredential of the created NotificationHub. + * + * @param apnsCredential the apnsCredential value to set + * @return the PnsCredentialsResourceInner object itself. + */ + public PnsCredentialsResourceInner withApnsCredential(ApnsCredential apnsCredential) { + this.apnsCredential = apnsCredential; + return this; + } + + /** + * Get the WnsCredential of the created NotificationHub. + * + * @return the wnsCredential value + */ + public WnsCredential wnsCredential() { + return this.wnsCredential; + } + + /** + * Set the WnsCredential of the created NotificationHub. + * + * @param wnsCredential the wnsCredential value to set + * @return the PnsCredentialsResourceInner object itself. + */ + public PnsCredentialsResourceInner withWnsCredential(WnsCredential wnsCredential) { + this.wnsCredential = wnsCredential; + return this; + } + + /** + * Get the GcmCredential of the created NotificationHub. + * + * @return the gcmCredential value + */ + public GcmCredential gcmCredential() { + return this.gcmCredential; + } + + /** + * Set the GcmCredential of the created NotificationHub. + * + * @param gcmCredential the gcmCredential value to set + * @return the PnsCredentialsResourceInner object itself. + */ + public PnsCredentialsResourceInner withGcmCredential(GcmCredential gcmCredential) { + this.gcmCredential = gcmCredential; + return this; + } + + /** + * Get the MpnsCredential of the created NotificationHub. + * + * @return the mpnsCredential value + */ + public MpnsCredential mpnsCredential() { + return this.mpnsCredential; + } + + /** + * Set the MpnsCredential of the created NotificationHub. + * + * @param mpnsCredential the mpnsCredential value to set + * @return the PnsCredentialsResourceInner object itself. + */ + public PnsCredentialsResourceInner withMpnsCredential(MpnsCredential mpnsCredential) { + this.mpnsCredential = mpnsCredential; + return this; + } + + /** + * Get the AdmCredential of the created NotificationHub. + * + * @return the admCredential value + */ + public AdmCredential admCredential() { + return this.admCredential; + } + + /** + * Set the AdmCredential of the created NotificationHub. + * + * @param admCredential the admCredential value to set + * @return the PnsCredentialsResourceInner object itself. + */ + public PnsCredentialsResourceInner withAdmCredential(AdmCredential admCredential) { + this.admCredential = admCredential; + return this; + } + + /** + * Get the BaiduCredential of the created NotificationHub. + * + * @return the baiduCredential value + */ + public BaiduCredential baiduCredential() { + return this.baiduCredential; + } + + /** + * Set the BaiduCredential of the created NotificationHub. + * + * @param baiduCredential the baiduCredential value to set + * @return the PnsCredentialsResourceInner object itself. + */ + public PnsCredentialsResourceInner withBaiduCredential(BaiduCredential baiduCredential) { + this.baiduCredential = baiduCredential; + return this; + } + + /** + * Get the sku of the created namespace. + * + * @return the sku value + */ + public Sku sku() { + return this.sku; + } + + /** + * Set the sku of the created namespace. + * + * @param sku the sku value to set + * @return the PnsCredentialsResourceInner object itself. + */ + public PnsCredentialsResourceInner withSku(Sku sku) { + this.sku = sku; + return this; + } + +} diff --git a/notificationhubs/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2016_03_01/implementation/ResourceListKeysImpl.java b/notificationhubs/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2016_03_01/implementation/ResourceListKeysImpl.java new file mode 100644 index 000000000000..cd2b82a2f964 --- /dev/null +++ b/notificationhubs/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2016_03_01/implementation/ResourceListKeysImpl.java @@ -0,0 +1,51 @@ +/** + * 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.notificationhubs.v2016_03_01.implementation; + +import com.microsoft.azure.management.notificationhubs.v2016_03_01.ResourceListKeys; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; + +class ResourceListKeysImpl extends WrapperImpl implements ResourceListKeys { + private final NotificationHubsManager manager; + ResourceListKeysImpl(ResourceListKeysInner inner, NotificationHubsManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public NotificationHubsManager manager() { + return this.manager; + } + + @Override + public String keyName() { + return this.inner().keyName(); + } + + @Override + public String primaryConnectionString() { + return this.inner().primaryConnectionString(); + } + + @Override + public String primaryKey() { + return this.inner().primaryKey(); + } + + @Override + public String secondaryConnectionString() { + return this.inner().secondaryConnectionString(); + } + + @Override + public String secondaryKey() { + return this.inner().secondaryKey(); + } + +} diff --git a/notificationhubs/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2016_03_01/implementation/ResourceListKeysInner.java b/notificationhubs/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2016_03_01/implementation/ResourceListKeysInner.java new file mode 100644 index 000000000000..a9d2e00f22b1 --- /dev/null +++ b/notificationhubs/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2016_03_01/implementation/ResourceListKeysInner.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.notificationhubs.v2016_03_01.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Namespace/NotificationHub Connection String. + */ +public class ResourceListKeysInner { + /** + * PrimaryConnectionString of the AuthorizationRule. + */ + @JsonProperty(value = "primaryConnectionString") + private String primaryConnectionString; + + /** + * SecondaryConnectionString of the created AuthorizationRule. + */ + @JsonProperty(value = "secondaryConnectionString") + private String secondaryConnectionString; + + /** + * PrimaryKey of the created AuthorizationRule. + */ + @JsonProperty(value = "primaryKey") + private String primaryKey; + + /** + * SecondaryKey of the created AuthorizationRule. + */ + @JsonProperty(value = "secondaryKey") + private String secondaryKey; + + /** + * KeyName of the created AuthorizationRule. + */ + @JsonProperty(value = "keyName") + private String keyName; + + /** + * Get primaryConnectionString of the AuthorizationRule. + * + * @return the primaryConnectionString value + */ + public String primaryConnectionString() { + return this.primaryConnectionString; + } + + /** + * Set primaryConnectionString of the AuthorizationRule. + * + * @param primaryConnectionString the primaryConnectionString value to set + * @return the ResourceListKeysInner object itself. + */ + public ResourceListKeysInner withPrimaryConnectionString(String primaryConnectionString) { + this.primaryConnectionString = primaryConnectionString; + return this; + } + + /** + * Get secondaryConnectionString of the created AuthorizationRule. + * + * @return the secondaryConnectionString value + */ + public String secondaryConnectionString() { + return this.secondaryConnectionString; + } + + /** + * Set secondaryConnectionString of the created AuthorizationRule. + * + * @param secondaryConnectionString the secondaryConnectionString value to set + * @return the ResourceListKeysInner object itself. + */ + public ResourceListKeysInner withSecondaryConnectionString(String secondaryConnectionString) { + this.secondaryConnectionString = secondaryConnectionString; + return this; + } + + /** + * Get primaryKey of the created AuthorizationRule. + * + * @return the primaryKey value + */ + public String primaryKey() { + return this.primaryKey; + } + + /** + * Set primaryKey of the created AuthorizationRule. + * + * @param primaryKey the primaryKey value to set + * @return the ResourceListKeysInner object itself. + */ + public ResourceListKeysInner withPrimaryKey(String primaryKey) { + this.primaryKey = primaryKey; + return this; + } + + /** + * Get secondaryKey of the created AuthorizationRule. + * + * @return the secondaryKey value + */ + public String secondaryKey() { + return this.secondaryKey; + } + + /** + * Set secondaryKey of the created AuthorizationRule. + * + * @param secondaryKey the secondaryKey value to set + * @return the ResourceListKeysInner object itself. + */ + public ResourceListKeysInner withSecondaryKey(String secondaryKey) { + this.secondaryKey = secondaryKey; + return this; + } + + /** + * Get keyName of the created AuthorizationRule. + * + * @return the keyName value + */ + public String keyName() { + return this.keyName; + } + + /** + * Set keyName of the created AuthorizationRule. + * + * @param keyName the keyName value to set + * @return the ResourceListKeysInner object itself. + */ + public ResourceListKeysInner withKeyName(String keyName) { + this.keyName = keyName; + return this; + } + +} diff --git a/notificationhubs/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2016_03_01/implementation/SharedAccessAuthorizationRuleResourceInner.java b/notificationhubs/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2016_03_01/implementation/SharedAccessAuthorizationRuleResourceInner.java new file mode 100644 index 000000000000..362162a38cfd --- /dev/null +++ b/notificationhubs/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2016_03_01/implementation/SharedAccessAuthorizationRuleResourceInner.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.notificationhubs.v2016_03_01.implementation; + +import java.util.List; +import com.microsoft.azure.management.notificationhubs.v2016_03_01.AccessRights; +import com.microsoft.azure.management.notificationhubs.v2016_03_01.Sku; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.Resource; + +/** + * Description of a Namespace AuthorizationRules. + */ +@JsonFlatten +public class SharedAccessAuthorizationRuleResourceInner extends Resource { + /** + * The rights associated with the rule. + */ + @JsonProperty(value = "properties.rights") + private List rights; + + /** + * The sku of the created namespace. + */ + @JsonProperty(value = "sku") + private Sku sku; + + /** + * Get the rights associated with the rule. + * + * @return the rights value + */ + public List rights() { + return this.rights; + } + + /** + * Set the rights associated with the rule. + * + * @param rights the rights value to set + * @return the SharedAccessAuthorizationRuleResourceInner object itself. + */ + public SharedAccessAuthorizationRuleResourceInner withRights(List rights) { + this.rights = rights; + return this; + } + + /** + * Get the sku of the created namespace. + * + * @return the sku value + */ + public Sku sku() { + return this.sku; + } + + /** + * Set the sku of the created namespace. + * + * @param sku the sku value to set + * @return the SharedAccessAuthorizationRuleResourceInner object itself. + */ + public SharedAccessAuthorizationRuleResourceInner withSku(Sku sku) { + this.sku = sku; + return this; + } + +} diff --git a/notificationhubs/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2016_03_01/implementation/package-info.java b/notificationhubs/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2016_03_01/implementation/package-info.java new file mode 100644 index 000000000000..ba4fec4fb5b7 --- /dev/null +++ b/notificationhubs/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2016_03_01/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 NotificationHubsManagementClient. + * Azure NotificationHub client. + */ +package com.microsoft.azure.management.notificationhubs.v2016_03_01.implementation; diff --git a/notificationhubs/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2016_03_01/package-info.java b/notificationhubs/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2016_03_01/package-info.java new file mode 100644 index 000000000000..a576a3c99f44 --- /dev/null +++ b/notificationhubs/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2016_03_01/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 NotificationHubsManagementClient. + * Azure NotificationHub client. + */ +package com.microsoft.azure.management.notificationhubs.v2016_03_01; diff --git a/notificationhubs/resource-manager/v2017_04_01/pom.xml b/notificationhubs/resource-manager/v2017_04_01/pom.xml new file mode 100644 index 000000000000..58b7afc55e2c --- /dev/null +++ b/notificationhubs/resource-manager/v2017_04_01/pom.xml @@ -0,0 +1,133 @@ + + + 4.0.0 + com.microsoft.azure.notificationhubs.v2017_04_01 + + com.microsoft.azure + azure-arm-parent + 0.0.2-beta + ../../../pom.xml + + azure-mgmt-notificationhubs + 1.0.0-beta + jar + Microsoft Azure SDK for NotificationHubs Management + This package contains Microsoft NotificationHubs 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/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/AccessRights.java b/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/AccessRights.java new file mode 100644 index 000000000000..1fd290f292d3 --- /dev/null +++ b/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/AccessRights.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.notificationhubs.v2017_04_01; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for AccessRights. + */ +public enum AccessRights { + /** Enum value Manage. */ + MANAGE("Manage"), + + /** Enum value Send. */ + SEND("Send"), + + /** Enum value Listen. */ + LISTEN("Listen"); + + /** The actual serialized value for a AccessRights instance. */ + private String value; + + AccessRights(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a AccessRights instance. + * + * @param value the serialized value to parse. + * @return the parsed AccessRights object, or null if unable to parse. + */ + @JsonCreator + public static AccessRights fromString(String value) { + AccessRights[] items = AccessRights.values(); + for (AccessRights item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/AdmCredential.java b/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/AdmCredential.java new file mode 100644 index 000000000000..5ba7d24ac9ea --- /dev/null +++ b/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/AdmCredential.java @@ -0,0 +1,97 @@ +/** + * 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.notificationhubs.v2017_04_01; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * Description of a NotificationHub AdmCredential. + */ +@JsonFlatten +public class AdmCredential { + /** + * The client identifier. + */ + @JsonProperty(value = "properties.clientId") + private String clientId; + + /** + * The credential secret access key. + */ + @JsonProperty(value = "properties.clientSecret") + private String clientSecret; + + /** + * The URL of the authorization token. + */ + @JsonProperty(value = "properties.authTokenUrl") + private String authTokenUrl; + + /** + * Get the client identifier. + * + * @return the clientId value + */ + public String clientId() { + return this.clientId; + } + + /** + * Set the client identifier. + * + * @param clientId the clientId value to set + * @return the AdmCredential object itself. + */ + public AdmCredential withClientId(String clientId) { + this.clientId = clientId; + return this; + } + + /** + * Get the credential secret access key. + * + * @return the clientSecret value + */ + public String clientSecret() { + return this.clientSecret; + } + + /** + * Set the credential secret access key. + * + * @param clientSecret the clientSecret value to set + * @return the AdmCredential object itself. + */ + public AdmCredential withClientSecret(String clientSecret) { + this.clientSecret = clientSecret; + return this; + } + + /** + * Get the URL of the authorization token. + * + * @return the authTokenUrl value + */ + public String authTokenUrl() { + return this.authTokenUrl; + } + + /** + * Set the URL of the authorization token. + * + * @param authTokenUrl the authTokenUrl value to set + * @return the AdmCredential object itself. + */ + public AdmCredential withAuthTokenUrl(String authTokenUrl) { + this.authTokenUrl = authTokenUrl; + return this; + } + +} diff --git a/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/ApnsCredential.java b/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/ApnsCredential.java new file mode 100644 index 000000000000..5b7a2717f93c --- /dev/null +++ b/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/ApnsCredential.java @@ -0,0 +1,229 @@ +/** + * 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.notificationhubs.v2017_04_01; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * Description of a NotificationHub ApnsCredential. + */ +@JsonFlatten +public class ApnsCredential { + /** + * The APNS certificate. + */ + @JsonProperty(value = "properties.apnsCertificate") + private String apnsCertificate; + + /** + * The certificate key. + */ + @JsonProperty(value = "properties.certificateKey") + private String certificateKey; + + /** + * The endpoint of this credential. + */ + @JsonProperty(value = "properties.endpoint") + private String endpoint; + + /** + * The Apns certificate Thumbprint. + */ + @JsonProperty(value = "properties.thumbprint") + private String thumbprint; + + /** + * A 10-character key identifier (kid) key, obtained from your developer + * account. + */ + @JsonProperty(value = "properties.keyId") + private String keyId; + + /** + * The name of the application. + */ + @JsonProperty(value = "properties.appName") + private String appName; + + /** + * The issuer (iss) registered claim key, whose value is your 10-character + * Team ID, obtained from your developer account. + */ + @JsonProperty(value = "properties.appId") + private String appId; + + /** + * Provider Authentication Token, obtained through your developer account. + */ + @JsonProperty(value = "properties.token") + private String token; + + /** + * Get the APNS certificate. + * + * @return the apnsCertificate value + */ + public String apnsCertificate() { + return this.apnsCertificate; + } + + /** + * Set the APNS certificate. + * + * @param apnsCertificate the apnsCertificate value to set + * @return the ApnsCredential object itself. + */ + public ApnsCredential withApnsCertificate(String apnsCertificate) { + this.apnsCertificate = apnsCertificate; + return this; + } + + /** + * Get the certificate key. + * + * @return the certificateKey value + */ + public String certificateKey() { + return this.certificateKey; + } + + /** + * Set the certificate key. + * + * @param certificateKey the certificateKey value to set + * @return the ApnsCredential object itself. + */ + public ApnsCredential withCertificateKey(String certificateKey) { + this.certificateKey = certificateKey; + return this; + } + + /** + * Get the endpoint of this credential. + * + * @return the endpoint value + */ + public String endpoint() { + return this.endpoint; + } + + /** + * Set the endpoint of this credential. + * + * @param endpoint the endpoint value to set + * @return the ApnsCredential object itself. + */ + public ApnsCredential withEndpoint(String endpoint) { + this.endpoint = endpoint; + return this; + } + + /** + * Get the Apns certificate Thumbprint. + * + * @return the thumbprint value + */ + public String thumbprint() { + return this.thumbprint; + } + + /** + * Set the Apns certificate Thumbprint. + * + * @param thumbprint the thumbprint value to set + * @return the ApnsCredential object itself. + */ + public ApnsCredential withThumbprint(String thumbprint) { + this.thumbprint = thumbprint; + return this; + } + + /** + * Get a 10-character key identifier (kid) key, obtained from your developer account. + * + * @return the keyId value + */ + public String keyId() { + return this.keyId; + } + + /** + * Set a 10-character key identifier (kid) key, obtained from your developer account. + * + * @param keyId the keyId value to set + * @return the ApnsCredential object itself. + */ + public ApnsCredential withKeyId(String keyId) { + this.keyId = keyId; + return this; + } + + /** + * Get the name of the application. + * + * @return the appName value + */ + public String appName() { + return this.appName; + } + + /** + * Set the name of the application. + * + * @param appName the appName value to set + * @return the ApnsCredential object itself. + */ + public ApnsCredential withAppName(String appName) { + this.appName = appName; + return this; + } + + /** + * Get the issuer (iss) registered claim key, whose value is your 10-character Team ID, obtained from your developer account. + * + * @return the appId value + */ + public String appId() { + return this.appId; + } + + /** + * Set the issuer (iss) registered claim key, whose value is your 10-character Team ID, obtained from your developer account. + * + * @param appId the appId value to set + * @return the ApnsCredential object itself. + */ + public ApnsCredential withAppId(String appId) { + this.appId = appId; + return this; + } + + /** + * Get provider Authentication Token, obtained through your developer account. + * + * @return the token value + */ + public String token() { + return this.token; + } + + /** + * Set provider Authentication Token, obtained through your developer account. + * + * @param token the token value to set + * @return the ApnsCredential object itself. + */ + public ApnsCredential withToken(String token) { + this.token = token; + return this; + } + +} diff --git a/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/BaiduCredential.java b/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/BaiduCredential.java new file mode 100644 index 000000000000..740908f33b46 --- /dev/null +++ b/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/BaiduCredential.java @@ -0,0 +1,97 @@ +/** + * 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.notificationhubs.v2017_04_01; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * Description of a NotificationHub BaiduCredential. + */ +@JsonFlatten +public class BaiduCredential { + /** + * Baidu Api Key. + */ + @JsonProperty(value = "properties.baiduApiKey") + private String baiduApiKey; + + /** + * Baidu Endpoint. + */ + @JsonProperty(value = "properties.baiduEndPoint") + private String baiduEndPoint; + + /** + * Baidu Secret Key. + */ + @JsonProperty(value = "properties.baiduSecretKey") + private String baiduSecretKey; + + /** + * Get baidu Api Key. + * + * @return the baiduApiKey value + */ + public String baiduApiKey() { + return this.baiduApiKey; + } + + /** + * Set baidu Api Key. + * + * @param baiduApiKey the baiduApiKey value to set + * @return the BaiduCredential object itself. + */ + public BaiduCredential withBaiduApiKey(String baiduApiKey) { + this.baiduApiKey = baiduApiKey; + return this; + } + + /** + * Get baidu Endpoint. + * + * @return the baiduEndPoint value + */ + public String baiduEndPoint() { + return this.baiduEndPoint; + } + + /** + * Set baidu Endpoint. + * + * @param baiduEndPoint the baiduEndPoint value to set + * @return the BaiduCredential object itself. + */ + public BaiduCredential withBaiduEndPoint(String baiduEndPoint) { + this.baiduEndPoint = baiduEndPoint; + return this; + } + + /** + * Get baidu Secret Key. + * + * @return the baiduSecretKey value + */ + public String baiduSecretKey() { + return this.baiduSecretKey; + } + + /** + * Set baidu Secret Key. + * + * @param baiduSecretKey the baiduSecretKey value to set + * @return the BaiduCredential object itself. + */ + public BaiduCredential withBaiduSecretKey(String baiduSecretKey) { + this.baiduSecretKey = baiduSecretKey; + return this; + } + +} diff --git a/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/CheckAvailabilityParameters.java b/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/CheckAvailabilityParameters.java new file mode 100644 index 000000000000..d2cb25f35f04 --- /dev/null +++ b/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/CheckAvailabilityParameters.java @@ -0,0 +1,180 @@ +/** + * 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.notificationhubs.v2017_04_01; + +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Parameters supplied to the Check Name Availability for Namespace and + * NotificationHubs. + */ +public class CheckAvailabilityParameters { + /** + * Resource Id. + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /** + * Resource name. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /** + * Resource type. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /** + * Resource location. + */ + @JsonProperty(value = "location") + private String location; + + /** + * Resource tags. + */ + @JsonProperty(value = "tags") + private Map tags; + + /** + * The sku of the created namespace. + */ + @JsonProperty(value = "sku") + private Sku sku; + + /** + * True if the name is available and can be used to create new + * Namespace/NotificationHub. Otherwise false. + */ + @JsonProperty(value = "isAvailiable") + private Boolean isAvailiable; + + /** + * Get resource Id. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Get resource name. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set resource name. + * + * @param name the name value to set + * @return the CheckAvailabilityParameters object itself. + */ + public CheckAvailabilityParameters withName(String name) { + this.name = name; + return this; + } + + /** + * Get resource type. + * + * @return the type value + */ + public String type() { + return this.type; + } + + /** + * Get resource location. + * + * @return the location value + */ + public String location() { + return this.location; + } + + /** + * Set resource location. + * + * @param location the location value to set + * @return the CheckAvailabilityParameters object itself. + */ + public CheckAvailabilityParameters withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get resource tags. + * + * @return the tags value + */ + public Map tags() { + return this.tags; + } + + /** + * Set resource tags. + * + * @param tags the tags value to set + * @return the CheckAvailabilityParameters object itself. + */ + public CheckAvailabilityParameters withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Get the sku of the created namespace. + * + * @return the sku value + */ + public Sku sku() { + return this.sku; + } + + /** + * Set the sku of the created namespace. + * + * @param sku the sku value to set + * @return the CheckAvailabilityParameters object itself. + */ + public CheckAvailabilityParameters withSku(Sku sku) { + this.sku = sku; + return this; + } + + /** + * Get true if the name is available and can be used to create new Namespace/NotificationHub. Otherwise false. + * + * @return the isAvailiable value + */ + public Boolean isAvailiable() { + return this.isAvailiable; + } + + /** + * Set true if the name is available and can be used to create new Namespace/NotificationHub. Otherwise false. + * + * @param isAvailiable the isAvailiable value to set + * @return the CheckAvailabilityParameters object itself. + */ + public CheckAvailabilityParameters withIsAvailiable(Boolean isAvailiable) { + this.isAvailiable = isAvailiable; + return this; + } + +} diff --git a/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/CheckAvailabilityResult.java b/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/CheckAvailabilityResult.java new file mode 100644 index 000000000000..10bedc6297b9 --- /dev/null +++ b/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/CheckAvailabilityResult.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.notificationhubs.v2017_04_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.notificationhubs.v2017_04_01.implementation.NotificationHubsManager; +import com.microsoft.azure.management.notificationhubs.v2017_04_01.implementation.CheckAvailabilityResultInner; +import java.util.Map; + +/** + * Type representing CheckAvailabilityResult. + */ +public interface CheckAvailabilityResult extends HasInner, HasManager { + /** + * @return the id value. + */ + String id(); + + /** + * @return the isAvailiable value. + */ + Boolean isAvailiable(); + + /** + * @return the location value. + */ + String location(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the sku value. + */ + Sku sku(); + + /** + * @return the tags value. + */ + Map tags(); + + /** + * @return the type value. + */ + String type(); + +} diff --git a/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/DebugSendResponse.java b/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/DebugSendResponse.java new file mode 100644 index 000000000000..74c36d7d152b --- /dev/null +++ b/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/DebugSendResponse.java @@ -0,0 +1,66 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.notificationhubs.v2017_04_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.notificationhubs.v2017_04_01.implementation.NotificationHubsManager; +import com.microsoft.azure.management.notificationhubs.v2017_04_01.implementation.DebugSendResponseInner; +import java.util.Map; + +/** + * Type representing DebugSendResponse. + */ +public interface DebugSendResponse extends HasInner, HasManager { + /** + * @return the failure value. + */ + Double failure(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the location value. + */ + String location(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the results value. + */ + Object results(); + + /** + * @return the sku value. + */ + Sku sku(); + + /** + * @return the success value. + */ + Double success(); + + /** + * @return the tags value. + */ + Map tags(); + + /** + * @return the type value. + */ + String type(); + +} diff --git a/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/ErrorResponse.java b/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/ErrorResponse.java new file mode 100644 index 000000000000..bfc46084a8a5 --- /dev/null +++ b/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/ErrorResponse.java @@ -0,0 +1,70 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.notificationhubs.v2017_04_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Error reponse indicates NotificationHubs service is not able to process the + * incoming request. The reason is provided in the error message. + */ +public class ErrorResponse { + /** + * Error code. + */ + @JsonProperty(value = "code") + private String code; + + /** + * Error message indicating why the operation failed. + */ + @JsonProperty(value = "message") + private String message; + + /** + * Get error code. + * + * @return the code value + */ + public String code() { + return this.code; + } + + /** + * Set error code. + * + * @param code the code value to set + * @return the ErrorResponse object itself. + */ + public ErrorResponse withCode(String code) { + this.code = code; + return this; + } + + /** + * Get error message indicating why the operation failed. + * + * @return the message value + */ + public String message() { + return this.message; + } + + /** + * Set error message indicating why the operation failed. + * + * @param message the message value to set + * @return the ErrorResponse object itself. + */ + public ErrorResponse withMessage(String message) { + this.message = message; + return this; + } + +} diff --git a/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/ErrorResponseException.java b/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/ErrorResponseException.java new file mode 100644 index 000000000000..e88744505309 --- /dev/null +++ b/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/ErrorResponseException.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.notificationhubs.v2017_04_01; + +import com.microsoft.rest.RestException; +import okhttp3.ResponseBody; +import retrofit2.Response; + +/** + * Exception thrown for an invalid response with ErrorResponse information. + */ +public class ErrorResponseException extends RestException { + /** + * Initializes a new instance of the ErrorResponseException class. + * + * @param message the exception message or the response content if a message is not available + * @param response the HTTP response + */ + public ErrorResponseException(final String message, final Response response) { + super(message, response); + } + + /** + * Initializes a new instance of the ErrorResponseException 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 ErrorResponseException(final String message, final Response response, final ErrorResponse body) { + super(message, response, body); + } + + @Override + public ErrorResponse body() { + return (ErrorResponse) super.body(); + } +} diff --git a/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/GcmCredential.java b/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/GcmCredential.java new file mode 100644 index 000000000000..db1271e4f1af --- /dev/null +++ b/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/GcmCredential.java @@ -0,0 +1,71 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.notificationhubs.v2017_04_01; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * Description of a NotificationHub GcmCredential. + */ +@JsonFlatten +public class GcmCredential { + /** + * The GCM endpoint. + */ + @JsonProperty(value = "properties.gcmEndpoint") + private String gcmEndpoint; + + /** + * The Google API key. + */ + @JsonProperty(value = "properties.googleApiKey") + private String googleApiKey; + + /** + * Get the GCM endpoint. + * + * @return the gcmEndpoint value + */ + public String gcmEndpoint() { + return this.gcmEndpoint; + } + + /** + * Set the GCM endpoint. + * + * @param gcmEndpoint the gcmEndpoint value to set + * @return the GcmCredential object itself. + */ + public GcmCredential withGcmEndpoint(String gcmEndpoint) { + this.gcmEndpoint = gcmEndpoint; + return this; + } + + /** + * Get the Google API key. + * + * @return the googleApiKey value + */ + public String googleApiKey() { + return this.googleApiKey; + } + + /** + * Set the Google API key. + * + * @param googleApiKey the googleApiKey value to set + * @return the GcmCredential object itself. + */ + public GcmCredential withGoogleApiKey(String googleApiKey) { + this.googleApiKey = googleApiKey; + return this; + } + +} diff --git a/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/MpnsCredential.java b/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/MpnsCredential.java new file mode 100644 index 000000000000..4ecac2bceeb2 --- /dev/null +++ b/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/MpnsCredential.java @@ -0,0 +1,97 @@ +/** + * 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.notificationhubs.v2017_04_01; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * Description of a NotificationHub MpnsCredential. + */ +@JsonFlatten +public class MpnsCredential { + /** + * The MPNS certificate. + */ + @JsonProperty(value = "properties.mpnsCertificate") + private String mpnsCertificate; + + /** + * The certificate key for this credential. + */ + @JsonProperty(value = "properties.certificateKey") + private String certificateKey; + + /** + * The Mpns certificate Thumbprint. + */ + @JsonProperty(value = "properties.thumbprint") + private String thumbprint; + + /** + * Get the MPNS certificate. + * + * @return the mpnsCertificate value + */ + public String mpnsCertificate() { + return this.mpnsCertificate; + } + + /** + * Set the MPNS certificate. + * + * @param mpnsCertificate the mpnsCertificate value to set + * @return the MpnsCredential object itself. + */ + public MpnsCredential withMpnsCertificate(String mpnsCertificate) { + this.mpnsCertificate = mpnsCertificate; + return this; + } + + /** + * Get the certificate key for this credential. + * + * @return the certificateKey value + */ + public String certificateKey() { + return this.certificateKey; + } + + /** + * Set the certificate key for this credential. + * + * @param certificateKey the certificateKey value to set + * @return the MpnsCredential object itself. + */ + public MpnsCredential withCertificateKey(String certificateKey) { + this.certificateKey = certificateKey; + return this; + } + + /** + * Get the Mpns certificate Thumbprint. + * + * @return the thumbprint value + */ + public String thumbprint() { + return this.thumbprint; + } + + /** + * Set the Mpns certificate Thumbprint. + * + * @param thumbprint the thumbprint value to set + * @return the MpnsCredential object itself. + */ + public MpnsCredential withThumbprint(String thumbprint) { + this.thumbprint = thumbprint; + return this; + } + +} diff --git a/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/NamespaceCreateOrUpdateParameters.java b/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/NamespaceCreateOrUpdateParameters.java new file mode 100644 index 000000000000..4202c237c265 --- /dev/null +++ b/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/NamespaceCreateOrUpdateParameters.java @@ -0,0 +1,408 @@ +/** + * 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.notificationhubs.v2017_04_01; + +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.rest.SkipParentValidation; +import com.microsoft.azure.Resource; + +/** + * Parameters supplied to the CreateOrUpdate Namespace operation. + */ +@JsonFlatten +@SkipParentValidation +public class NamespaceCreateOrUpdateParameters extends Resource { + /** + * The name of the namespace. + */ + @JsonProperty(value = "properties.name") + private String namespaceCreateOrUpdateParametersName; + + /** + * Provisioning state of the Namespace. + */ + @JsonProperty(value = "properties.provisioningState") + private String provisioningState; + + /** + * Specifies the targeted region in which the namespace should be created. + * It can be any of the following values: Australia EastAustralia + * SoutheastCentral USEast USEast US 2West USNorth Central USSouth Central + * USEast AsiaSoutheast AsiaBrazil SouthJapan EastJapan WestNorth + * EuropeWest Europe. + */ + @JsonProperty(value = "properties.region") + private String region; + + /** + * Identifier for Azure Insights metrics. + */ + @JsonProperty(value = "properties.metricId", access = JsonProperty.Access.WRITE_ONLY) + private String metricId; + + /** + * Status of the namespace. It can be any of these values:1 = + * Created/Active2 = Creating3 = Suspended4 = Deleting. + */ + @JsonProperty(value = "properties.status") + private String status; + + /** + * The time the namespace was created. + */ + @JsonProperty(value = "properties.createdAt") + private DateTime createdAt; + + /** + * The time the namespace was updated. + */ + @JsonProperty(value = "properties.updatedAt") + private DateTime updatedAt; + + /** + * Endpoint you can use to perform NotificationHub operations. + */ + @JsonProperty(value = "properties.serviceBusEndpoint") + private String serviceBusEndpoint; + + /** + * The Id of the Azure subscription associated with the namespace. + */ + @JsonProperty(value = "properties.subscriptionId") + private String subscriptionId; + + /** + * ScaleUnit where the namespace gets created. + */ + @JsonProperty(value = "properties.scaleUnit") + private String scaleUnit; + + /** + * Whether or not the namespace is currently enabled. + */ + @JsonProperty(value = "properties.enabled") + private Boolean enabled; + + /** + * Whether or not the namespace is set as Critical. + */ + @JsonProperty(value = "properties.critical") + private Boolean critical; + + /** + * Data center for the namespace. + */ + @JsonProperty(value = "properties.dataCenter") + private String dataCenter; + + /** + * The namespace type. Possible values include: 'Messaging', + * 'NotificationHub'. + */ + @JsonProperty(value = "properties.namespaceType") + private NamespaceType namespaceType; + + /** + * The sku of the created namespace. + */ + @JsonProperty(value = "sku") + private Sku sku; + + /** + * Get the name of the namespace. + * + * @return the namespaceCreateOrUpdateParametersName value + */ + public String namespaceCreateOrUpdateParametersName() { + return this.namespaceCreateOrUpdateParametersName; + } + + /** + * Set the name of the namespace. + * + * @param namespaceCreateOrUpdateParametersName the namespaceCreateOrUpdateParametersName value to set + * @return the NamespaceCreateOrUpdateParameters object itself. + */ + public NamespaceCreateOrUpdateParameters withNamespaceCreateOrUpdateParametersName(String namespaceCreateOrUpdateParametersName) { + this.namespaceCreateOrUpdateParametersName = namespaceCreateOrUpdateParametersName; + return this; + } + + /** + * Get provisioning state of the Namespace. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Set provisioning state of the Namespace. + * + * @param provisioningState the provisioningState value to set + * @return the NamespaceCreateOrUpdateParameters object itself. + */ + public NamespaceCreateOrUpdateParameters withProvisioningState(String provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * Get specifies the targeted region in which the namespace should be created. It can be any of the following values: Australia EastAustralia SoutheastCentral USEast USEast US 2West USNorth Central USSouth Central USEast AsiaSoutheast AsiaBrazil SouthJapan EastJapan WestNorth EuropeWest Europe. + * + * @return the region value + */ + public String region() { + return this.region; + } + + /** + * Set specifies the targeted region in which the namespace should be created. It can be any of the following values: Australia EastAustralia SoutheastCentral USEast USEast US 2West USNorth Central USSouth Central USEast AsiaSoutheast AsiaBrazil SouthJapan EastJapan WestNorth EuropeWest Europe. + * + * @param region the region value to set + * @return the NamespaceCreateOrUpdateParameters object itself. + */ + public NamespaceCreateOrUpdateParameters withRegion(String region) { + this.region = region; + return this; + } + + /** + * Get identifier for Azure Insights metrics. + * + * @return the metricId value + */ + public String metricId() { + return this.metricId; + } + + /** + * Get status of the namespace. It can be any of these values:1 = Created/Active2 = Creating3 = Suspended4 = Deleting. + * + * @return the status value + */ + public String status() { + return this.status; + } + + /** + * Set status of the namespace. It can be any of these values:1 = Created/Active2 = Creating3 = Suspended4 = Deleting. + * + * @param status the status value to set + * @return the NamespaceCreateOrUpdateParameters object itself. + */ + public NamespaceCreateOrUpdateParameters withStatus(String status) { + this.status = status; + return this; + } + + /** + * Get the time the namespace was created. + * + * @return the createdAt value + */ + public DateTime createdAt() { + return this.createdAt; + } + + /** + * Set the time the namespace was created. + * + * @param createdAt the createdAt value to set + * @return the NamespaceCreateOrUpdateParameters object itself. + */ + public NamespaceCreateOrUpdateParameters withCreatedAt(DateTime createdAt) { + this.createdAt = createdAt; + return this; + } + + /** + * Get the time the namespace was updated. + * + * @return the updatedAt value + */ + public DateTime updatedAt() { + return this.updatedAt; + } + + /** + * Set the time the namespace was updated. + * + * @param updatedAt the updatedAt value to set + * @return the NamespaceCreateOrUpdateParameters object itself. + */ + public NamespaceCreateOrUpdateParameters withUpdatedAt(DateTime updatedAt) { + this.updatedAt = updatedAt; + return this; + } + + /** + * Get endpoint you can use to perform NotificationHub operations. + * + * @return the serviceBusEndpoint value + */ + public String serviceBusEndpoint() { + return this.serviceBusEndpoint; + } + + /** + * Set endpoint you can use to perform NotificationHub operations. + * + * @param serviceBusEndpoint the serviceBusEndpoint value to set + * @return the NamespaceCreateOrUpdateParameters object itself. + */ + public NamespaceCreateOrUpdateParameters withServiceBusEndpoint(String serviceBusEndpoint) { + this.serviceBusEndpoint = serviceBusEndpoint; + return this; + } + + /** + * Get the Id of the Azure subscription associated with the namespace. + * + * @return the subscriptionId value + */ + public String subscriptionId() { + return this.subscriptionId; + } + + /** + * Set the Id of the Azure subscription associated with the namespace. + * + * @param subscriptionId the subscriptionId value to set + * @return the NamespaceCreateOrUpdateParameters object itself. + */ + public NamespaceCreateOrUpdateParameters withSubscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; + return this; + } + + /** + * Get scaleUnit where the namespace gets created. + * + * @return the scaleUnit value + */ + public String scaleUnit() { + return this.scaleUnit; + } + + /** + * Set scaleUnit where the namespace gets created. + * + * @param scaleUnit the scaleUnit value to set + * @return the NamespaceCreateOrUpdateParameters object itself. + */ + public NamespaceCreateOrUpdateParameters withScaleUnit(String scaleUnit) { + this.scaleUnit = scaleUnit; + return this; + } + + /** + * Get whether or not the namespace is currently enabled. + * + * @return the enabled value + */ + public Boolean enabled() { + return this.enabled; + } + + /** + * Set whether or not the namespace is currently enabled. + * + * @param enabled the enabled value to set + * @return the NamespaceCreateOrUpdateParameters object itself. + */ + public NamespaceCreateOrUpdateParameters withEnabled(Boolean enabled) { + this.enabled = enabled; + return this; + } + + /** + * Get whether or not the namespace is set as Critical. + * + * @return the critical value + */ + public Boolean critical() { + return this.critical; + } + + /** + * Set whether or not the namespace is set as Critical. + * + * @param critical the critical value to set + * @return the NamespaceCreateOrUpdateParameters object itself. + */ + public NamespaceCreateOrUpdateParameters withCritical(Boolean critical) { + this.critical = critical; + return this; + } + + /** + * Get data center for the namespace. + * + * @return the dataCenter value + */ + public String dataCenter() { + return this.dataCenter; + } + + /** + * Set data center for the namespace. + * + * @param dataCenter the dataCenter value to set + * @return the NamespaceCreateOrUpdateParameters object itself. + */ + public NamespaceCreateOrUpdateParameters withDataCenter(String dataCenter) { + this.dataCenter = dataCenter; + return this; + } + + /** + * Get the namespace type. Possible values include: 'Messaging', 'NotificationHub'. + * + * @return the namespaceType value + */ + public NamespaceType namespaceType() { + return this.namespaceType; + } + + /** + * Set the namespace type. Possible values include: 'Messaging', 'NotificationHub'. + * + * @param namespaceType the namespaceType value to set + * @return the NamespaceCreateOrUpdateParameters object itself. + */ + public NamespaceCreateOrUpdateParameters withNamespaceType(NamespaceType namespaceType) { + this.namespaceType = namespaceType; + return this; + } + + /** + * Get the sku of the created namespace. + * + * @return the sku value + */ + public Sku sku() { + return this.sku; + } + + /** + * Set the sku of the created namespace. + * + * @param sku the sku value to set + * @return the NamespaceCreateOrUpdateParameters object itself. + */ + public NamespaceCreateOrUpdateParameters withSku(Sku sku) { + this.sku = sku; + return this; + } + +} diff --git a/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/NamespacePatchParameters.java b/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/NamespacePatchParameters.java new file mode 100644 index 000000000000..c55bcea97eed --- /dev/null +++ b/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/NamespacePatchParameters.java @@ -0,0 +1,70 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.notificationhubs.v2017_04_01; + +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Parameters supplied to the Patch Namespace operation. + */ +public class NamespacePatchParameters { + /** + * Resource tags. + */ + @JsonProperty(value = "tags") + private Map tags; + + /** + * The sku of the created namespace. + */ + @JsonProperty(value = "sku") + private Sku sku; + + /** + * Get resource tags. + * + * @return the tags value + */ + public Map tags() { + return this.tags; + } + + /** + * Set resource tags. + * + * @param tags the tags value to set + * @return the NamespacePatchParameters object itself. + */ + public NamespacePatchParameters withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Get the sku of the created namespace. + * + * @return the sku value + */ + public Sku sku() { + return this.sku; + } + + /** + * Set the sku of the created namespace. + * + * @param sku the sku value to set + * @return the NamespacePatchParameters object itself. + */ + public NamespacePatchParameters withSku(Sku sku) { + this.sku = sku; + return this; + } + +} diff --git a/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/NamespaceResource.java b/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/NamespaceResource.java new file mode 100644 index 000000000000..a8c8db062487 --- /dev/null +++ b/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/NamespaceResource.java @@ -0,0 +1,307 @@ +/** + * 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.notificationhubs.v2017_04_01; + +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.notificationhubs.v2017_04_01.implementation.NotificationHubsManager; +import org.joda.time.DateTime; +import com.microsoft.azure.management.notificationhubs.v2017_04_01.implementation.NamespaceResourceInner; + +/** + * Type representing NamespaceResource. + */ +public interface NamespaceResource extends HasInner, Resource, GroupableResourceCore, HasResourceGroup, Refreshable, Updatable, HasManager { + /** + * @return the createdAt value. + */ + DateTime createdAt(); + + /** + * @return the critical value. + */ + Boolean critical(); + + /** + * @return the dataCenter value. + */ + String dataCenter(); + + /** + * @return the enabled value. + */ + Boolean enabled(); + + /** + * @return the metricId value. + */ + String metricId(); + + /** + * @return the namespaceResourceName value. + */ + String namespaceResourceName(); + + /** + * @return the namespaceType value. + */ + NamespaceType namespaceType(); + + /** + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * @return the scaleUnit value. + */ + String scaleUnit(); + + /** + * @return the serviceBusEndpoint value. + */ + String serviceBusEndpoint(); + + /** + * @return the sku value. + */ + Sku sku(); + + /** + * @return the status value. + */ + String status(); + + /** + * @return the subscriptionId value. + */ + String subscriptionId(); + + /** + * @return the updatedAt value. + */ + DateTime updatedAt(); + + /** + * The entirety of the NamespaceResource definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithGroup, DefinitionStages.WithCreate { + } + + /** + * Grouping of NamespaceResource definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a NamespaceResource definition. + */ + interface Blank extends GroupableResourceCore.DefinitionWithRegion { + } + + /** + * The stage of the NamespaceResource definition allowing to specify the resource group. + */ + interface WithGroup extends GroupableResourceCore.DefinitionStages.WithGroup { + } + + /** + * The stage of the namespaceresource definition allowing to specify CreatedAt. + */ + interface WithCreatedAt { + /** + * Specifies createdAt. + * @param createdAt The time the namespace was created + * @return the next definition stage + */ + WithCreate withCreatedAt(DateTime createdAt); + } + + /** + * The stage of the namespaceresource definition allowing to specify Critical. + */ + interface WithCritical { + /** + * Specifies critical. + * @param critical Whether or not the namespace is set as Critical + * @return the next definition stage + */ + WithCreate withCritical(Boolean critical); + } + + /** + * The stage of the namespaceresource definition allowing to specify DataCenter. + */ + interface WithDataCenter { + /** + * Specifies dataCenter. + * @param dataCenter Data center for the namespace + * @return the next definition stage + */ + WithCreate withDataCenter(String dataCenter); + } + + /** + * The stage of the namespaceresource definition allowing to specify Enabled. + */ + interface WithEnabled { + /** + * Specifies enabled. + * @param enabled Whether or not the namespace is currently enabled + * @return the next definition stage + */ + WithCreate withEnabled(Boolean enabled); + } + + /** + * The stage of the namespaceresource definition allowing to specify NamespaceCreateOrUpdateParametersName. + */ + interface WithNamespaceCreateOrUpdateParametersName { + /** + * Specifies namespaceCreateOrUpdateParametersName. + * @param namespaceCreateOrUpdateParametersName The name of the namespace + * @return the next definition stage + */ + WithCreate withNamespaceCreateOrUpdateParametersName(String namespaceCreateOrUpdateParametersName); + } + + /** + * The stage of the namespaceresource definition allowing to specify NamespaceType. + */ + interface WithNamespaceType { + /** + * Specifies namespaceType. + * @param namespaceType The namespace type. Possible values include: 'Messaging', 'NotificationHub' + * @return the next definition stage + */ + WithCreate withNamespaceType(NamespaceType namespaceType); + } + + /** + * The stage of the namespaceresource definition allowing to specify ProvisioningState. + */ + interface WithProvisioningState { + /** + * Specifies provisioningState. + * @param provisioningState Provisioning state of the Namespace + * @return the next definition stage + */ + WithCreate withProvisioningState(String provisioningState); + } + + /** + * The stage of the namespaceresource definition allowing to specify ScaleUnit. + */ + interface WithScaleUnit { + /** + * Specifies scaleUnit. + * @param scaleUnit ScaleUnit where the namespace gets created + * @return the next definition stage + */ + WithCreate withScaleUnit(String scaleUnit); + } + + /** + * The stage of the namespaceresource definition allowing to specify ServiceBusEndpoint. + */ + interface WithServiceBusEndpoint { + /** + * Specifies serviceBusEndpoint. + * @param serviceBusEndpoint Endpoint you can use to perform NotificationHub operations + * @return the next definition stage + */ + WithCreate withServiceBusEndpoint(String serviceBusEndpoint); + } + + /** + * The stage of the namespaceresource definition allowing to specify Sku. + */ + interface WithSku { + /** + * Specifies sku. + * @param sku The sku of the created namespace + * @return the next definition stage + */ + WithCreate withSku(Sku sku); + } + + /** + * The stage of the namespaceresource definition allowing to specify Status. + */ + interface WithStatus { + /** + * Specifies status. + * @param status Status of the namespace. It can be any of these values:1 = Created/Active2 = Creating3 = Suspended4 = Deleting + * @return the next definition stage + */ + WithCreate withStatus(String status); + } + + /** + * The stage of the namespaceresource definition allowing to specify SubscriptionId. + */ + interface WithSubscriptionId { + /** + * Specifies subscriptionId. + * @param subscriptionId The Id of the Azure subscription associated with the namespace + * @return the next definition stage + */ + WithCreate withSubscriptionId(String subscriptionId); + } + + /** + * The stage of the namespaceresource definition allowing to specify UpdatedAt. + */ + interface WithUpdatedAt { + /** + * Specifies updatedAt. + * @param updatedAt The time the namespace was updated + * @return the next definition stage + */ + WithCreate withUpdatedAt(DateTime updatedAt); + } + + /** + * 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.WithCreatedAt, DefinitionStages.WithCritical, DefinitionStages.WithDataCenter, DefinitionStages.WithEnabled, DefinitionStages.WithNamespaceCreateOrUpdateParametersName, DefinitionStages.WithNamespaceType, DefinitionStages.WithProvisioningState, DefinitionStages.WithScaleUnit, DefinitionStages.WithServiceBusEndpoint, DefinitionStages.WithSku, DefinitionStages.WithStatus, DefinitionStages.WithSubscriptionId, DefinitionStages.WithUpdatedAt { + } + } + /** + * The template for a NamespaceResource update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, Resource.UpdateWithTags, UpdateStages.WithSku { + } + + /** + * Grouping of NamespaceResource update stages. + */ + interface UpdateStages { + /** + * The stage of the namespaceresource update allowing to specify Sku. + */ + interface WithSku { + /** + * Specifies sku. + * @param sku The sku of the created namespace + * @return the next update stage + */ + Update withSku(Sku sku); + } + + } +} diff --git a/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/NamespaceSharedAccessAuthorizationRuleResource.java b/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/NamespaceSharedAccessAuthorizationRuleResource.java new file mode 100644 index 000000000000..d74a71890673 --- /dev/null +++ b/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/NamespaceSharedAccessAuthorizationRuleResource.java @@ -0,0 +1,174 @@ +/** + * 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.notificationhubs.v2017_04_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.notificationhubs.v2017_04_01.implementation.SharedAccessAuthorizationRuleResourceInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.notificationhubs.v2017_04_01.implementation.NotificationHubsManager; +import java.util.List; +import java.util.Map; + +/** + * Type representing NamespaceSharedAccessAuthorizationRuleResource. + */ +public interface NamespaceSharedAccessAuthorizationRuleResource extends HasInner, Indexable, Refreshable, Updatable, HasManager { + /** + * @return the claimType value. + */ + String claimType(); + + /** + * @return the claimValue value. + */ + String claimValue(); + + /** + * @return the createdTime value. + */ + String createdTime(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the keyName value. + */ + String keyName(); + + /** + * @return the location value. + */ + String location(); + + /** + * @return the modifiedTime value. + */ + String modifiedTime(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the primaryKey value. + */ + String primaryKey(); + + /** + * @return the revision value. + */ + Integer revision(); + + /** + * @return the rights value. + */ + List rights(); + + /** + * @return the secondaryKey value. + */ + String secondaryKey(); + + /** + * @return the sku value. + */ + Sku sku(); + + /** + * @return the tags value. + */ + Map tags(); + + /** + * @return the type value. + */ + String type(); + + /** + * The entirety of the NamespaceSharedAccessAuthorizationRuleResource definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithNamespace, DefinitionStages.WithProperties, DefinitionStages.WithCreate { + } + + /** + * Grouping of NamespaceSharedAccessAuthorizationRuleResource definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a NamespaceSharedAccessAuthorizationRuleResource definition. + */ + interface Blank extends WithNamespace { + } + + /** + * The stage of the namespacesharedaccessauthorizationruleresource definition allowing to specify Namespace. + */ + interface WithNamespace { + /** + * Specifies resourceGroupName, namespaceName. + * @param resourceGroupName The name of the resource group + * @param namespaceName The namespace name + * @return the next definition stage + */ + WithProperties withExistingNamespace(String resourceGroupName, String namespaceName); + } + + /** + * The stage of the namespacesharedaccessauthorizationruleresource definition allowing to specify Properties. + */ + interface WithProperties { + /** + * Specifies properties. + * @param properties Properties of the Namespace AuthorizationRules + * @return the next definition stage + */ + WithCreate withProperties(SharedAccessAuthorizationRuleProperties 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 { + } + } + /** + * The template for a NamespaceSharedAccessAuthorizationRuleResource update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, UpdateStages.WithProperties { + } + + /** + * Grouping of NamespaceSharedAccessAuthorizationRuleResource update stages. + */ + interface UpdateStages { + /** + * The stage of the namespacesharedaccessauthorizationruleresource update allowing to specify Properties. + */ + interface WithProperties { + /** + * Specifies properties. + * @param properties Properties of the Namespace AuthorizationRules + * @return the next update stage + */ + Update withProperties(SharedAccessAuthorizationRuleProperties properties); + } + + } +} diff --git a/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/NamespaceType.java b/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/NamespaceType.java new file mode 100644 index 000000000000..b92f8f722d96 --- /dev/null +++ b/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/NamespaceType.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.notificationhubs.v2017_04_01; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for NamespaceType. + */ +public enum NamespaceType { + /** Enum value Messaging. */ + MESSAGING("Messaging"), + + /** Enum value NotificationHub. */ + NOTIFICATION_HUB("NotificationHub"); + + /** The actual serialized value for a NamespaceType instance. */ + private String value; + + NamespaceType(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a NamespaceType instance. + * + * @param value the serialized value to parse. + * @return the parsed NamespaceType object, or null if unable to parse. + */ + @JsonCreator + public static NamespaceType fromString(String value) { + NamespaceType[] items = NamespaceType.values(); + for (NamespaceType item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/Namespaces.java b/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/Namespaces.java new file mode 100644 index 000000000000..fd3d1d54dee9 --- /dev/null +++ b/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/Namespaces.java @@ -0,0 +1,97 @@ +/** + * 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.notificationhubs.v2017_04_01; + +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.notificationhubs.v2017_04_01.implementation.NamespacesInner; +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.notificationhubs.v2017_04_01.NamespaceSharedAccessAuthorizationRuleResource; +import rx.Completable; + +/** + * Type representing Namespaces. + */ +public interface Namespaces extends SupportsCreating, SupportsDeletingByResourceGroup, SupportsBatchDeletion, SupportsGettingByResourceGroup, SupportsListingByResourceGroup, SupportsListing, HasInner { + /** + * Begins definition for a new AuthorizationRule resource. + * @param name resource name. + * @return the first stage of the new AuthorizationRule definition. + */ + NamespaceSharedAccessAuthorizationRuleResource.DefinitionStages.Blank defineAuthorizationRule(String name); + + /** + * Checks the availability of the given service namespace across all Azure subscriptions. This is useful because the domain name is created based on the service namespace name. + * + * @param parameters The namespace name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable checkAvailabilityAsync(CheckAvailabilityParameters parameters); + + /** + * Gets an authorization rule for a namespace by name. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name + * @param authorizationRuleName Authorization rule name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAuthorizationRuleAsync(String resourceGroupName, String namespaceName, String authorizationRuleName); + + /** + * Gets the authorization rules for a namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAuthorizationRulesAsync(final String resourceGroupName, final String namespaceName); + + /** + * Deletes a namespace authorization rule. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param authorizationRuleName Authorization Rule Name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable deleteAuthorizationRuleAsync(String resourceGroupName, String namespaceName, String authorizationRuleName); + + /** + * Gets the Primary and Secondary ConnectionStrings to the namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param authorizationRuleName The connection string of the namespace for the specified authorizationRule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listKeysAsync(String resourceGroupName, String namespaceName, String authorizationRuleName); + + /** + * Regenerates the Primary/Secondary Keys to the Namespace Authorization Rule. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param authorizationRuleName The connection string of the namespace for the specified authorizationRule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable regenerateKeysAsync(String resourceGroupName, String namespaceName, String authorizationRuleName); + +} diff --git a/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/NotificationHubCreateOrUpdateParameters.java b/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/NotificationHubCreateOrUpdateParameters.java new file mode 100644 index 000000000000..4b650872991d --- /dev/null +++ b/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/NotificationHubCreateOrUpdateParameters.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.notificationhubs.v2017_04_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.rest.SkipParentValidation; +import com.microsoft.azure.Resource; + +/** + * Parameters supplied to the CreateOrUpdate NotificationHub operation. + */ +@JsonFlatten +@SkipParentValidation +public class NotificationHubCreateOrUpdateParameters extends Resource { + /** + * The NotificationHub name. + */ + @JsonProperty(value = "properties.name") + private String notificationHubCreateOrUpdateParametersName; + + /** + * The RegistrationTtl of the created NotificationHub. + */ + @JsonProperty(value = "properties.registrationTtl") + private String registrationTtl; + + /** + * The AuthorizationRules of the created NotificationHub. + */ + @JsonProperty(value = "properties.authorizationRules") + private List authorizationRules; + + /** + * The ApnsCredential of the created NotificationHub. + */ + @JsonProperty(value = "properties.apnsCredential") + private ApnsCredential apnsCredential; + + /** + * The WnsCredential of the created NotificationHub. + */ + @JsonProperty(value = "properties.wnsCredential") + private WnsCredential wnsCredential; + + /** + * The GcmCredential of the created NotificationHub. + */ + @JsonProperty(value = "properties.gcmCredential") + private GcmCredential gcmCredential; + + /** + * The MpnsCredential of the created NotificationHub. + */ + @JsonProperty(value = "properties.mpnsCredential") + private MpnsCredential mpnsCredential; + + /** + * The AdmCredential of the created NotificationHub. + */ + @JsonProperty(value = "properties.admCredential") + private AdmCredential admCredential; + + /** + * The BaiduCredential of the created NotificationHub. + */ + @JsonProperty(value = "properties.baiduCredential") + private BaiduCredential baiduCredential; + + /** + * The sku of the created namespace. + */ + @JsonProperty(value = "sku") + private Sku sku; + + /** + * Get the NotificationHub name. + * + * @return the notificationHubCreateOrUpdateParametersName value + */ + public String notificationHubCreateOrUpdateParametersName() { + return this.notificationHubCreateOrUpdateParametersName; + } + + /** + * Set the NotificationHub name. + * + * @param notificationHubCreateOrUpdateParametersName the notificationHubCreateOrUpdateParametersName value to set + * @return the NotificationHubCreateOrUpdateParameters object itself. + */ + public NotificationHubCreateOrUpdateParameters withNotificationHubCreateOrUpdateParametersName(String notificationHubCreateOrUpdateParametersName) { + this.notificationHubCreateOrUpdateParametersName = notificationHubCreateOrUpdateParametersName; + return this; + } + + /** + * Get the RegistrationTtl of the created NotificationHub. + * + * @return the registrationTtl value + */ + public String registrationTtl() { + return this.registrationTtl; + } + + /** + * Set the RegistrationTtl of the created NotificationHub. + * + * @param registrationTtl the registrationTtl value to set + * @return the NotificationHubCreateOrUpdateParameters object itself. + */ + public NotificationHubCreateOrUpdateParameters withRegistrationTtl(String registrationTtl) { + this.registrationTtl = registrationTtl; + return this; + } + + /** + * Get the AuthorizationRules of the created NotificationHub. + * + * @return the authorizationRules value + */ + public List authorizationRules() { + return this.authorizationRules; + } + + /** + * Set the AuthorizationRules of the created NotificationHub. + * + * @param authorizationRules the authorizationRules value to set + * @return the NotificationHubCreateOrUpdateParameters object itself. + */ + public NotificationHubCreateOrUpdateParameters withAuthorizationRules(List authorizationRules) { + this.authorizationRules = authorizationRules; + return this; + } + + /** + * Get the ApnsCredential of the created NotificationHub. + * + * @return the apnsCredential value + */ + public ApnsCredential apnsCredential() { + return this.apnsCredential; + } + + /** + * Set the ApnsCredential of the created NotificationHub. + * + * @param apnsCredential the apnsCredential value to set + * @return the NotificationHubCreateOrUpdateParameters object itself. + */ + public NotificationHubCreateOrUpdateParameters withApnsCredential(ApnsCredential apnsCredential) { + this.apnsCredential = apnsCredential; + return this; + } + + /** + * Get the WnsCredential of the created NotificationHub. + * + * @return the wnsCredential value + */ + public WnsCredential wnsCredential() { + return this.wnsCredential; + } + + /** + * Set the WnsCredential of the created NotificationHub. + * + * @param wnsCredential the wnsCredential value to set + * @return the NotificationHubCreateOrUpdateParameters object itself. + */ + public NotificationHubCreateOrUpdateParameters withWnsCredential(WnsCredential wnsCredential) { + this.wnsCredential = wnsCredential; + return this; + } + + /** + * Get the GcmCredential of the created NotificationHub. + * + * @return the gcmCredential value + */ + public GcmCredential gcmCredential() { + return this.gcmCredential; + } + + /** + * Set the GcmCredential of the created NotificationHub. + * + * @param gcmCredential the gcmCredential value to set + * @return the NotificationHubCreateOrUpdateParameters object itself. + */ + public NotificationHubCreateOrUpdateParameters withGcmCredential(GcmCredential gcmCredential) { + this.gcmCredential = gcmCredential; + return this; + } + + /** + * Get the MpnsCredential of the created NotificationHub. + * + * @return the mpnsCredential value + */ + public MpnsCredential mpnsCredential() { + return this.mpnsCredential; + } + + /** + * Set the MpnsCredential of the created NotificationHub. + * + * @param mpnsCredential the mpnsCredential value to set + * @return the NotificationHubCreateOrUpdateParameters object itself. + */ + public NotificationHubCreateOrUpdateParameters withMpnsCredential(MpnsCredential mpnsCredential) { + this.mpnsCredential = mpnsCredential; + return this; + } + + /** + * Get the AdmCredential of the created NotificationHub. + * + * @return the admCredential value + */ + public AdmCredential admCredential() { + return this.admCredential; + } + + /** + * Set the AdmCredential of the created NotificationHub. + * + * @param admCredential the admCredential value to set + * @return the NotificationHubCreateOrUpdateParameters object itself. + */ + public NotificationHubCreateOrUpdateParameters withAdmCredential(AdmCredential admCredential) { + this.admCredential = admCredential; + return this; + } + + /** + * Get the BaiduCredential of the created NotificationHub. + * + * @return the baiduCredential value + */ + public BaiduCredential baiduCredential() { + return this.baiduCredential; + } + + /** + * Set the BaiduCredential of the created NotificationHub. + * + * @param baiduCredential the baiduCredential value to set + * @return the NotificationHubCreateOrUpdateParameters object itself. + */ + public NotificationHubCreateOrUpdateParameters withBaiduCredential(BaiduCredential baiduCredential) { + this.baiduCredential = baiduCredential; + return this; + } + + /** + * Get the sku of the created namespace. + * + * @return the sku value + */ + public Sku sku() { + return this.sku; + } + + /** + * Set the sku of the created namespace. + * + * @param sku the sku value to set + * @return the NotificationHubCreateOrUpdateParameters object itself. + */ + public NotificationHubCreateOrUpdateParameters withSku(Sku sku) { + this.sku = sku; + return this; + } + +} diff --git a/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/NotificationHubNamespaceSharedAccessAuthorizationRuleResource.java b/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/NotificationHubNamespaceSharedAccessAuthorizationRuleResource.java new file mode 100644 index 000000000000..652b04f25642 --- /dev/null +++ b/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/NotificationHubNamespaceSharedAccessAuthorizationRuleResource.java @@ -0,0 +1,175 @@ +/** + * 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.notificationhubs.v2017_04_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.notificationhubs.v2017_04_01.implementation.SharedAccessAuthorizationRuleResourceInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.notificationhubs.v2017_04_01.implementation.NotificationHubsManager; +import java.util.List; +import java.util.Map; + +/** + * Type representing NotificationHubNamespaceSharedAccessAuthorizationRuleResource. + */ +public interface NotificationHubNamespaceSharedAccessAuthorizationRuleResource extends HasInner, Indexable, Refreshable, Updatable, HasManager { + /** + * @return the claimType value. + */ + String claimType(); + + /** + * @return the claimValue value. + */ + String claimValue(); + + /** + * @return the createdTime value. + */ + String createdTime(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the keyName value. + */ + String keyName(); + + /** + * @return the location value. + */ + String location(); + + /** + * @return the modifiedTime value. + */ + String modifiedTime(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the primaryKey value. + */ + String primaryKey(); + + /** + * @return the revision value. + */ + Integer revision(); + + /** + * @return the rights value. + */ + List rights(); + + /** + * @return the secondaryKey value. + */ + String secondaryKey(); + + /** + * @return the sku value. + */ + Sku sku(); + + /** + * @return the tags value. + */ + Map tags(); + + /** + * @return the type value. + */ + String type(); + + /** + * The entirety of the NotificationHubNamespaceSharedAccessAuthorizationRuleResource definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithNotificationHub, DefinitionStages.WithProperties, DefinitionStages.WithCreate { + } + + /** + * Grouping of NotificationHubNamespaceSharedAccessAuthorizationRuleResource definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a NotificationHubNamespaceSharedAccessAuthorizationRuleResource definition. + */ + interface Blank extends WithNotificationHub { + } + + /** + * The stage of the notificationhubnamespacesharedaccessauthorizationruleresource definition allowing to specify NotificationHub. + */ + interface WithNotificationHub { + /** + * Specifies resourceGroupName, namespaceName, notificationHubName. + * @param resourceGroupName The name of the resource group + * @param namespaceName The namespace name + * @param notificationHubName The notification hub name + * @return the next definition stage + */ + WithProperties withExistingNotificationHub(String resourceGroupName, String namespaceName, String notificationHubName); + } + + /** + * The stage of the notificationhubnamespacesharedaccessauthorizationruleresource definition allowing to specify Properties. + */ + interface WithProperties { + /** + * Specifies properties. + * @param properties Properties of the Namespace AuthorizationRules + * @return the next definition stage + */ + WithCreate withProperties(SharedAccessAuthorizationRuleProperties 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 { + } + } + /** + * The template for a NotificationHubNamespaceSharedAccessAuthorizationRuleResource update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, UpdateStages.WithProperties { + } + + /** + * Grouping of NotificationHubNamespaceSharedAccessAuthorizationRuleResource update stages. + */ + interface UpdateStages { + /** + * The stage of the notificationhubnamespacesharedaccessauthorizationruleresource update allowing to specify Properties. + */ + interface WithProperties { + /** + * Specifies properties. + * @param properties Properties of the Namespace AuthorizationRules + * @return the next update stage + */ + Update withProperties(SharedAccessAuthorizationRuleProperties properties); + } + + } +} diff --git a/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/NotificationHubPatchParameters.java b/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/NotificationHubPatchParameters.java new file mode 100644 index 000000000000..fa681ec14550 --- /dev/null +++ b/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/NotificationHubPatchParameters.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.notificationhubs.v2017_04_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.rest.SkipParentValidation; +import com.microsoft.azure.Resource; + +/** + * Parameters supplied to the patch NotificationHub operation. + */ +@JsonFlatten +@SkipParentValidation +public class NotificationHubPatchParameters extends Resource { + /** + * The NotificationHub name. + */ + @JsonProperty(value = "properties.name") + private String notificationHubPatchParametersName; + + /** + * The RegistrationTtl of the created NotificationHub. + */ + @JsonProperty(value = "properties.registrationTtl") + private String registrationTtl; + + /** + * The AuthorizationRules of the created NotificationHub. + */ + @JsonProperty(value = "properties.authorizationRules") + private List authorizationRules; + + /** + * The ApnsCredential of the created NotificationHub. + */ + @JsonProperty(value = "properties.apnsCredential") + private ApnsCredential apnsCredential; + + /** + * The WnsCredential of the created NotificationHub. + */ + @JsonProperty(value = "properties.wnsCredential") + private WnsCredential wnsCredential; + + /** + * The GcmCredential of the created NotificationHub. + */ + @JsonProperty(value = "properties.gcmCredential") + private GcmCredential gcmCredential; + + /** + * The MpnsCredential of the created NotificationHub. + */ + @JsonProperty(value = "properties.mpnsCredential") + private MpnsCredential mpnsCredential; + + /** + * The AdmCredential of the created NotificationHub. + */ + @JsonProperty(value = "properties.admCredential") + private AdmCredential admCredential; + + /** + * The BaiduCredential of the created NotificationHub. + */ + @JsonProperty(value = "properties.baiduCredential") + private BaiduCredential baiduCredential; + + /** + * The sku of the created namespace. + */ + @JsonProperty(value = "sku") + private Sku sku; + + /** + * Get the NotificationHub name. + * + * @return the notificationHubPatchParametersName value + */ + public String notificationHubPatchParametersName() { + return this.notificationHubPatchParametersName; + } + + /** + * Set the NotificationHub name. + * + * @param notificationHubPatchParametersName the notificationHubPatchParametersName value to set + * @return the NotificationHubPatchParameters object itself. + */ + public NotificationHubPatchParameters withNotificationHubPatchParametersName(String notificationHubPatchParametersName) { + this.notificationHubPatchParametersName = notificationHubPatchParametersName; + return this; + } + + /** + * Get the RegistrationTtl of the created NotificationHub. + * + * @return the registrationTtl value + */ + public String registrationTtl() { + return this.registrationTtl; + } + + /** + * Set the RegistrationTtl of the created NotificationHub. + * + * @param registrationTtl the registrationTtl value to set + * @return the NotificationHubPatchParameters object itself. + */ + public NotificationHubPatchParameters withRegistrationTtl(String registrationTtl) { + this.registrationTtl = registrationTtl; + return this; + } + + /** + * Get the AuthorizationRules of the created NotificationHub. + * + * @return the authorizationRules value + */ + public List authorizationRules() { + return this.authorizationRules; + } + + /** + * Set the AuthorizationRules of the created NotificationHub. + * + * @param authorizationRules the authorizationRules value to set + * @return the NotificationHubPatchParameters object itself. + */ + public NotificationHubPatchParameters withAuthorizationRules(List authorizationRules) { + this.authorizationRules = authorizationRules; + return this; + } + + /** + * Get the ApnsCredential of the created NotificationHub. + * + * @return the apnsCredential value + */ + public ApnsCredential apnsCredential() { + return this.apnsCredential; + } + + /** + * Set the ApnsCredential of the created NotificationHub. + * + * @param apnsCredential the apnsCredential value to set + * @return the NotificationHubPatchParameters object itself. + */ + public NotificationHubPatchParameters withApnsCredential(ApnsCredential apnsCredential) { + this.apnsCredential = apnsCredential; + return this; + } + + /** + * Get the WnsCredential of the created NotificationHub. + * + * @return the wnsCredential value + */ + public WnsCredential wnsCredential() { + return this.wnsCredential; + } + + /** + * Set the WnsCredential of the created NotificationHub. + * + * @param wnsCredential the wnsCredential value to set + * @return the NotificationHubPatchParameters object itself. + */ + public NotificationHubPatchParameters withWnsCredential(WnsCredential wnsCredential) { + this.wnsCredential = wnsCredential; + return this; + } + + /** + * Get the GcmCredential of the created NotificationHub. + * + * @return the gcmCredential value + */ + public GcmCredential gcmCredential() { + return this.gcmCredential; + } + + /** + * Set the GcmCredential of the created NotificationHub. + * + * @param gcmCredential the gcmCredential value to set + * @return the NotificationHubPatchParameters object itself. + */ + public NotificationHubPatchParameters withGcmCredential(GcmCredential gcmCredential) { + this.gcmCredential = gcmCredential; + return this; + } + + /** + * Get the MpnsCredential of the created NotificationHub. + * + * @return the mpnsCredential value + */ + public MpnsCredential mpnsCredential() { + return this.mpnsCredential; + } + + /** + * Set the MpnsCredential of the created NotificationHub. + * + * @param mpnsCredential the mpnsCredential value to set + * @return the NotificationHubPatchParameters object itself. + */ + public NotificationHubPatchParameters withMpnsCredential(MpnsCredential mpnsCredential) { + this.mpnsCredential = mpnsCredential; + return this; + } + + /** + * Get the AdmCredential of the created NotificationHub. + * + * @return the admCredential value + */ + public AdmCredential admCredential() { + return this.admCredential; + } + + /** + * Set the AdmCredential of the created NotificationHub. + * + * @param admCredential the admCredential value to set + * @return the NotificationHubPatchParameters object itself. + */ + public NotificationHubPatchParameters withAdmCredential(AdmCredential admCredential) { + this.admCredential = admCredential; + return this; + } + + /** + * Get the BaiduCredential of the created NotificationHub. + * + * @return the baiduCredential value + */ + public BaiduCredential baiduCredential() { + return this.baiduCredential; + } + + /** + * Set the BaiduCredential of the created NotificationHub. + * + * @param baiduCredential the baiduCredential value to set + * @return the NotificationHubPatchParameters object itself. + */ + public NotificationHubPatchParameters withBaiduCredential(BaiduCredential baiduCredential) { + this.baiduCredential = baiduCredential; + return this; + } + + /** + * Get the sku of the created namespace. + * + * @return the sku value + */ + public Sku sku() { + return this.sku; + } + + /** + * Set the sku of the created namespace. + * + * @param sku the sku value to set + * @return the NotificationHubPatchParameters object itself. + */ + public NotificationHubPatchParameters withSku(Sku sku) { + this.sku = sku; + return this; + } + +} diff --git a/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/NotificationHubResource.java b/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/NotificationHubResource.java new file mode 100644 index 000000000000..fce97833a7b5 --- /dev/null +++ b/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/NotificationHubResource.java @@ -0,0 +1,438 @@ +/** + * 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.notificationhubs.v2017_04_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.notificationhubs.v2017_04_01.implementation.NotificationHubResourceInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.notificationhubs.v2017_04_01.implementation.NotificationHubsManager; +import java.util.Map; +import java.util.List; + +/** + * Type representing NotificationHubResource. + */ +public interface NotificationHubResource extends HasInner, Indexable, Refreshable, Updatable, HasManager { + /** + * @return the admCredential value. + */ + AdmCredential admCredential(); + + /** + * @return the apnsCredential value. + */ + ApnsCredential apnsCredential(); + + /** + * @return the authorizationRules value. + */ + List authorizationRules(); + + /** + * @return the baiduCredential value. + */ + BaiduCredential baiduCredential(); + + /** + * @return the gcmCredential value. + */ + GcmCredential gcmCredential(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the location value. + */ + String location(); + + /** + * @return the mpnsCredential value. + */ + MpnsCredential mpnsCredential(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the notificationHubResourceName value. + */ + String notificationHubResourceName(); + + /** + * @return the registrationTtl value. + */ + String registrationTtl(); + + /** + * @return the sku value. + */ + Sku sku(); + + /** + * @return the tags value. + */ + Map tags(); + + /** + * @return the type value. + */ + String type(); + + /** + * @return the wnsCredential value. + */ + WnsCredential wnsCredential(); + + /** + * The entirety of the NotificationHubResource definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithNamespace, DefinitionStages.WithCreate { + } + + /** + * Grouping of NotificationHubResource definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a NotificationHubResource definition. + */ + interface Blank extends WithNamespace { + } + + /** + * The stage of the notificationhubresource definition allowing to specify Namespace. + */ + interface WithNamespace { + /** + * Specifies resourceGroupName, namespaceName. + * @param resourceGroupName The name of the resource group + * @param namespaceName The namespace name + * @return the next definition stage + */ + WithCreate withExistingNamespace(String resourceGroupName, String namespaceName); + } + + /** + * The stage of the notificationhubresource definition allowing to specify AdmCredential. + */ + interface WithAdmCredential { + /** + * Specifies admCredential. + * @param admCredential The AdmCredential of the created NotificationHub + * @return the next definition stage + */ + WithCreate withAdmCredential(AdmCredential admCredential); + } + + /** + * The stage of the notificationhubresource definition allowing to specify ApnsCredential. + */ + interface WithApnsCredential { + /** + * Specifies apnsCredential. + * @param apnsCredential The ApnsCredential of the created NotificationHub + * @return the next definition stage + */ + WithCreate withApnsCredential(ApnsCredential apnsCredential); + } + + /** + * The stage of the notificationhubresource definition allowing to specify AuthorizationRules. + */ + interface WithAuthorizationRules { + /** + * Specifies authorizationRules. + * @param authorizationRules The AuthorizationRules of the created NotificationHub + * @return the next definition stage + */ + WithCreate withAuthorizationRules(List authorizationRules); + } + + /** + * The stage of the notificationhubresource definition allowing to specify BaiduCredential. + */ + interface WithBaiduCredential { + /** + * Specifies baiduCredential. + * @param baiduCredential The BaiduCredential of the created NotificationHub + * @return the next definition stage + */ + WithCreate withBaiduCredential(BaiduCredential baiduCredential); + } + + /** + * The stage of the notificationhubresource definition allowing to specify GcmCredential. + */ + interface WithGcmCredential { + /** + * Specifies gcmCredential. + * @param gcmCredential The GcmCredential of the created NotificationHub + * @return the next definition stage + */ + WithCreate withGcmCredential(GcmCredential gcmCredential); + } + + /** + * The stage of the notificationhubresource definition allowing to specify Location. + */ + interface WithLocation { + /** + * Specifies location. + * @param location Resource location + * @return the next definition stage + */ + WithCreate withLocation(String location); + } + + /** + * The stage of the notificationhubresource definition allowing to specify MpnsCredential. + */ + interface WithMpnsCredential { + /** + * Specifies mpnsCredential. + * @param mpnsCredential The MpnsCredential of the created NotificationHub + * @return the next definition stage + */ + WithCreate withMpnsCredential(MpnsCredential mpnsCredential); + } + + /** + * The stage of the notificationhubresource definition allowing to specify NotificationHubCreateOrUpdateParametersName. + */ + interface WithNotificationHubCreateOrUpdateParametersName { + /** + * Specifies notificationHubCreateOrUpdateParametersName. + * @param notificationHubCreateOrUpdateParametersName The NotificationHub name + * @return the next definition stage + */ + WithCreate withNotificationHubCreateOrUpdateParametersName(String notificationHubCreateOrUpdateParametersName); + } + + /** + * The stage of the notificationhubresource definition allowing to specify RegistrationTtl. + */ + interface WithRegistrationTtl { + /** + * Specifies registrationTtl. + * @param registrationTtl The RegistrationTtl of the created NotificationHub + * @return the next definition stage + */ + WithCreate withRegistrationTtl(String registrationTtl); + } + + /** + * The stage of the notificationhubresource definition allowing to specify Sku. + */ + interface WithSku { + /** + * Specifies sku. + * @param sku The sku of the created namespace + * @return the next definition stage + */ + WithCreate withSku(Sku sku); + } + + /** + * The stage of the notificationhubresource definition allowing to specify Tags. + */ + interface WithTags { + /** + * Specifies tags. + * @param tags Resource tags + * @return the next definition stage + */ + WithCreate withTags(Map tags); + } + + /** + * The stage of the notificationhubresource definition allowing to specify WnsCredential. + */ + interface WithWnsCredential { + /** + * Specifies wnsCredential. + * @param wnsCredential The WnsCredential of the created NotificationHub + * @return the next definition stage + */ + WithCreate withWnsCredential(WnsCredential wnsCredential); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, DefinitionStages.WithAdmCredential, DefinitionStages.WithApnsCredential, DefinitionStages.WithAuthorizationRules, DefinitionStages.WithBaiduCredential, DefinitionStages.WithGcmCredential, DefinitionStages.WithLocation, DefinitionStages.WithMpnsCredential, DefinitionStages.WithNotificationHubCreateOrUpdateParametersName, DefinitionStages.WithRegistrationTtl, DefinitionStages.WithSku, DefinitionStages.WithTags, DefinitionStages.WithWnsCredential { + } + } + /** + * The template for a NotificationHubResource update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, UpdateStages.WithAdmCredential, UpdateStages.WithApnsCredential, UpdateStages.WithAuthorizationRules, UpdateStages.WithBaiduCredential, UpdateStages.WithGcmCredential, UpdateStages.WithLocation, UpdateStages.WithMpnsCredential, UpdateStages.WithNotificationHubPatchParametersName, UpdateStages.WithRegistrationTtl, UpdateStages.WithSku, UpdateStages.WithTags, UpdateStages.WithWnsCredential { + } + + /** + * Grouping of NotificationHubResource update stages. + */ + interface UpdateStages { + /** + * The stage of the notificationhubresource update allowing to specify AdmCredential. + */ + interface WithAdmCredential { + /** + * Specifies admCredential. + * @param admCredential The AdmCredential of the created NotificationHub + * @return the next update stage + */ + Update withAdmCredential(AdmCredential admCredential); + } + + /** + * The stage of the notificationhubresource update allowing to specify ApnsCredential. + */ + interface WithApnsCredential { + /** + * Specifies apnsCredential. + * @param apnsCredential The ApnsCredential of the created NotificationHub + * @return the next update stage + */ + Update withApnsCredential(ApnsCredential apnsCredential); + } + + /** + * The stage of the notificationhubresource update allowing to specify AuthorizationRules. + */ + interface WithAuthorizationRules { + /** + * Specifies authorizationRules. + * @param authorizationRules The AuthorizationRules of the created NotificationHub + * @return the next update stage + */ + Update withAuthorizationRules(List authorizationRules); + } + + /** + * The stage of the notificationhubresource update allowing to specify BaiduCredential. + */ + interface WithBaiduCredential { + /** + * Specifies baiduCredential. + * @param baiduCredential The BaiduCredential of the created NotificationHub + * @return the next update stage + */ + Update withBaiduCredential(BaiduCredential baiduCredential); + } + + /** + * The stage of the notificationhubresource update allowing to specify GcmCredential. + */ + interface WithGcmCredential { + /** + * Specifies gcmCredential. + * @param gcmCredential The GcmCredential of the created NotificationHub + * @return the next update stage + */ + Update withGcmCredential(GcmCredential gcmCredential); + } + + /** + * The stage of the notificationhubresource update allowing to specify Location. + */ + interface WithLocation { + /** + * Specifies location. + * @param location Resource location + * @return the next update stage + */ + Update withLocation(String location); + } + + /** + * The stage of the notificationhubresource update allowing to specify MpnsCredential. + */ + interface WithMpnsCredential { + /** + * Specifies mpnsCredential. + * @param mpnsCredential The MpnsCredential of the created NotificationHub + * @return the next update stage + */ + Update withMpnsCredential(MpnsCredential mpnsCredential); + } + + /** + * The stage of the notificationhubresource update allowing to specify NotificationHubPatchParametersName. + */ + interface WithNotificationHubPatchParametersName { + /** + * Specifies notificationHubPatchParametersName. + * @param notificationHubPatchParametersName The NotificationHub name + * @return the next update stage + */ + Update withNotificationHubPatchParametersName(String notificationHubPatchParametersName); + } + + /** + * The stage of the notificationhubresource update allowing to specify RegistrationTtl. + */ + interface WithRegistrationTtl { + /** + * Specifies registrationTtl. + * @param registrationTtl The RegistrationTtl of the created NotificationHub + * @return the next update stage + */ + Update withRegistrationTtl(String registrationTtl); + } + + /** + * The stage of the notificationhubresource update allowing to specify Sku. + */ + interface WithSku { + /** + * Specifies sku. + * @param sku The sku of the created namespace + * @return the next update stage + */ + Update withSku(Sku sku); + } + + /** + * The stage of the notificationhubresource update allowing to specify Tags. + */ + interface WithTags { + /** + * Specifies tags. + * @param tags Resource tags + * @return the next update stage + */ + Update withTags(Map tags); + } + + /** + * The stage of the notificationhubresource update allowing to specify WnsCredential. + */ + interface WithWnsCredential { + /** + * Specifies wnsCredential. + * @param wnsCredential The WnsCredential of the created NotificationHub + * @return the next update stage + */ + Update withWnsCredential(WnsCredential wnsCredential); + } + + } +} diff --git a/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/NotificationHubs.java b/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/NotificationHubs.java new file mode 100644 index 000000000000..51d606c6e058 --- /dev/null +++ b/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/NotificationHubs.java @@ -0,0 +1,153 @@ +/** + * 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.notificationhubs.v2017_04_01; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import rx.Completable; +import rx.Observable; +import com.microsoft.azure.management.notificationhubs.v2017_04_01.implementation.NotificationHubsInner; +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.notificationhubs.v2017_04_01.NotificationHubNamespaceSharedAccessAuthorizationRuleResource; + +/** + * Type representing NotificationHubs. + */ +public interface NotificationHubs extends SupportsCreating, HasInner { + /** + * Begins definition for a new AuthorizationRule resource. + * @param name resource name. + * @return the first stage of the new AuthorizationRule definition. + */ + NotificationHubNamespaceSharedAccessAuthorizationRuleResource.DefinitionStages.Blank defineAuthorizationRule(String name); + + /** + * test send a push notification. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param notificationHubName The notification hub name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable debugSendAsync(String resourceGroupName, String namespaceName, String notificationHubName); + + /** + * Lists the PNS Credentials associated with a notification hub . + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param notificationHubName The notification hub name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getPnsCredentialsAsync(String resourceGroupName, String namespaceName, String notificationHubName); + + /** + * Lists the notification hubs associated with a namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param notificationHubName The notification hub name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String namespaceName, String notificationHubName); + + /** + * Lists the notification hubs associated with a namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(final String resourceGroupName, final String namespaceName); + + /** + * Deletes a notification hub associated with a namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param notificationHubName The notification hub name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable deleteAsync(String resourceGroupName, String namespaceName, String notificationHubName); + + /** + * Checks the availability of the given notificationHub in a namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param parameters The notificationHub name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable checkNotificationHubAvailabilityAsync(String resourceGroupName, String namespaceName, CheckAvailabilityParameters parameters); + + /** + * Gets an authorization rule for a NotificationHub by name. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name + * @param notificationHubName The notification hub name. + * @param authorizationRuleName authorization rule name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAuthorizationRuleAsync(String resourceGroupName, String namespaceName, String notificationHubName, String authorizationRuleName); + + /** + * Gets the authorization rules for a NotificationHub. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name + * @param notificationHubName The notification hub name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAuthorizationRulesAsync(final String resourceGroupName, final String namespaceName, final String notificationHubName); + + /** + * Deletes a notificationHub authorization rule. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param notificationHubName The notification hub name. + * @param authorizationRuleName Authorization Rule Name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable deleteAuthorizationRuleAsync(String resourceGroupName, String namespaceName, String notificationHubName, String authorizationRuleName); + + /** + * Gets the Primary and Secondary ConnectionStrings to the NotificationHub. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param notificationHubName The notification hub name. + * @param authorizationRuleName The connection string of the NotificationHub for the specified authorizationRule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listKeysAsync(String resourceGroupName, String namespaceName, String notificationHubName, String authorizationRuleName); + + /** + * Regenerates the Primary/Secondary Keys to the NotificationHub Authorization Rule. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param notificationHubName The notification hub name. + * @param authorizationRuleName The connection string of the NotificationHub for the specified authorizationRule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable regenerateKeysAsync(String resourceGroupName, String namespaceName, String notificationHubName, String authorizationRuleName); + +} diff --git a/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/Operation.java b/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/Operation.java new file mode 100644 index 000000000000..1e307ad4c8e1 --- /dev/null +++ b/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/Operation.java @@ -0,0 +1,30 @@ +/** + * 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.notificationhubs.v2017_04_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.notificationhubs.v2017_04_01.implementation.NotificationHubsManager; +import com.microsoft.azure.management.notificationhubs.v2017_04_01.implementation.OperationInner; + +/** + * Type representing Operation. + */ +public interface Operation extends HasInner, HasManager { + /** + * @return the display value. + */ + OperationDisplay display(); + + /** + * @return the name value. + */ + String name(); + +} diff --git a/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/OperationDisplay.java b/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/OperationDisplay.java new file mode 100644 index 000000000000..a47508a273b3 --- /dev/null +++ b/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/OperationDisplay.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.notificationhubs.v2017_04_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The object that represents the operation. + */ +public class OperationDisplay { + /** + * Service provider: Microsoft.NotificationHubs. + */ + @JsonProperty(value = "provider", access = JsonProperty.Access.WRITE_ONLY) + private String provider; + + /** + * Resource on which the operation is performed: Invoice, etc. + */ + @JsonProperty(value = "resource", access = JsonProperty.Access.WRITE_ONLY) + private String resource; + + /** + * Operation type: Read, write, delete, etc. + */ + @JsonProperty(value = "operation", access = JsonProperty.Access.WRITE_ONLY) + private String operation; + + /** + * Get service provider: Microsoft.NotificationHubs. + * + * @return the provider value + */ + public String provider() { + return this.provider; + } + + /** + * Get resource on which the operation is performed: Invoice, etc. + * + * @return the resource value + */ + public String resource() { + return this.resource; + } + + /** + * Get operation type: Read, write, delete, etc. + * + * @return the operation value + */ + public String operation() { + return this.operation; + } + +} diff --git a/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/Operations.java b/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/Operations.java new file mode 100644 index 000000000000..41e85133e61c --- /dev/null +++ b/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/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.notificationhubs.v2017_04_01; + +import rx.Observable; +import com.microsoft.azure.management.notificationhubs.v2017_04_01.implementation.OperationsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing Operations. + */ +public interface Operations extends HasInner { + /** + * Lists all of the available NotificationHubs REST API operations. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(); + +} diff --git a/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/PnsCredentialsResource.java b/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/PnsCredentialsResource.java new file mode 100644 index 000000000000..c76c04da4bcd --- /dev/null +++ b/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/PnsCredentialsResource.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.notificationhubs.v2017_04_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.notificationhubs.v2017_04_01.implementation.NotificationHubsManager; +import com.microsoft.azure.management.notificationhubs.v2017_04_01.implementation.PnsCredentialsResourceInner; +import java.util.Map; + +/** + * Type representing PnsCredentialsResource. + */ +public interface PnsCredentialsResource extends HasInner, HasManager { + /** + * @return the admCredential value. + */ + AdmCredential admCredential(); + + /** + * @return the apnsCredential value. + */ + ApnsCredential apnsCredential(); + + /** + * @return the baiduCredential value. + */ + BaiduCredential baiduCredential(); + + /** + * @return the gcmCredential value. + */ + GcmCredential gcmCredential(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the location value. + */ + String location(); + + /** + * @return the mpnsCredential value. + */ + MpnsCredential mpnsCredential(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the sku value. + */ + Sku sku(); + + /** + * @return the tags value. + */ + Map tags(); + + /** + * @return the type value. + */ + String type(); + + /** + * @return the wnsCredential value. + */ + WnsCredential wnsCredential(); + +} diff --git a/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/PolicykeyResource.java b/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/PolicykeyResource.java new file mode 100644 index 000000000000..b479554bb73e --- /dev/null +++ b/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/PolicykeyResource.java @@ -0,0 +1,45 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.notificationhubs.v2017_04_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Namespace/NotificationHub Regenerate Keys. + */ +public class PolicykeyResource { + /** + * Name of the key that has to be regenerated for the + * Namespace/Notification Hub Authorization Rule. The value can be Primary + * Key/Secondary Key. + */ + @JsonProperty(value = "policyKey") + private String policyKey; + + /** + * Get name of the key that has to be regenerated for the Namespace/Notification Hub Authorization Rule. The value can be Primary Key/Secondary Key. + * + * @return the policyKey value + */ + public String policyKey() { + return this.policyKey; + } + + /** + * Set name of the key that has to be regenerated for the Namespace/Notification Hub Authorization Rule. The value can be Primary Key/Secondary Key. + * + * @param policyKey the policyKey value to set + * @return the PolicykeyResource object itself. + */ + public PolicykeyResource withPolicyKey(String policyKey) { + this.policyKey = policyKey; + return this; + } + +} diff --git a/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/ResourceListKeys.java b/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/ResourceListKeys.java new file mode 100644 index 000000000000..cd1aa122ef72 --- /dev/null +++ b/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/ResourceListKeys.java @@ -0,0 +1,45 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.notificationhubs.v2017_04_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.notificationhubs.v2017_04_01.implementation.NotificationHubsManager; +import com.microsoft.azure.management.notificationhubs.v2017_04_01.implementation.ResourceListKeysInner; + +/** + * Type representing ResourceListKeys. + */ +public interface ResourceListKeys extends HasInner, HasManager { + /** + * @return the keyName value. + */ + String keyName(); + + /** + * @return the primaryConnectionString value. + */ + String primaryConnectionString(); + + /** + * @return the primaryKey value. + */ + String primaryKey(); + + /** + * @return the secondaryConnectionString value. + */ + String secondaryConnectionString(); + + /** + * @return the secondaryKey value. + */ + String secondaryKey(); + +} diff --git a/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/SharedAccessAuthorizationRuleCreateOrUpdateParameters.java b/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/SharedAccessAuthorizationRuleCreateOrUpdateParameters.java new file mode 100644 index 000000000000..f62d24203035 --- /dev/null +++ b/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/SharedAccessAuthorizationRuleCreateOrUpdateParameters.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.notificationhubs.v2017_04_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Parameters supplied to the CreateOrUpdate Namespace AuthorizationRules. + */ +public class SharedAccessAuthorizationRuleCreateOrUpdateParameters { + /** + * Properties of the Namespace AuthorizationRules. + */ + @JsonProperty(value = "properties", required = true) + private SharedAccessAuthorizationRuleProperties properties; + + /** + * Get properties of the Namespace AuthorizationRules. + * + * @return the properties value + */ + public SharedAccessAuthorizationRuleProperties properties() { + return this.properties; + } + + /** + * Set properties of the Namespace AuthorizationRules. + * + * @param properties the properties value to set + * @return the SharedAccessAuthorizationRuleCreateOrUpdateParameters object itself. + */ + public SharedAccessAuthorizationRuleCreateOrUpdateParameters withProperties(SharedAccessAuthorizationRuleProperties properties) { + this.properties = properties; + return this; + } + +} diff --git a/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/SharedAccessAuthorizationRuleListResult.java b/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/SharedAccessAuthorizationRuleListResult.java new file mode 100644 index 000000000000..7f990c5ce3c8 --- /dev/null +++ b/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/SharedAccessAuthorizationRuleListResult.java @@ -0,0 +1,32 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.notificationhubs.v2017_04_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.notificationhubs.v2017_04_01.implementation.NotificationHubsManager; +import com.microsoft.azure.management.notificationhubs.v2017_04_01.implementation.SharedAccessAuthorizationRuleListResultInner; +import com.microsoft.azure.management.notificationhubs.v2017_04_01.implementation.SharedAccessAuthorizationRuleResourceInner; +import java.util.List; + +/** + * Type representing SharedAccessAuthorizationRuleListResult. + */ +public interface SharedAccessAuthorizationRuleListResult extends HasInner, HasManager { + /** + * @return the nextLink value. + */ + String nextLink(); + + /** + * @return the value value. + */ + List value(); + +} diff --git a/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/SharedAccessAuthorizationRuleProperties.java b/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/SharedAccessAuthorizationRuleProperties.java new file mode 100644 index 000000000000..d3a3186448b2 --- /dev/null +++ b/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/SharedAccessAuthorizationRuleProperties.java @@ -0,0 +1,166 @@ +/** + * 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.notificationhubs.v2017_04_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * SharedAccessAuthorizationRule properties. + */ +public class SharedAccessAuthorizationRuleProperties { + /** + * The rights associated with the rule. + */ + @JsonProperty(value = "rights") + private List rights; + + /** + * A base64-encoded 256-bit primary key for signing and validating the SAS + * token. + */ + @JsonProperty(value = "primaryKey", access = JsonProperty.Access.WRITE_ONLY) + private String primaryKey; + + /** + * A base64-encoded 256-bit primary key for signing and validating the SAS + * token. + */ + @JsonProperty(value = "secondaryKey", access = JsonProperty.Access.WRITE_ONLY) + private String secondaryKey; + + /** + * A string that describes the authorization rule. + */ + @JsonProperty(value = "keyName", access = JsonProperty.Access.WRITE_ONLY) + private String keyName; + + /** + * A string that describes the claim type. + */ + @JsonProperty(value = "claimType", access = JsonProperty.Access.WRITE_ONLY) + private String claimType; + + /** + * A string that describes the claim value. + */ + @JsonProperty(value = "claimValue", access = JsonProperty.Access.WRITE_ONLY) + private String claimValue; + + /** + * The last modified time for this rule. + */ + @JsonProperty(value = "modifiedTime", access = JsonProperty.Access.WRITE_ONLY) + private String modifiedTime; + + /** + * The created time for this rule. + */ + @JsonProperty(value = "createdTime", access = JsonProperty.Access.WRITE_ONLY) + private String createdTime; + + /** + * The revision number for the rule. + */ + @JsonProperty(value = "revision", access = JsonProperty.Access.WRITE_ONLY) + private Integer revision; + + /** + * Get the rights associated with the rule. + * + * @return the rights value + */ + public List rights() { + return this.rights; + } + + /** + * Set the rights associated with the rule. + * + * @param rights the rights value to set + * @return the SharedAccessAuthorizationRuleProperties object itself. + */ + public SharedAccessAuthorizationRuleProperties withRights(List rights) { + this.rights = rights; + return this; + } + + /** + * Get a base64-encoded 256-bit primary key for signing and validating the SAS token. + * + * @return the primaryKey value + */ + public String primaryKey() { + return this.primaryKey; + } + + /** + * Get a base64-encoded 256-bit primary key for signing and validating the SAS token. + * + * @return the secondaryKey value + */ + public String secondaryKey() { + return this.secondaryKey; + } + + /** + * Get a string that describes the authorization rule. + * + * @return the keyName value + */ + public String keyName() { + return this.keyName; + } + + /** + * Get a string that describes the claim type. + * + * @return the claimType value + */ + public String claimType() { + return this.claimType; + } + + /** + * Get a string that describes the claim value. + * + * @return the claimValue value + */ + public String claimValue() { + return this.claimValue; + } + + /** + * Get the last modified time for this rule. + * + * @return the modifiedTime value + */ + public String modifiedTime() { + return this.modifiedTime; + } + + /** + * Get the created time for this rule. + * + * @return the createdTime value + */ + public String createdTime() { + return this.createdTime; + } + + /** + * Get the revision number for the rule. + * + * @return the revision value + */ + public Integer revision() { + return this.revision; + } + +} diff --git a/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/Sku.java b/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/Sku.java new file mode 100644 index 000000000000..2c8558fa3c70 --- /dev/null +++ b/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/Sku.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.notificationhubs.v2017_04_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The Sku description for a namespace. + */ +public class Sku { + /** + * Name of the notification hub sku. Possible values include: 'Free', + * 'Basic', 'Standard'. + */ + @JsonProperty(value = "name", required = true) + private SkuName name; + + /** + * The tier of particular sku. + */ + @JsonProperty(value = "tier") + private String tier; + + /** + * The Sku size. + */ + @JsonProperty(value = "size") + private String size; + + /** + * The Sku Family. + */ + @JsonProperty(value = "family") + private String family; + + /** + * The capacity of the resource. + */ + @JsonProperty(value = "capacity") + private Integer capacity; + + /** + * Get name of the notification hub sku. Possible values include: 'Free', 'Basic', 'Standard'. + * + * @return the name value + */ + public SkuName name() { + return this.name; + } + + /** + * Set name of the notification hub sku. Possible values include: 'Free', 'Basic', 'Standard'. + * + * @param name the name value to set + * @return the Sku object itself. + */ + public Sku withName(SkuName name) { + this.name = name; + return this; + } + + /** + * Get the tier of particular sku. + * + * @return the tier value + */ + public String tier() { + return this.tier; + } + + /** + * Set the tier of particular sku. + * + * @param tier the tier value to set + * @return the Sku object itself. + */ + public Sku withTier(String tier) { + this.tier = tier; + return this; + } + + /** + * Get the Sku size. + * + * @return the size value + */ + public String size() { + return this.size; + } + + /** + * Set the Sku size. + * + * @param size the size value to set + * @return the Sku object itself. + */ + public Sku withSize(String size) { + this.size = size; + return this; + } + + /** + * Get the Sku Family. + * + * @return the family value + */ + public String family() { + return this.family; + } + + /** + * Set the Sku Family. + * + * @param family the family value to set + * @return the Sku object itself. + */ + public Sku withFamily(String family) { + this.family = family; + return this; + } + + /** + * Get the capacity of the resource. + * + * @return the capacity value + */ + public Integer capacity() { + return this.capacity; + } + + /** + * Set the capacity of the resource. + * + * @param capacity the capacity value to set + * @return the Sku object itself. + */ + public Sku withCapacity(Integer capacity) { + this.capacity = capacity; + return this; + } + +} diff --git a/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/SkuName.java b/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/SkuName.java new file mode 100644 index 000000000000..8bbe95bb6cad --- /dev/null +++ b/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/SkuName.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.notificationhubs.v2017_04_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for SkuName. + */ +public final class SkuName extends ExpandableStringEnum { + /** Static value Free for SkuName. */ + public static final SkuName FREE = fromString("Free"); + + /** Static value Basic for SkuName. */ + public static final SkuName BASIC = fromString("Basic"); + + /** Static value Standard for SkuName. */ + public static final SkuName STANDARD = fromString("Standard"); + + /** + * Creates or finds a SkuName from its string representation. + * @param name a name to look for + * @return the corresponding SkuName + */ + @JsonCreator + public static SkuName fromString(String name) { + return fromString(name, SkuName.class); + } + + /** + * @return known SkuName values + */ + public static Collection values() { + return values(SkuName.class); + } +} diff --git a/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/WnsCredential.java b/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/WnsCredential.java new file mode 100644 index 000000000000..8c091a650cd8 --- /dev/null +++ b/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/WnsCredential.java @@ -0,0 +1,97 @@ +/** + * 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.notificationhubs.v2017_04_01; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * Description of a NotificationHub WnsCredential. + */ +@JsonFlatten +public class WnsCredential { + /** + * The package ID for this credential. + */ + @JsonProperty(value = "properties.packageSid") + private String packageSid; + + /** + * The secret key. + */ + @JsonProperty(value = "properties.secretKey") + private String secretKey; + + /** + * The Windows Live endpoint. + */ + @JsonProperty(value = "properties.windowsLiveEndpoint") + private String windowsLiveEndpoint; + + /** + * Get the package ID for this credential. + * + * @return the packageSid value + */ + public String packageSid() { + return this.packageSid; + } + + /** + * Set the package ID for this credential. + * + * @param packageSid the packageSid value to set + * @return the WnsCredential object itself. + */ + public WnsCredential withPackageSid(String packageSid) { + this.packageSid = packageSid; + return this; + } + + /** + * Get the secret key. + * + * @return the secretKey value + */ + public String secretKey() { + return this.secretKey; + } + + /** + * Set the secret key. + * + * @param secretKey the secretKey value to set + * @return the WnsCredential object itself. + */ + public WnsCredential withSecretKey(String secretKey) { + this.secretKey = secretKey; + return this; + } + + /** + * Get the Windows Live endpoint. + * + * @return the windowsLiveEndpoint value + */ + public String windowsLiveEndpoint() { + return this.windowsLiveEndpoint; + } + + /** + * Set the Windows Live endpoint. + * + * @param windowsLiveEndpoint the windowsLiveEndpoint value to set + * @return the WnsCredential object itself. + */ + public WnsCredential withWindowsLiveEndpoint(String windowsLiveEndpoint) { + this.windowsLiveEndpoint = windowsLiveEndpoint; + return this; + } + +} diff --git a/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/implementation/CheckAvailabilityResultImpl.java b/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/implementation/CheckAvailabilityResultImpl.java new file mode 100644 index 000000000000..cc58a6632e4a --- /dev/null +++ b/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/implementation/CheckAvailabilityResultImpl.java @@ -0,0 +1,63 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.notificationhubs.v2017_04_01.implementation; + +import com.microsoft.azure.management.notificationhubs.v2017_04_01.CheckAvailabilityResult; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.notificationhubs.v2017_04_01.Sku; +import java.util.Map; + +class CheckAvailabilityResultImpl extends WrapperImpl implements CheckAvailabilityResult { + private final NotificationHubsManager manager; + CheckAvailabilityResultImpl(CheckAvailabilityResultInner inner, NotificationHubsManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public NotificationHubsManager manager() { + return this.manager; + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public Boolean isAvailiable() { + return this.inner().isAvailiable(); + } + + @Override + public String location() { + return this.inner().location(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public Sku sku() { + return this.inner().sku(); + } + + @Override + public Map tags() { + return this.inner().getTags(); + } + + @Override + public String type() { + return this.inner().type(); + } + +} diff --git a/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/implementation/CheckAvailabilityResultInner.java b/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/implementation/CheckAvailabilityResultInner.java new file mode 100644 index 000000000000..1080a649ee40 --- /dev/null +++ b/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/implementation/CheckAvailabilityResultInner.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.notificationhubs.v2017_04_01.implementation; + +import com.microsoft.azure.management.notificationhubs.v2017_04_01.Sku; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.SkipParentValidation; +import com.microsoft.azure.Resource; + +/** + * Description of a CheckAvailibility resource. + */ +@SkipParentValidation +public class CheckAvailabilityResultInner extends Resource { + /** + * True if the name is available and can be used to create new + * Namespace/NotificationHub. Otherwise false. + */ + @JsonProperty(value = "isAvailiable") + private Boolean isAvailiable; + + /** + * The sku of the created namespace. + */ + @JsonProperty(value = "sku") + private Sku sku; + + /** + * Get true if the name is available and can be used to create new Namespace/NotificationHub. Otherwise false. + * + * @return the isAvailiable value + */ + public Boolean isAvailiable() { + return this.isAvailiable; + } + + /** + * Set true if the name is available and can be used to create new Namespace/NotificationHub. Otherwise false. + * + * @param isAvailiable the isAvailiable value to set + * @return the CheckAvailabilityResultInner object itself. + */ + public CheckAvailabilityResultInner withIsAvailiable(Boolean isAvailiable) { + this.isAvailiable = isAvailiable; + return this; + } + + /** + * Get the sku of the created namespace. + * + * @return the sku value + */ + public Sku sku() { + return this.sku; + } + + /** + * Set the sku of the created namespace. + * + * @param sku the sku value to set + * @return the CheckAvailabilityResultInner object itself. + */ + public CheckAvailabilityResultInner withSku(Sku sku) { + this.sku = sku; + return this; + } + +} diff --git a/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/implementation/DebugSendResponseImpl.java b/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/implementation/DebugSendResponseImpl.java new file mode 100644 index 000000000000..f23e9e9cf239 --- /dev/null +++ b/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/implementation/DebugSendResponseImpl.java @@ -0,0 +1,73 @@ +/** + * 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.notificationhubs.v2017_04_01.implementation; + +import com.microsoft.azure.management.notificationhubs.v2017_04_01.DebugSendResponse; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.notificationhubs.v2017_04_01.Sku; +import java.util.Map; + +class DebugSendResponseImpl extends WrapperImpl implements DebugSendResponse { + private final NotificationHubsManager manager; + DebugSendResponseImpl(DebugSendResponseInner inner, NotificationHubsManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public NotificationHubsManager manager() { + return this.manager; + } + + @Override + public Double failure() { + return this.inner().failure(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String location() { + return this.inner().location(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public Object results() { + return this.inner().results(); + } + + @Override + public Sku sku() { + return this.inner().sku(); + } + + @Override + public Double success() { + return this.inner().success(); + } + + @Override + public Map tags() { + return this.inner().getTags(); + } + + @Override + public String type() { + return this.inner().type(); + } + +} diff --git a/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/implementation/DebugSendResponseInner.java b/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/implementation/DebugSendResponseInner.java new file mode 100644 index 000000000000..540ed0253930 --- /dev/null +++ b/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/implementation/DebugSendResponseInner.java @@ -0,0 +1,127 @@ +/** + * 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.notificationhubs.v2017_04_01.implementation; + +import com.microsoft.azure.management.notificationhubs.v2017_04_01.Sku; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.rest.SkipParentValidation; +import com.microsoft.azure.Resource; + +/** + * Description of a NotificationHub Resource. + */ +@JsonFlatten +@SkipParentValidation +public class DebugSendResponseInner extends Resource { + /** + * successful send. + */ + @JsonProperty(value = "properties.success") + private Double success; + + /** + * send failure. + */ + @JsonProperty(value = "properties.failure") + private Double failure; + + /** + * actual failure description. + */ + @JsonProperty(value = "properties.results") + private Object results; + + /** + * The sku of the created namespace. + */ + @JsonProperty(value = "sku") + private Sku sku; + + /** + * Get successful send. + * + * @return the success value + */ + public Double success() { + return this.success; + } + + /** + * Set successful send. + * + * @param success the success value to set + * @return the DebugSendResponseInner object itself. + */ + public DebugSendResponseInner withSuccess(Double success) { + this.success = success; + return this; + } + + /** + * Get send failure. + * + * @return the failure value + */ + public Double failure() { + return this.failure; + } + + /** + * Set send failure. + * + * @param failure the failure value to set + * @return the DebugSendResponseInner object itself. + */ + public DebugSendResponseInner withFailure(Double failure) { + this.failure = failure; + return this; + } + + /** + * Get actual failure description. + * + * @return the results value + */ + public Object results() { + return this.results; + } + + /** + * Set actual failure description. + * + * @param results the results value to set + * @return the DebugSendResponseInner object itself. + */ + public DebugSendResponseInner withResults(Object results) { + this.results = results; + return this; + } + + /** + * Get the sku of the created namespace. + * + * @return the sku value + */ + public Sku sku() { + return this.sku; + } + + /** + * Set the sku of the created namespace. + * + * @param sku the sku value to set + * @return the DebugSendResponseInner object itself. + */ + public DebugSendResponseInner withSku(Sku sku) { + this.sku = sku; + return this; + } + +} diff --git a/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/implementation/IdParsingUtils.java b/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/implementation/IdParsingUtils.java new file mode 100644 index 000000000000..d4aa4aeb65c5 --- /dev/null +++ b/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/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.notificationhubs.v2017_04_01.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/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/implementation/NamespaceResourceImpl.java b/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/implementation/NamespaceResourceImpl.java new file mode 100644 index 000000000000..78651650e8c5 --- /dev/null +++ b/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/implementation/NamespaceResourceImpl.java @@ -0,0 +1,228 @@ +/** + * 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.notificationhubs.v2017_04_01.implementation; + +import com.microsoft.azure.arm.resources.models.implementation.GroupableResourceCoreImpl; +import com.microsoft.azure.management.notificationhubs.v2017_04_01.NamespaceResource; +import rx.Observable; +import com.microsoft.azure.management.notificationhubs.v2017_04_01.NamespacePatchParameters; +import com.microsoft.azure.management.notificationhubs.v2017_04_01.NamespaceCreateOrUpdateParameters; +import org.joda.time.DateTime; +import com.microsoft.azure.management.notificationhubs.v2017_04_01.NamespaceType; +import com.microsoft.azure.management.notificationhubs.v2017_04_01.Sku; +import rx.functions.Func1; + +class NamespaceResourceImpl extends GroupableResourceCoreImpl implements NamespaceResource, NamespaceResource.Definition, NamespaceResource.Update { + private NamespaceCreateOrUpdateParameters createParameter; + private NamespacePatchParameters updateParameter; + NamespaceResourceImpl(String name, NamespaceResourceInner inner, NotificationHubsManager manager) { + super(name, inner, manager); + this.createParameter = new NamespaceCreateOrUpdateParameters(); + this.updateParameter = new NamespacePatchParameters(); + } + + @Override + public Observable createResourceAsync() { + NamespacesInner client = this.manager().inner().namespaces(); + this.createParameter.withLocation(inner().location()); + this.createParameter.withTags(inner().getTags()); + return client.createOrUpdateAsync(this.resourceGroupName(), this.name(), this.createParameter) + .map(new Func1() { + @Override + public NamespaceResourceInner call(NamespaceResourceInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + NamespacesInner client = this.manager().inner().namespaces(); + return client.patchAsync(this.resourceGroupName(), this.name(), this.updateParameter) + .map(new Func1() { + @Override + public NamespaceResourceInner call(NamespaceResourceInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + NamespacesInner client = this.manager().inner().namespaces(); + return client.getByResourceGroupAsync(this.resourceGroupName(), this.name()); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + private void resetCreateUpdateParameters() { + this.createParameter = new NamespaceCreateOrUpdateParameters(); + this.updateParameter = new NamespacePatchParameters(); + } + + @Override + public DateTime createdAt() { + return this.inner().createdAt(); + } + + @Override + public Boolean critical() { + return this.inner().critical(); + } + + @Override + public String dataCenter() { + return this.inner().dataCenter(); + } + + @Override + public Boolean enabled() { + return this.inner().enabled(); + } + + @Override + public String metricId() { + return this.inner().metricId(); + } + + @Override + public String namespaceResourceName() { + return this.inner().namespaceResourceName(); + } + + @Override + public NamespaceType namespaceType() { + return this.inner().namespaceType(); + } + + @Override + public String provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public String scaleUnit() { + return this.inner().scaleUnit(); + } + + @Override + public String serviceBusEndpoint() { + return this.inner().serviceBusEndpoint(); + } + + @Override + public Sku sku() { + return this.inner().sku(); + } + + @Override + public String status() { + return this.inner().status(); + } + + @Override + public String subscriptionId() { + return this.inner().subscriptionId(); + } + + @Override + public DateTime updatedAt() { + return this.inner().updatedAt(); + } + + @Override + public NamespaceResourceImpl withCreatedAt(DateTime createdAt) { + this.createParameter.withCreatedAt(createdAt); + return this; + } + + @Override + public NamespaceResourceImpl withCritical(Boolean critical) { + this.createParameter.withCritical(critical); + return this; + } + + @Override + public NamespaceResourceImpl withDataCenter(String dataCenter) { + this.createParameter.withDataCenter(dataCenter); + return this; + } + + @Override + public NamespaceResourceImpl withEnabled(Boolean enabled) { + this.createParameter.withEnabled(enabled); + return this; + } + + @Override + public NamespaceResourceImpl withNamespaceCreateOrUpdateParametersName(String namespaceCreateOrUpdateParametersName) { + this.createParameter.withNamespaceCreateOrUpdateParametersName(namespaceCreateOrUpdateParametersName); + return this; + } + + @Override + public NamespaceResourceImpl withNamespaceType(NamespaceType namespaceType) { + this.createParameter.withNamespaceType(namespaceType); + return this; + } + + @Override + public NamespaceResourceImpl withProvisioningState(String provisioningState) { + this.createParameter.withProvisioningState(provisioningState); + return this; + } + + @Override + public NamespaceResourceImpl withScaleUnit(String scaleUnit) { + this.createParameter.withScaleUnit(scaleUnit); + return this; + } + + @Override + public NamespaceResourceImpl withServiceBusEndpoint(String serviceBusEndpoint) { + this.createParameter.withServiceBusEndpoint(serviceBusEndpoint); + return this; + } + + @Override + public NamespaceResourceImpl withStatus(String status) { + this.createParameter.withStatus(status); + return this; + } + + @Override + public NamespaceResourceImpl withSubscriptionId(String subscriptionId) { + this.createParameter.withSubscriptionId(subscriptionId); + return this; + } + + @Override + public NamespaceResourceImpl withUpdatedAt(DateTime updatedAt) { + this.createParameter.withUpdatedAt(updatedAt); + return this; + } + + @Override + public NamespaceResourceImpl withSku(Sku sku) { + if (isInCreateMode()) { + this.createParameter.withSku(sku); + } else { + this.updateParameter.withSku(sku); + } + return this; + } + +} diff --git a/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/implementation/NamespaceResourceInner.java b/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/implementation/NamespaceResourceInner.java new file mode 100644 index 000000000000..a7e015a1611c --- /dev/null +++ b/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/implementation/NamespaceResourceInner.java @@ -0,0 +1,410 @@ +/** + * 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.notificationhubs.v2017_04_01.implementation; + +import org.joda.time.DateTime; +import com.microsoft.azure.management.notificationhubs.v2017_04_01.NamespaceType; +import com.microsoft.azure.management.notificationhubs.v2017_04_01.Sku; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.rest.SkipParentValidation; +import com.microsoft.azure.Resource; + +/** + * Description of a Namespace resource. + */ +@JsonFlatten +@SkipParentValidation +public class NamespaceResourceInner extends Resource { + /** + * The name of the namespace. + */ + @JsonProperty(value = "properties.name") + private String namespaceResourceName; + + /** + * Provisioning state of the Namespace. + */ + @JsonProperty(value = "properties.provisioningState") + private String provisioningState; + + /** + * Specifies the targeted region in which the namespace should be created. + * It can be any of the following values: Australia EastAustralia + * SoutheastCentral USEast USEast US 2West USNorth Central USSouth Central + * USEast AsiaSoutheast AsiaBrazil SouthJapan EastJapan WestNorth + * EuropeWest Europe. + */ + @JsonProperty(value = "properties.region") + private String region; + + /** + * Identifier for Azure Insights metrics. + */ + @JsonProperty(value = "properties.metricId", access = JsonProperty.Access.WRITE_ONLY) + private String metricId; + + /** + * Status of the namespace. It can be any of these values:1 = + * Created/Active2 = Creating3 = Suspended4 = Deleting. + */ + @JsonProperty(value = "properties.status") + private String status; + + /** + * The time the namespace was created. + */ + @JsonProperty(value = "properties.createdAt") + private DateTime createdAt; + + /** + * The time the namespace was updated. + */ + @JsonProperty(value = "properties.updatedAt") + private DateTime updatedAt; + + /** + * Endpoint you can use to perform NotificationHub operations. + */ + @JsonProperty(value = "properties.serviceBusEndpoint") + private String serviceBusEndpoint; + + /** + * The Id of the Azure subscription associated with the namespace. + */ + @JsonProperty(value = "properties.subscriptionId") + private String subscriptionId; + + /** + * ScaleUnit where the namespace gets created. + */ + @JsonProperty(value = "properties.scaleUnit") + private String scaleUnit; + + /** + * Whether or not the namespace is currently enabled. + */ + @JsonProperty(value = "properties.enabled") + private Boolean enabled; + + /** + * Whether or not the namespace is set as Critical. + */ + @JsonProperty(value = "properties.critical") + private Boolean critical; + + /** + * Data center for the namespace. + */ + @JsonProperty(value = "properties.dataCenter") + private String dataCenter; + + /** + * The namespace type. Possible values include: 'Messaging', + * 'NotificationHub'. + */ + @JsonProperty(value = "properties.namespaceType") + private NamespaceType namespaceType; + + /** + * The sku of the created namespace. + */ + @JsonProperty(value = "sku") + private Sku sku; + + /** + * Get the name of the namespace. + * + * @return the namespaceResourceName value + */ + public String namespaceResourceName() { + return this.namespaceResourceName; + } + + /** + * Set the name of the namespace. + * + * @param namespaceResourceName the namespaceResourceName value to set + * @return the NamespaceResourceInner object itself. + */ + public NamespaceResourceInner withNamespaceResourceName(String namespaceResourceName) { + this.namespaceResourceName = namespaceResourceName; + return this; + } + + /** + * Get provisioning state of the Namespace. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Set provisioning state of the Namespace. + * + * @param provisioningState the provisioningState value to set + * @return the NamespaceResourceInner object itself. + */ + public NamespaceResourceInner withProvisioningState(String provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * Get specifies the targeted region in which the namespace should be created. It can be any of the following values: Australia EastAustralia SoutheastCentral USEast USEast US 2West USNorth Central USSouth Central USEast AsiaSoutheast AsiaBrazil SouthJapan EastJapan WestNorth EuropeWest Europe. + * + * @return the region value + */ + public String region() { + return this.region; + } + + /** + * Set specifies the targeted region in which the namespace should be created. It can be any of the following values: Australia EastAustralia SoutheastCentral USEast USEast US 2West USNorth Central USSouth Central USEast AsiaSoutheast AsiaBrazil SouthJapan EastJapan WestNorth EuropeWest Europe. + * + * @param region the region value to set + * @return the NamespaceResourceInner object itself. + */ + public NamespaceResourceInner withRegion(String region) { + this.region = region; + return this; + } + + /** + * Get identifier for Azure Insights metrics. + * + * @return the metricId value + */ + public String metricId() { + return this.metricId; + } + + /** + * Get status of the namespace. It can be any of these values:1 = Created/Active2 = Creating3 = Suspended4 = Deleting. + * + * @return the status value + */ + public String status() { + return this.status; + } + + /** + * Set status of the namespace. It can be any of these values:1 = Created/Active2 = Creating3 = Suspended4 = Deleting. + * + * @param status the status value to set + * @return the NamespaceResourceInner object itself. + */ + public NamespaceResourceInner withStatus(String status) { + this.status = status; + return this; + } + + /** + * Get the time the namespace was created. + * + * @return the createdAt value + */ + public DateTime createdAt() { + return this.createdAt; + } + + /** + * Set the time the namespace was created. + * + * @param createdAt the createdAt value to set + * @return the NamespaceResourceInner object itself. + */ + public NamespaceResourceInner withCreatedAt(DateTime createdAt) { + this.createdAt = createdAt; + return this; + } + + /** + * Get the time the namespace was updated. + * + * @return the updatedAt value + */ + public DateTime updatedAt() { + return this.updatedAt; + } + + /** + * Set the time the namespace was updated. + * + * @param updatedAt the updatedAt value to set + * @return the NamespaceResourceInner object itself. + */ + public NamespaceResourceInner withUpdatedAt(DateTime updatedAt) { + this.updatedAt = updatedAt; + return this; + } + + /** + * Get endpoint you can use to perform NotificationHub operations. + * + * @return the serviceBusEndpoint value + */ + public String serviceBusEndpoint() { + return this.serviceBusEndpoint; + } + + /** + * Set endpoint you can use to perform NotificationHub operations. + * + * @param serviceBusEndpoint the serviceBusEndpoint value to set + * @return the NamespaceResourceInner object itself. + */ + public NamespaceResourceInner withServiceBusEndpoint(String serviceBusEndpoint) { + this.serviceBusEndpoint = serviceBusEndpoint; + return this; + } + + /** + * Get the Id of the Azure subscription associated with the namespace. + * + * @return the subscriptionId value + */ + public String subscriptionId() { + return this.subscriptionId; + } + + /** + * Set the Id of the Azure subscription associated with the namespace. + * + * @param subscriptionId the subscriptionId value to set + * @return the NamespaceResourceInner object itself. + */ + public NamespaceResourceInner withSubscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; + return this; + } + + /** + * Get scaleUnit where the namespace gets created. + * + * @return the scaleUnit value + */ + public String scaleUnit() { + return this.scaleUnit; + } + + /** + * Set scaleUnit where the namespace gets created. + * + * @param scaleUnit the scaleUnit value to set + * @return the NamespaceResourceInner object itself. + */ + public NamespaceResourceInner withScaleUnit(String scaleUnit) { + this.scaleUnit = scaleUnit; + return this; + } + + /** + * Get whether or not the namespace is currently enabled. + * + * @return the enabled value + */ + public Boolean enabled() { + return this.enabled; + } + + /** + * Set whether or not the namespace is currently enabled. + * + * @param enabled the enabled value to set + * @return the NamespaceResourceInner object itself. + */ + public NamespaceResourceInner withEnabled(Boolean enabled) { + this.enabled = enabled; + return this; + } + + /** + * Get whether or not the namespace is set as Critical. + * + * @return the critical value + */ + public Boolean critical() { + return this.critical; + } + + /** + * Set whether or not the namespace is set as Critical. + * + * @param critical the critical value to set + * @return the NamespaceResourceInner object itself. + */ + public NamespaceResourceInner withCritical(Boolean critical) { + this.critical = critical; + return this; + } + + /** + * Get data center for the namespace. + * + * @return the dataCenter value + */ + public String dataCenter() { + return this.dataCenter; + } + + /** + * Set data center for the namespace. + * + * @param dataCenter the dataCenter value to set + * @return the NamespaceResourceInner object itself. + */ + public NamespaceResourceInner withDataCenter(String dataCenter) { + this.dataCenter = dataCenter; + return this; + } + + /** + * Get the namespace type. Possible values include: 'Messaging', 'NotificationHub'. + * + * @return the namespaceType value + */ + public NamespaceType namespaceType() { + return this.namespaceType; + } + + /** + * Set the namespace type. Possible values include: 'Messaging', 'NotificationHub'. + * + * @param namespaceType the namespaceType value to set + * @return the NamespaceResourceInner object itself. + */ + public NamespaceResourceInner withNamespaceType(NamespaceType namespaceType) { + this.namespaceType = namespaceType; + return this; + } + + /** + * Get the sku of the created namespace. + * + * @return the sku value + */ + public Sku sku() { + return this.sku; + } + + /** + * Set the sku of the created namespace. + * + * @param sku the sku value to set + * @return the NamespaceResourceInner object itself. + */ + public NamespaceResourceInner withSku(Sku sku) { + this.sku = sku; + return this; + } + +} diff --git a/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/implementation/NamespaceSharedAccessAuthorizationRuleResourceImpl.java b/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/implementation/NamespaceSharedAccessAuthorizationRuleResourceImpl.java new file mode 100644 index 000000000000..28d5772bca46 --- /dev/null +++ b/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/implementation/NamespaceSharedAccessAuthorizationRuleResourceImpl.java @@ -0,0 +1,194 @@ +/** + * 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.notificationhubs.v2017_04_01.implementation; + +import com.microsoft.azure.management.notificationhubs.v2017_04_01.NamespaceSharedAccessAuthorizationRuleResource; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import com.microsoft.azure.management.notificationhubs.v2017_04_01.SharedAccessAuthorizationRuleProperties; +import java.util.List; +import com.microsoft.azure.management.notificationhubs.v2017_04_01.AccessRights; +import com.microsoft.azure.management.notificationhubs.v2017_04_01.Sku; +import java.util.Map; +import rx.functions.Func1; + +class NamespaceSharedAccessAuthorizationRuleResourceImpl extends CreatableUpdatableImpl implements NamespaceSharedAccessAuthorizationRuleResource, NamespaceSharedAccessAuthorizationRuleResource.Definition, NamespaceSharedAccessAuthorizationRuleResource.Update { + private final NotificationHubsManager manager; + private String resourceGroupName; + private String namespaceName; + private String authorizationRuleName; + private SharedAccessAuthorizationRuleProperties cproperties; + private SharedAccessAuthorizationRuleProperties uproperties; + + NamespaceSharedAccessAuthorizationRuleResourceImpl(String name, NotificationHubsManager manager) { + super(name, new SharedAccessAuthorizationRuleResourceInner()); + this.manager = manager; + // Set resource name + this.authorizationRuleName = name; + // + this.cproperties = new SharedAccessAuthorizationRuleProperties(); + this.uproperties = new SharedAccessAuthorizationRuleProperties(); + } + + NamespaceSharedAccessAuthorizationRuleResourceImpl(SharedAccessAuthorizationRuleResourceInner inner, NotificationHubsManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.authorizationRuleName = inner.name(); + // resource ancestor names + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.namespaceName = IdParsingUtils.getValueFromIdByName(inner.id(), "namespaces"); + this.authorizationRuleName = IdParsingUtils.getValueFromIdByName(inner.id(), "AuthorizationRules"); + // + this.cproperties = new SharedAccessAuthorizationRuleProperties(); + this.uproperties = new SharedAccessAuthorizationRuleProperties(); + } + + @Override + public NotificationHubsManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + NamespacesInner client = this.manager().inner().namespaces(); + return client.createOrUpdateAuthorizationRuleAsync(this.resourceGroupName, this.namespaceName, this.authorizationRuleName, this.cproperties) + .map(new Func1() { + @Override + public SharedAccessAuthorizationRuleResourceInner call(SharedAccessAuthorizationRuleResourceInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + NamespacesInner client = this.manager().inner().namespaces(); + return client.createOrUpdateAuthorizationRuleAsync(this.resourceGroupName, this.namespaceName, this.authorizationRuleName, this.uproperties) + .map(new Func1() { + @Override + public SharedAccessAuthorizationRuleResourceInner call(SharedAccessAuthorizationRuleResourceInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + NamespacesInner client = this.manager().inner().namespaces(); + return client.getAuthorizationRuleAsync(this.resourceGroupName, this.namespaceName, this.authorizationRuleName); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + private void resetCreateUpdateParameters() { + this.cproperties = new SharedAccessAuthorizationRuleProperties(); + this.uproperties = new SharedAccessAuthorizationRuleProperties(); + } + + @Override + public String claimType() { + return this.inner().claimType(); + } + + @Override + public String claimValue() { + return this.inner().claimValue(); + } + + @Override + public String createdTime() { + return this.inner().createdTime(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String keyName() { + return this.inner().keyName(); + } + + @Override + public String location() { + return this.inner().location(); + } + + @Override + public String modifiedTime() { + return this.inner().modifiedTime(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public String primaryKey() { + return this.inner().primaryKey(); + } + + @Override + public Integer revision() { + return this.inner().revision(); + } + + @Override + public List rights() { + return this.inner().rights(); + } + + @Override + public String secondaryKey() { + return this.inner().secondaryKey(); + } + + @Override + public Sku sku() { + return this.inner().sku(); + } + + @Override + public Map tags() { + return this.inner().getTags(); + } + + @Override + public String type() { + return this.inner().type(); + } + + @Override + public NamespaceSharedAccessAuthorizationRuleResourceImpl withExistingNamespace(String resourceGroupName, String namespaceName) { + this.resourceGroupName = resourceGroupName; + this.namespaceName = namespaceName; + return this; + } + + @Override + public NamespaceSharedAccessAuthorizationRuleResourceImpl withProperties(SharedAccessAuthorizationRuleProperties properties) { + if (isInCreateMode()) { + this.cproperties = properties; + } else { + this.uproperties = properties; + } + return this; + } + +} diff --git a/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/implementation/NamespacesImpl.java b/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/implementation/NamespacesImpl.java new file mode 100644 index 000000000000..08561e14e2fe --- /dev/null +++ b/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/implementation/NamespacesImpl.java @@ -0,0 +1,236 @@ +/** + * 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.notificationhubs.v2017_04_01.implementation; + +import com.microsoft.azure.arm.resources.collection.implementation.GroupableResourcesCoreImpl; +import com.microsoft.azure.management.notificationhubs.v2017_04_01.Namespaces; +import com.microsoft.azure.management.notificationhubs.v2017_04_01.NamespaceResource; +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.notificationhubs.v2017_04_01.CheckAvailabilityResult; +import com.microsoft.azure.management.notificationhubs.v2017_04_01.CheckAvailabilityParameters; +import com.microsoft.azure.management.notificationhubs.v2017_04_01.NamespaceSharedAccessAuthorizationRuleResource; +import com.microsoft.azure.management.notificationhubs.v2017_04_01.SharedAccessAuthorizationRuleListResult; +import com.microsoft.azure.management.notificationhubs.v2017_04_01.ResourceListKeys; + +class NamespacesImpl extends GroupableResourcesCoreImpl implements Namespaces { + protected NamespacesImpl(NotificationHubsManager manager) { + super(manager.inner().namespaces(), manager); + } + + @Override + protected Observable getInnerAsync(String resourceGroupName, String name) { + NamespacesInner client = this.inner(); + return client.getByResourceGroupAsync(resourceGroupName, name); + } + + @Override + protected Completable deleteInnerAsync(String resourceGroupName, String name) { + NamespacesInner 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) { + NamespacesInner client = this.inner(); + return this.wrapList(client.listByResourceGroup(resourceGroupName)); + } + + @Override + public Observable listByResourceGroupAsync(String resourceGroupName) { + NamespacesInner 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 NamespaceResource call(NamespaceResourceInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public PagedList list() { + NamespacesInner client = this.inner(); + return this.wrapList(client.list()); + } + + @Override + public Observable listAsync() { + NamespacesInner client = this.inner(); + return client.listAsync() + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public NamespaceResource call(NamespaceResourceInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public NamespaceResourceImpl define(String name) { + return wrapModel(name); + } + + @Override + public Observable checkAvailabilityAsync(CheckAvailabilityParameters parameters) { + NamespacesInner client = this.inner(); + return client.checkAvailabilityAsync(parameters) + .map(new Func1() { + @Override + public CheckAvailabilityResult call(CheckAvailabilityResultInner inner) { + return new CheckAvailabilityResultImpl(inner, manager()); + } + }); + } + + @Override + protected NamespaceResourceImpl wrapModel(NamespaceResourceInner inner) { + return new NamespaceResourceImpl(inner.name(), inner, manager()); + } + + @Override + protected NamespaceResourceImpl wrapModel(String name) { + return new NamespaceResourceImpl(name, new NamespaceResourceInner(), this.manager()); + } + + @Override + public NamespaceSharedAccessAuthorizationRuleResourceImpl defineAuthorizationRule(String name) { + return wrapAuthorizationRuleModel(name); + } + + private NamespaceSharedAccessAuthorizationRuleResourceImpl wrapAuthorizationRuleModel(String name) { + return new NamespaceSharedAccessAuthorizationRuleResourceImpl(name, this.manager()); + } + + private NamespaceSharedAccessAuthorizationRuleResourceImpl wrapNamespaceSharedAccessAuthorizationRuleResourceModel(SharedAccessAuthorizationRuleResourceInner inner) { + return new NamespaceSharedAccessAuthorizationRuleResourceImpl(inner, manager()); + } + + private Observable getSharedAccessAuthorizationRuleResourceInnerUsingNamespacesInnerAsync(String id) { + String resourceGroupName = IdParsingUtils.getValueFromIdByName(id, "resourceGroups"); + String namespaceName = IdParsingUtils.getValueFromIdByName(id, "namespaces"); + String authorizationRuleName = IdParsingUtils.getValueFromIdByName(id, "AuthorizationRules"); + NamespacesInner client = this.inner(); + return client.getAuthorizationRuleAsync(resourceGroupName, namespaceName, authorizationRuleName); + } + + @Override + public Observable getAuthorizationRuleAsync(String resourceGroupName, String namespaceName, String authorizationRuleName) { + NamespacesInner client = this.inner(); + return client.getAuthorizationRuleAsync(resourceGroupName, namespaceName, authorizationRuleName) + .map(new Func1() { + @Override + public NamespaceSharedAccessAuthorizationRuleResource call(SharedAccessAuthorizationRuleResourceInner inner) { + return wrapNamespaceSharedAccessAuthorizationRuleResourceModel(inner); + } + }); + } + + @Override + public Observable listAuthorizationRulesAsync(final String resourceGroupName, final String namespaceName) { + NamespacesInner client = this.inner(); + return client.listAuthorizationRulesAsync(resourceGroupName, namespaceName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public NamespaceSharedAccessAuthorizationRuleResource call(SharedAccessAuthorizationRuleResourceInner inner) { + return wrapNamespaceSharedAccessAuthorizationRuleResourceModel(inner); + } + }); + } + + @Override + public Completable deleteAuthorizationRuleAsync(String resourceGroupName, String namespaceName, String authorizationRuleName) { + NamespacesInner client = this.inner(); + return client.deleteAuthorizationRuleAsync(resourceGroupName, namespaceName, authorizationRuleName).toCompletable(); + } + + @Override + public Observable listKeysAsync(String resourceGroupName, String namespaceName, String authorizationRuleName) { + NamespacesInner client = this.inner(); + return client.listKeysAsync(resourceGroupName, namespaceName, authorizationRuleName) + .map(new Func1() { + @Override + public SharedAccessAuthorizationRuleListResult call(SharedAccessAuthorizationRuleListResultInner inner) { + return new SharedAccessAuthorizationRuleListResultImpl(inner, manager()); + } + }); + } + + @Override + public Observable regenerateKeysAsync(String resourceGroupName, String namespaceName, String authorizationRuleName) { + NamespacesInner client = this.inner(); + return client.regenerateKeysAsync(resourceGroupName, namespaceName, authorizationRuleName) + .map(new Func1() { + @Override + public ResourceListKeys call(ResourceListKeysInner inner) { + return new ResourceListKeysImpl(inner, manager()); + } + }); + } + +} diff --git a/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/implementation/NamespacesInner.java b/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/implementation/NamespacesInner.java new file mode 100644 index 000000000000..19656b77575a --- /dev/null +++ b/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/implementation/NamespacesInner.java @@ -0,0 +1,1903 @@ +/** + * 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.notificationhubs.v2017_04_01.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.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.notificationhubs.v2017_04_01.CheckAvailabilityParameters; +import com.microsoft.azure.management.notificationhubs.v2017_04_01.NamespaceCreateOrUpdateParameters; +import com.microsoft.azure.management.notificationhubs.v2017_04_01.NamespacePatchParameters; +import com.microsoft.azure.management.notificationhubs.v2017_04_01.PolicykeyResource; +import com.microsoft.azure.management.notificationhubs.v2017_04_01.SharedAccessAuthorizationRuleCreateOrUpdateParameters; +import com.microsoft.azure.management.notificationhubs.v2017_04_01.SharedAccessAuthorizationRuleProperties; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.PATCH; +import retrofit2.http.Path; +import retrofit2.http.POST; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Namespaces. + */ +public class NamespacesInner implements InnerSupportsGet, InnerSupportsDelete, InnerSupportsListing { + /** The Retrofit service to perform REST calls. */ + private NamespacesService service; + /** The service client containing this operation class. */ + private NotificationHubsManagementClientImpl client; + + /** + * Initializes an instance of NamespacesInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public NamespacesInner(Retrofit retrofit, NotificationHubsManagementClientImpl client) { + this.service = retrofit.create(NamespacesService.class); + this.client = client; + } + + /** + * The interface defining all the services for Namespaces to be + * used by Retrofit to perform actually REST calls. + */ + interface NamespacesService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.notificationhubs.v2017_04_01.Namespaces checkAvailability" }) + @POST("subscriptions/{subscriptionId}/providers/Microsoft.NotificationHubs/checkNamespaceAvailability") + Observable> checkAvailability(@Path("subscriptionId") String subscriptionId, @Body CheckAvailabilityParameters parameters, @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.notificationhubs.v2017_04_01.Namespaces createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}") + Observable> createOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @Path("subscriptionId") String subscriptionId, @Body NamespaceCreateOrUpdateParameters parameters, @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.notificationhubs.v2017_04_01.Namespaces patch" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}") + Observable> patch(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @Path("subscriptionId") String subscriptionId, @Body NamespacePatchParameters parameters, @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.notificationhubs.v2017_04_01.Namespaces delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @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.notificationhubs.v2017_04_01.Namespaces beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @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.notificationhubs.v2017_04_01.Namespaces getByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}") + Observable> getByResourceGroup(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @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.notificationhubs.v2017_04_01.Namespaces createOrUpdateAuthorizationRule" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/AuthorizationRules/{authorizationRuleName}") + Observable> createOrUpdateAuthorizationRule(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @Path("authorizationRuleName") String authorizationRuleName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body SharedAccessAuthorizationRuleCreateOrUpdateParameters parameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.notificationhubs.v2017_04_01.Namespaces deleteAuthorizationRule" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/AuthorizationRules/{authorizationRuleName}", method = "DELETE", hasBody = true) + Observable> deleteAuthorizationRule(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @Path("authorizationRuleName") String authorizationRuleName, @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.notificationhubs.v2017_04_01.Namespaces getAuthorizationRule" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/AuthorizationRules/{authorizationRuleName}") + Observable> getAuthorizationRule(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @Path("authorizationRuleName") String authorizationRuleName, @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.notificationhubs.v2017_04_01.Namespaces listByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces") + Observable> listByResourceGroup(@Path("resourceGroupName") String resourceGroupName, @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.notificationhubs.v2017_04_01.Namespaces list" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.NotificationHubs/namespaces") + 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.notificationhubs.v2017_04_01.Namespaces listAuthorizationRules" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/AuthorizationRules") + Observable> listAuthorizationRules(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @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.notificationhubs.v2017_04_01.Namespaces listKeys" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/AuthorizationRules/{authorizationRuleName}/listKeys") + Observable> listKeys(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @Path("authorizationRuleName") String authorizationRuleName, @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.notificationhubs.v2017_04_01.Namespaces regenerateKeys" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/AuthorizationRules/{authorizationRuleName}/regenerateKeys") + Observable> regenerateKeys(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @Path("authorizationRuleName") String authorizationRuleName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body PolicykeyResource parameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.notificationhubs.v2017_04_01.Namespaces listByResourceGroupNext" }) + @GET + Observable> listByResourceGroupNext(@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.notificationhubs.v2017_04_01.Namespaces 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.notificationhubs.v2017_04_01.Namespaces listAuthorizationRulesNext" }) + @GET + Observable> listAuthorizationRulesNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Checks the availability of the given service namespace across all Azure subscriptions. This is useful because the domain name is created based on the service namespace name. + * + * @param parameters The namespace name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the CheckAvailabilityResultInner object if successful. + */ + public CheckAvailabilityResultInner checkAvailability(CheckAvailabilityParameters parameters) { + return checkAvailabilityWithServiceResponseAsync(parameters).toBlocking().single().body(); + } + + /** + * Checks the availability of the given service namespace across all Azure subscriptions. This is useful because the domain name is created based on the service namespace name. + * + * @param parameters The namespace name. + * @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 checkAvailabilityAsync(CheckAvailabilityParameters parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(checkAvailabilityWithServiceResponseAsync(parameters), serviceCallback); + } + + /** + * Checks the availability of the given service namespace across all Azure subscriptions. This is useful because the domain name is created based on the service namespace name. + * + * @param parameters The namespace name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the CheckAvailabilityResultInner object + */ + public Observable checkAvailabilityAsync(CheckAvailabilityParameters parameters) { + return checkAvailabilityWithServiceResponseAsync(parameters).map(new Func1, CheckAvailabilityResultInner>() { + @Override + public CheckAvailabilityResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Checks the availability of the given service namespace across all Azure subscriptions. This is useful because the domain name is created based on the service namespace name. + * + * @param parameters The namespace name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the CheckAvailabilityResultInner object + */ + public Observable> checkAvailabilityWithServiceResponseAsync(CheckAvailabilityParameters parameters) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters 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(parameters); + return service.checkAvailability(this.client.subscriptionId(), parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = checkAvailabilityDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse checkAvailabilityDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Creates/Updates a service namespace. Once created, this namespace's resource manifest is immutable. This operation is idempotent. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param parameters Parameters supplied to create a Namespace Resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the NamespaceResourceInner object if successful. + */ + public NamespaceResourceInner createOrUpdate(String resourceGroupName, String namespaceName, NamespaceCreateOrUpdateParameters parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, namespaceName, parameters).toBlocking().single().body(); + } + + /** + * Creates/Updates a service namespace. Once created, this namespace's resource manifest is immutable. This operation is idempotent. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param parameters Parameters supplied to create a Namespace Resource. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String resourceGroupName, String namespaceName, NamespaceCreateOrUpdateParameters parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, namespaceName, parameters), serviceCallback); + } + + /** + * Creates/Updates a service namespace. Once created, this namespace's resource manifest is immutable. This operation is idempotent. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param parameters Parameters supplied to create a Namespace Resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the NamespaceResourceInner object + */ + public Observable createOrUpdateAsync(String resourceGroupName, String namespaceName, NamespaceCreateOrUpdateParameters parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, namespaceName, parameters).map(new Func1, NamespaceResourceInner>() { + @Override + public NamespaceResourceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates/Updates a service namespace. Once created, this namespace's resource manifest is immutable. This operation is idempotent. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param parameters Parameters supplied to create a Namespace Resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the NamespaceResourceInner object + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String namespaceName, NamespaceCreateOrUpdateParameters parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (namespaceName == null) { + throw new IllegalArgumentException("Parameter namespaceName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters 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(parameters); + return service.createOrUpdate(resourceGroupName, namespaceName, this.client.subscriptionId(), parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = createOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse createOrUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Patches the existing namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param parameters Parameters supplied to patch a Namespace Resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the NamespaceResourceInner object if successful. + */ + public NamespaceResourceInner patch(String resourceGroupName, String namespaceName, NamespacePatchParameters parameters) { + return patchWithServiceResponseAsync(resourceGroupName, namespaceName, parameters).toBlocking().single().body(); + } + + /** + * Patches the existing namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param parameters Parameters supplied to patch a Namespace Resource. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture patchAsync(String resourceGroupName, String namespaceName, NamespacePatchParameters parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(patchWithServiceResponseAsync(resourceGroupName, namespaceName, parameters), serviceCallback); + } + + /** + * Patches the existing namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param parameters Parameters supplied to patch a Namespace Resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the NamespaceResourceInner object + */ + public Observable patchAsync(String resourceGroupName, String namespaceName, NamespacePatchParameters parameters) { + return patchWithServiceResponseAsync(resourceGroupName, namespaceName, parameters).map(new Func1, NamespaceResourceInner>() { + @Override + public NamespaceResourceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Patches the existing namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param parameters Parameters supplied to patch a Namespace Resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the NamespaceResourceInner object + */ + public Observable> patchWithServiceResponseAsync(String resourceGroupName, String namespaceName, NamespacePatchParameters parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (namespaceName == null) { + throw new IllegalArgumentException("Parameter namespaceName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters 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(parameters); + return service.patch(resourceGroupName, namespaceName, this.client.subscriptionId(), parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = patchDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse patchDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Deletes an existing namespace. This operation also removes all associated notificationHubs under the namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException 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 namespaceName) { + deleteWithServiceResponseAsync(resourceGroupName, namespaceName).toBlocking().last().body(); + } + + /** + * Deletes an existing namespace. This operation also removes all associated notificationHubs under the namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @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 namespaceName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, namespaceName), serviceCallback); + } + + /** + * Deletes an existing namespace. This operation also removes all associated notificationHubs under the namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String namespaceName) { + return deleteWithServiceResponseAsync(resourceGroupName, namespaceName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes an existing namespace. This operation also removes all associated notificationHubs under the namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String namespaceName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (namespaceName == null) { + throw new IllegalArgumentException("Parameter namespaceName is required and cannot be null."); + } + 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."); + } + Observable> observable = service.delete(resourceGroupName, namespaceName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Deletes an existing namespace. This operation also removes all associated notificationHubs under the namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException 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 namespaceName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, namespaceName).toBlocking().single().body(); + } + + /** + * Deletes an existing namespace. This operation also removes all associated notificationHubs under the namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @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 namespaceName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, namespaceName), serviceCallback); + } + + /** + * Deletes an existing namespace. This operation also removes all associated notificationHubs under the namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String namespaceName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, namespaceName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes an existing namespace. This operation also removes all associated notificationHubs under the namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String namespaceName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (namespaceName == null) { + throw new IllegalArgumentException("Parameter namespaceName is required and cannot be null."); + } + 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.beginDelete(resourceGroupName, namespaceName, this.client.subscriptionId(), 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 CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Returns the description for the specified namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the NamespaceResourceInner object if successful. + */ + public NamespaceResourceInner getByResourceGroup(String resourceGroupName, String namespaceName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, namespaceName).toBlocking().single().body(); + } + + /** + * Returns the description for the specified namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @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 namespaceName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getByResourceGroupWithServiceResponseAsync(resourceGroupName, namespaceName), serviceCallback); + } + + /** + * Returns the description for the specified namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the NamespaceResourceInner object + */ + public Observable getByResourceGroupAsync(String resourceGroupName, String namespaceName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, namespaceName).map(new Func1, NamespaceResourceInner>() { + @Override + public NamespaceResourceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Returns the description for the specified namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the NamespaceResourceInner object + */ + public Observable> getByResourceGroupWithServiceResponseAsync(String resourceGroupName, String namespaceName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (namespaceName == null) { + throw new IllegalArgumentException("Parameter namespaceName is required and cannot be null."); + } + 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.getByResourceGroup(resourceGroupName, namespaceName, this.client.subscriptionId(), 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 CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Creates an authorization rule for a namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param authorizationRuleName Aauthorization Rule Name. + * @param properties Properties of the Namespace AuthorizationRules. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the SharedAccessAuthorizationRuleResourceInner object if successful. + */ + public SharedAccessAuthorizationRuleResourceInner createOrUpdateAuthorizationRule(String resourceGroupName, String namespaceName, String authorizationRuleName, SharedAccessAuthorizationRuleProperties properties) { + return createOrUpdateAuthorizationRuleWithServiceResponseAsync(resourceGroupName, namespaceName, authorizationRuleName, properties).toBlocking().single().body(); + } + + /** + * Creates an authorization rule for a namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param authorizationRuleName Aauthorization Rule Name. + * @param properties Properties of the Namespace AuthorizationRules. + * @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 createOrUpdateAuthorizationRuleAsync(String resourceGroupName, String namespaceName, String authorizationRuleName, SharedAccessAuthorizationRuleProperties properties, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateAuthorizationRuleWithServiceResponseAsync(resourceGroupName, namespaceName, authorizationRuleName, properties), serviceCallback); + } + + /** + * Creates an authorization rule for a namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param authorizationRuleName Aauthorization Rule Name. + * @param properties Properties of the Namespace AuthorizationRules. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SharedAccessAuthorizationRuleResourceInner object + */ + public Observable createOrUpdateAuthorizationRuleAsync(String resourceGroupName, String namespaceName, String authorizationRuleName, SharedAccessAuthorizationRuleProperties properties) { + return createOrUpdateAuthorizationRuleWithServiceResponseAsync(resourceGroupName, namespaceName, authorizationRuleName, properties).map(new Func1, SharedAccessAuthorizationRuleResourceInner>() { + @Override + public SharedAccessAuthorizationRuleResourceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates an authorization rule for a namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param authorizationRuleName Aauthorization Rule Name. + * @param properties Properties of the Namespace AuthorizationRules. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SharedAccessAuthorizationRuleResourceInner object + */ + public Observable> createOrUpdateAuthorizationRuleWithServiceResponseAsync(String resourceGroupName, String namespaceName, String authorizationRuleName, SharedAccessAuthorizationRuleProperties properties) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (namespaceName == null) { + throw new IllegalArgumentException("Parameter namespaceName is required and cannot be null."); + } + if (authorizationRuleName == null) { + throw new IllegalArgumentException("Parameter authorizationRuleName is required and cannot be null."); + } + 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 (properties == null) { + throw new IllegalArgumentException("Parameter properties is required and cannot be null."); + } + Validator.validate(properties); + SharedAccessAuthorizationRuleCreateOrUpdateParameters parameters = new SharedAccessAuthorizationRuleCreateOrUpdateParameters(); + parameters.withProperties(properties); + return service.createOrUpdateAuthorizationRule(resourceGroupName, namespaceName, authorizationRuleName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), parameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = createOrUpdateAuthorizationRuleDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse createOrUpdateAuthorizationRuleDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Deletes a namespace authorization rule. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param authorizationRuleName Authorization Rule Name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void deleteAuthorizationRule(String resourceGroupName, String namespaceName, String authorizationRuleName) { + deleteAuthorizationRuleWithServiceResponseAsync(resourceGroupName, namespaceName, authorizationRuleName).toBlocking().single().body(); + } + + /** + * Deletes a namespace authorization rule. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param authorizationRuleName Authorization Rule Name. + * @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 deleteAuthorizationRuleAsync(String resourceGroupName, String namespaceName, String authorizationRuleName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteAuthorizationRuleWithServiceResponseAsync(resourceGroupName, namespaceName, authorizationRuleName), serviceCallback); + } + + /** + * Deletes a namespace authorization rule. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param authorizationRuleName Authorization Rule Name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable deleteAuthorizationRuleAsync(String resourceGroupName, String namespaceName, String authorizationRuleName) { + return deleteAuthorizationRuleWithServiceResponseAsync(resourceGroupName, namespaceName, authorizationRuleName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes a namespace authorization rule. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param authorizationRuleName Authorization Rule Name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> deleteAuthorizationRuleWithServiceResponseAsync(String resourceGroupName, String namespaceName, String authorizationRuleName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (namespaceName == null) { + throw new IllegalArgumentException("Parameter namespaceName is required and cannot be null."); + } + if (authorizationRuleName == null) { + throw new IllegalArgumentException("Parameter authorizationRuleName is required and cannot be null."); + } + 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.deleteAuthorizationRule(resourceGroupName, namespaceName, authorizationRuleName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = deleteAuthorizationRuleDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse deleteAuthorizationRuleDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets an authorization rule for a namespace by name. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name + * @param authorizationRuleName Authorization rule name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the SharedAccessAuthorizationRuleResourceInner object if successful. + */ + public SharedAccessAuthorizationRuleResourceInner getAuthorizationRule(String resourceGroupName, String namespaceName, String authorizationRuleName) { + return getAuthorizationRuleWithServiceResponseAsync(resourceGroupName, namespaceName, authorizationRuleName).toBlocking().single().body(); + } + + /** + * Gets an authorization rule for a namespace by name. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name + * @param authorizationRuleName Authorization rule name. + * @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 getAuthorizationRuleAsync(String resourceGroupName, String namespaceName, String authorizationRuleName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getAuthorizationRuleWithServiceResponseAsync(resourceGroupName, namespaceName, authorizationRuleName), serviceCallback); + } + + /** + * Gets an authorization rule for a namespace by name. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name + * @param authorizationRuleName Authorization rule name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SharedAccessAuthorizationRuleResourceInner object + */ + public Observable getAuthorizationRuleAsync(String resourceGroupName, String namespaceName, String authorizationRuleName) { + return getAuthorizationRuleWithServiceResponseAsync(resourceGroupName, namespaceName, authorizationRuleName).map(new Func1, SharedAccessAuthorizationRuleResourceInner>() { + @Override + public SharedAccessAuthorizationRuleResourceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets an authorization rule for a namespace by name. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name + * @param authorizationRuleName Authorization rule name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SharedAccessAuthorizationRuleResourceInner object + */ + public Observable> getAuthorizationRuleWithServiceResponseAsync(String resourceGroupName, String namespaceName, String authorizationRuleName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (namespaceName == null) { + throw new IllegalArgumentException("Parameter namespaceName is required and cannot be null."); + } + if (authorizationRuleName == null) { + throw new IllegalArgumentException("Parameter authorizationRuleName is required and cannot be null."); + } + 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.getAuthorizationRule(resourceGroupName, namespaceName, authorizationRuleName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getAuthorizationRuleDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getAuthorizationRuleDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Lists the available namespaces within a resourceGroup. + * + * @param resourceGroupName The name of the resource group. If resourceGroupName value is null the method lists all the namespaces within subscription + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException 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<NamespaceResourceInner> 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(); + } + }; + } + + /** + * Lists the available namespaces within a resourceGroup. + * + * @param resourceGroupName The name of the resource group. If resourceGroupName value is null the method lists all the namespaces within 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> listByResourceGroupAsync(final String resourceGroupName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupSinglePageAsync(resourceGroupName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists the available namespaces within a resourceGroup. + * + * @param resourceGroupName The name of the resource group. If resourceGroupName value is null the method lists all the namespaces within subscription + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<NamespaceResourceInner> object + */ + public Observable> listByResourceGroupAsync(final String resourceGroupName) { + return listByResourceGroupWithServiceResponseAsync(resourceGroupName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists the available namespaces within a resourceGroup. + * + * @param resourceGroupName The name of the resource group. If resourceGroupName value is null the method lists all the namespaces within subscription + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<NamespaceResourceInner> 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)); + } + }); + } + + /** + * Lists the available namespaces within a resourceGroup. + * + ServiceResponse> * @param resourceGroupName The name of the resource group. If resourceGroupName value is null the method lists all the namespaces within subscription + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<NamespaceResourceInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupSinglePageAsync(final String resourceGroupName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + 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.listByResourceGroup(resourceGroupName, 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 = listByResourceGroupDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Lists all the available namespaces within the subscription irrespective of the resourceGroups. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException 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<NamespaceResourceInner> 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 the available namespaces within the subscription irrespective of the resourceGroups. + * + * @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 the available namespaces within the subscription irrespective of the resourceGroups. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<NamespaceResourceInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all the available namespaces within the subscription irrespective of the resourceGroups. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<NamespaceResourceInner> 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 the available namespaces within the subscription irrespective of the resourceGroups. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<NamespaceResourceInner> 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 CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets the authorization rules for a namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException 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<SharedAccessAuthorizationRuleResourceInner> object if successful. + */ + public PagedList listAuthorizationRules(final String resourceGroupName, final String namespaceName) { + ServiceResponse> response = listAuthorizationRulesSinglePageAsync(resourceGroupName, namespaceName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listAuthorizationRulesNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets the authorization rules for a namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name + * @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> listAuthorizationRulesAsync(final String resourceGroupName, final String namespaceName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listAuthorizationRulesSinglePageAsync(resourceGroupName, namespaceName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listAuthorizationRulesNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets the authorization rules for a namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<SharedAccessAuthorizationRuleResourceInner> object + */ + public Observable> listAuthorizationRulesAsync(final String resourceGroupName, final String namespaceName) { + return listAuthorizationRulesWithServiceResponseAsync(resourceGroupName, namespaceName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets the authorization rules for a namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<SharedAccessAuthorizationRuleResourceInner> object + */ + public Observable>> listAuthorizationRulesWithServiceResponseAsync(final String resourceGroupName, final String namespaceName) { + return listAuthorizationRulesSinglePageAsync(resourceGroupName, namespaceName) + .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(listAuthorizationRulesNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets the authorization rules for a namespace. + * + ServiceResponse> * @param resourceGroupName The name of the resource group. + ServiceResponse> * @param namespaceName The namespace name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<SharedAccessAuthorizationRuleResourceInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listAuthorizationRulesSinglePageAsync(final String resourceGroupName, final String namespaceName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (namespaceName == null) { + throw new IllegalArgumentException("Parameter namespaceName is required and cannot be null."); + } + 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.listAuthorizationRules(resourceGroupName, namespaceName, 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 = listAuthorizationRulesDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listAuthorizationRulesDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets the Primary and Secondary ConnectionStrings to the namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param authorizationRuleName The connection string of the namespace for the specified authorizationRule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the SharedAccessAuthorizationRuleListResultInner object if successful. + */ + public SharedAccessAuthorizationRuleListResultInner listKeys(String resourceGroupName, String namespaceName, String authorizationRuleName) { + return listKeysWithServiceResponseAsync(resourceGroupName, namespaceName, authorizationRuleName).toBlocking().single().body(); + } + + /** + * Gets the Primary and Secondary ConnectionStrings to the namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param authorizationRuleName The connection string of the namespace for the specified authorizationRule. + * @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 listKeysAsync(String resourceGroupName, String namespaceName, String authorizationRuleName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(listKeysWithServiceResponseAsync(resourceGroupName, namespaceName, authorizationRuleName), serviceCallback); + } + + /** + * Gets the Primary and Secondary ConnectionStrings to the namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param authorizationRuleName The connection string of the namespace for the specified authorizationRule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SharedAccessAuthorizationRuleListResultInner object + */ + public Observable listKeysAsync(String resourceGroupName, String namespaceName, String authorizationRuleName) { + return listKeysWithServiceResponseAsync(resourceGroupName, namespaceName, authorizationRuleName).map(new Func1, SharedAccessAuthorizationRuleListResultInner>() { + @Override + public SharedAccessAuthorizationRuleListResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the Primary and Secondary ConnectionStrings to the namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param authorizationRuleName The connection string of the namespace for the specified authorizationRule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SharedAccessAuthorizationRuleListResultInner object + */ + public Observable> listKeysWithServiceResponseAsync(String resourceGroupName, String namespaceName, String authorizationRuleName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (namespaceName == null) { + throw new IllegalArgumentException("Parameter namespaceName is required and cannot be null."); + } + if (authorizationRuleName == null) { + throw new IllegalArgumentException("Parameter authorizationRuleName is required and cannot be null."); + } + 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.listKeys(resourceGroupName, namespaceName, authorizationRuleName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = listKeysDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse listKeysDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Regenerates the Primary/Secondary Keys to the Namespace Authorization Rule. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param authorizationRuleName The connection string of the namespace for the specified authorizationRule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ResourceListKeysInner object if successful. + */ + public ResourceListKeysInner regenerateKeys(String resourceGroupName, String namespaceName, String authorizationRuleName) { + return regenerateKeysWithServiceResponseAsync(resourceGroupName, namespaceName, authorizationRuleName).toBlocking().single().body(); + } + + /** + * Regenerates the Primary/Secondary Keys to the Namespace Authorization Rule. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param authorizationRuleName The connection string of the namespace for the specified authorizationRule. + * @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 regenerateKeysAsync(String resourceGroupName, String namespaceName, String authorizationRuleName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(regenerateKeysWithServiceResponseAsync(resourceGroupName, namespaceName, authorizationRuleName), serviceCallback); + } + + /** + * Regenerates the Primary/Secondary Keys to the Namespace Authorization Rule. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param authorizationRuleName The connection string of the namespace for the specified authorizationRule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ResourceListKeysInner object + */ + public Observable regenerateKeysAsync(String resourceGroupName, String namespaceName, String authorizationRuleName) { + return regenerateKeysWithServiceResponseAsync(resourceGroupName, namespaceName, authorizationRuleName).map(new Func1, ResourceListKeysInner>() { + @Override + public ResourceListKeysInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Regenerates the Primary/Secondary Keys to the Namespace Authorization Rule. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param authorizationRuleName The connection string of the namespace for the specified authorizationRule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ResourceListKeysInner object + */ + public Observable> regenerateKeysWithServiceResponseAsync(String resourceGroupName, String namespaceName, String authorizationRuleName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (namespaceName == null) { + throw new IllegalArgumentException("Parameter namespaceName is required and cannot be null."); + } + if (authorizationRuleName == null) { + throw new IllegalArgumentException("Parameter authorizationRuleName is required and cannot be null."); + } + 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."); + } + final String policyKey = null; + PolicykeyResource parameters = new PolicykeyResource(); + parameters.withPolicyKey(null); + return service.regenerateKeys(resourceGroupName, namespaceName, authorizationRuleName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), parameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = regenerateKeysDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Regenerates the Primary/Secondary Keys to the Namespace Authorization Rule. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param authorizationRuleName The connection string of the namespace for the specified authorizationRule. + * @param policyKey Name of the key that has to be regenerated for the Namespace/Notification Hub Authorization Rule. The value can be Primary Key/Secondary Key. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ResourceListKeysInner object if successful. + */ + public ResourceListKeysInner regenerateKeys(String resourceGroupName, String namespaceName, String authorizationRuleName, String policyKey) { + return regenerateKeysWithServiceResponseAsync(resourceGroupName, namespaceName, authorizationRuleName, policyKey).toBlocking().single().body(); + } + + /** + * Regenerates the Primary/Secondary Keys to the Namespace Authorization Rule. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param authorizationRuleName The connection string of the namespace for the specified authorizationRule. + * @param policyKey Name of the key that has to be regenerated for the Namespace/Notification Hub Authorization Rule. The value can be Primary Key/Secondary Key. + * @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 regenerateKeysAsync(String resourceGroupName, String namespaceName, String authorizationRuleName, String policyKey, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(regenerateKeysWithServiceResponseAsync(resourceGroupName, namespaceName, authorizationRuleName, policyKey), serviceCallback); + } + + /** + * Regenerates the Primary/Secondary Keys to the Namespace Authorization Rule. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param authorizationRuleName The connection string of the namespace for the specified authorizationRule. + * @param policyKey Name of the key that has to be regenerated for the Namespace/Notification Hub Authorization Rule. The value can be Primary Key/Secondary Key. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ResourceListKeysInner object + */ + public Observable regenerateKeysAsync(String resourceGroupName, String namespaceName, String authorizationRuleName, String policyKey) { + return regenerateKeysWithServiceResponseAsync(resourceGroupName, namespaceName, authorizationRuleName, policyKey).map(new Func1, ResourceListKeysInner>() { + @Override + public ResourceListKeysInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Regenerates the Primary/Secondary Keys to the Namespace Authorization Rule. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param authorizationRuleName The connection string of the namespace for the specified authorizationRule. + * @param policyKey Name of the key that has to be regenerated for the Namespace/Notification Hub Authorization Rule. The value can be Primary Key/Secondary Key. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ResourceListKeysInner object + */ + public Observable> regenerateKeysWithServiceResponseAsync(String resourceGroupName, String namespaceName, String authorizationRuleName, String policyKey) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (namespaceName == null) { + throw new IllegalArgumentException("Parameter namespaceName is required and cannot be null."); + } + if (authorizationRuleName == null) { + throw new IllegalArgumentException("Parameter authorizationRuleName is required and cannot be null."); + } + 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."); + } + PolicykeyResource parameters = new PolicykeyResource(); + parameters.withPolicyKey(policyKey); + return service.regenerateKeys(resourceGroupName, namespaceName, authorizationRuleName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), parameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = regenerateKeysDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse regenerateKeysDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Lists the available namespaces within a resourceGroup. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException 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<NamespaceResourceInner> 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(); + } + }; + } + + /** + * Lists the available namespaces within a resourceGroup. + * + * @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); + } + + /** + * Lists the available namespaces within a resourceGroup. + * + * @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<NamespaceResourceInner> object + */ + public Observable> listByResourceGroupNextAsync(final String nextPageLink) { + return listByResourceGroupNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists the available namespaces within a resourceGroup. + * + * @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<NamespaceResourceInner> 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)); + } + }); + } + + /** + * Lists the available namespaces within a resourceGroup. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<NamespaceResourceInner> 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 CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Lists all the available namespaces within the subscription irrespective of the resourceGroups. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException 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<NamespaceResourceInner> 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 the available namespaces within the subscription irrespective of the resourceGroups. + * + * @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 the available namespaces within the subscription irrespective of the resourceGroups. + * + * @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<NamespaceResourceInner> 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 the available namespaces within the subscription irrespective of the resourceGroups. + * + * @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<NamespaceResourceInner> 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 the available namespaces within the subscription irrespective of the resourceGroups. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<NamespaceResourceInner> 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 CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets the authorization rules for a namespace. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException 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<SharedAccessAuthorizationRuleResourceInner> object if successful. + */ + public PagedList listAuthorizationRulesNext(final String nextPageLink) { + ServiceResponse> response = listAuthorizationRulesNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listAuthorizationRulesNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets the authorization rules for a namespace. + * + * @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> listAuthorizationRulesNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listAuthorizationRulesNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listAuthorizationRulesNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets the authorization rules for a namespace. + * + * @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<SharedAccessAuthorizationRuleResourceInner> object + */ + public Observable> listAuthorizationRulesNextAsync(final String nextPageLink) { + return listAuthorizationRulesNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets the authorization rules for a namespace. + * + * @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<SharedAccessAuthorizationRuleResourceInner> object + */ + public Observable>> listAuthorizationRulesNextWithServiceResponseAsync(final String nextPageLink) { + return listAuthorizationRulesNextSinglePageAsync(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(listAuthorizationRulesNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets the authorization rules for a namespace. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<SharedAccessAuthorizationRuleResourceInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listAuthorizationRulesNextSinglePageAsync(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.listAuthorizationRulesNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listAuthorizationRulesNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listAuthorizationRulesNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/implementation/NotificationHubNamespaceSharedAccessAuthorizationRuleResourceImpl.java b/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/implementation/NotificationHubNamespaceSharedAccessAuthorizationRuleResourceImpl.java new file mode 100644 index 000000000000..e72860347a04 --- /dev/null +++ b/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/implementation/NotificationHubNamespaceSharedAccessAuthorizationRuleResourceImpl.java @@ -0,0 +1,197 @@ +/** + * 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.notificationhubs.v2017_04_01.implementation; + +import com.microsoft.azure.management.notificationhubs.v2017_04_01.NotificationHubNamespaceSharedAccessAuthorizationRuleResource; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import com.microsoft.azure.management.notificationhubs.v2017_04_01.SharedAccessAuthorizationRuleProperties; +import java.util.List; +import com.microsoft.azure.management.notificationhubs.v2017_04_01.AccessRights; +import com.microsoft.azure.management.notificationhubs.v2017_04_01.Sku; +import java.util.Map; +import rx.functions.Func1; + +class NotificationHubNamespaceSharedAccessAuthorizationRuleResourceImpl extends CreatableUpdatableImpl implements NotificationHubNamespaceSharedAccessAuthorizationRuleResource, NotificationHubNamespaceSharedAccessAuthorizationRuleResource.Definition, NotificationHubNamespaceSharedAccessAuthorizationRuleResource.Update { + private final NotificationHubsManager manager; + private String resourceGroupName; + private String namespaceName; + private String notificationHubName; + private String authorizationRuleName; + private SharedAccessAuthorizationRuleProperties cproperties; + private SharedAccessAuthorizationRuleProperties uproperties; + + NotificationHubNamespaceSharedAccessAuthorizationRuleResourceImpl(String name, NotificationHubsManager manager) { + super(name, new SharedAccessAuthorizationRuleResourceInner()); + this.manager = manager; + // Set resource name + this.authorizationRuleName = name; + // + this.cproperties = new SharedAccessAuthorizationRuleProperties(); + this.uproperties = new SharedAccessAuthorizationRuleProperties(); + } + + NotificationHubNamespaceSharedAccessAuthorizationRuleResourceImpl(SharedAccessAuthorizationRuleResourceInner inner, NotificationHubsManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.authorizationRuleName = inner.name(); + // resource ancestor names + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.namespaceName = IdParsingUtils.getValueFromIdByName(inner.id(), "namespaces"); + this.notificationHubName = IdParsingUtils.getValueFromIdByName(inner.id(), "notificationHubs"); + this.authorizationRuleName = IdParsingUtils.getValueFromIdByName(inner.id(), "AuthorizationRules"); + // + this.cproperties = new SharedAccessAuthorizationRuleProperties(); + this.uproperties = new SharedAccessAuthorizationRuleProperties(); + } + + @Override + public NotificationHubsManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + NotificationHubsInner client = this.manager().inner().notificationHubs(); + return client.createOrUpdateAuthorizationRuleAsync(this.resourceGroupName, this.namespaceName, this.notificationHubName, this.authorizationRuleName, this.cproperties) + .map(new Func1() { + @Override + public SharedAccessAuthorizationRuleResourceInner call(SharedAccessAuthorizationRuleResourceInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + NotificationHubsInner client = this.manager().inner().notificationHubs(); + return client.createOrUpdateAuthorizationRuleAsync(this.resourceGroupName, this.namespaceName, this.notificationHubName, this.authorizationRuleName, this.uproperties) + .map(new Func1() { + @Override + public SharedAccessAuthorizationRuleResourceInner call(SharedAccessAuthorizationRuleResourceInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + NotificationHubsInner client = this.manager().inner().notificationHubs(); + return client.getAuthorizationRuleAsync(this.resourceGroupName, this.namespaceName, this.notificationHubName, this.authorizationRuleName); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + private void resetCreateUpdateParameters() { + this.cproperties = new SharedAccessAuthorizationRuleProperties(); + this.uproperties = new SharedAccessAuthorizationRuleProperties(); + } + + @Override + public String claimType() { + return this.inner().claimType(); + } + + @Override + public String claimValue() { + return this.inner().claimValue(); + } + + @Override + public String createdTime() { + return this.inner().createdTime(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String keyName() { + return this.inner().keyName(); + } + + @Override + public String location() { + return this.inner().location(); + } + + @Override + public String modifiedTime() { + return this.inner().modifiedTime(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public String primaryKey() { + return this.inner().primaryKey(); + } + + @Override + public Integer revision() { + return this.inner().revision(); + } + + @Override + public List rights() { + return this.inner().rights(); + } + + @Override + public String secondaryKey() { + return this.inner().secondaryKey(); + } + + @Override + public Sku sku() { + return this.inner().sku(); + } + + @Override + public Map tags() { + return this.inner().getTags(); + } + + @Override + public String type() { + return this.inner().type(); + } + + @Override + public NotificationHubNamespaceSharedAccessAuthorizationRuleResourceImpl withExistingNotificationHub(String resourceGroupName, String namespaceName, String notificationHubName) { + this.resourceGroupName = resourceGroupName; + this.namespaceName = namespaceName; + this.notificationHubName = notificationHubName; + return this; + } + + @Override + public NotificationHubNamespaceSharedAccessAuthorizationRuleResourceImpl withProperties(SharedAccessAuthorizationRuleProperties properties) { + if (isInCreateMode()) { + this.cproperties = properties; + } else { + this.uproperties = properties; + } + return this; + } + +} diff --git a/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/implementation/NotificationHubResourceImpl.java b/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/implementation/NotificationHubResourceImpl.java new file mode 100644 index 000000000000..e799705869e7 --- /dev/null +++ b/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/implementation/NotificationHubResourceImpl.java @@ -0,0 +1,313 @@ +/** + * 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.notificationhubs.v2017_04_01.implementation; + +import com.microsoft.azure.management.notificationhubs.v2017_04_01.NotificationHubResource; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import com.microsoft.azure.management.notificationhubs.v2017_04_01.NotificationHubPatchParameters; +import java.util.Map; +import java.util.List; +import com.microsoft.azure.management.notificationhubs.v2017_04_01.NotificationHubCreateOrUpdateParameters; +import com.microsoft.azure.management.notificationhubs.v2017_04_01.AdmCredential; +import com.microsoft.azure.management.notificationhubs.v2017_04_01.ApnsCredential; +import com.microsoft.azure.management.notificationhubs.v2017_04_01.SharedAccessAuthorizationRuleProperties; +import com.microsoft.azure.management.notificationhubs.v2017_04_01.BaiduCredential; +import com.microsoft.azure.management.notificationhubs.v2017_04_01.GcmCredential; +import com.microsoft.azure.management.notificationhubs.v2017_04_01.MpnsCredential; +import com.microsoft.azure.management.notificationhubs.v2017_04_01.WnsCredential; +import com.microsoft.azure.management.notificationhubs.v2017_04_01.Sku; +import rx.functions.Func1; + +class NotificationHubResourceImpl extends CreatableUpdatableImpl implements NotificationHubResource, NotificationHubResource.Definition, NotificationHubResource.Update { + private final NotificationHubsManager manager; + private String resourceGroupName; + private String namespaceName; + private String notificationHubName; + private NotificationHubCreateOrUpdateParameters createParameter; + private NotificationHubPatchParameters updateParameter; + + NotificationHubResourceImpl(String name, NotificationHubsManager manager) { + super(name, new NotificationHubResourceInner()); + this.manager = manager; + // Set resource name + this.notificationHubName = name; + // + this.createParameter = new NotificationHubCreateOrUpdateParameters(); + this.updateParameter = new NotificationHubPatchParameters(); + } + + NotificationHubResourceImpl(NotificationHubResourceInner inner, NotificationHubsManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.notificationHubName = inner.name(); + // resource ancestor names + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.namespaceName = IdParsingUtils.getValueFromIdByName(inner.id(), "namespaces"); + this.notificationHubName = IdParsingUtils.getValueFromIdByName(inner.id(), "notificationHubs"); + // + this.createParameter = new NotificationHubCreateOrUpdateParameters(); + this.updateParameter = new NotificationHubPatchParameters(); + } + + @Override + public NotificationHubsManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + NotificationHubsInner client = this.manager().inner().notificationHubs(); + return client.createOrUpdateAsync(this.resourceGroupName, this.namespaceName, this.notificationHubName, this.createParameter) + .map(new Func1() { + @Override + public NotificationHubResourceInner call(NotificationHubResourceInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + NotificationHubsInner client = this.manager().inner().notificationHubs(); + return client.patchAsync(this.resourceGroupName, this.namespaceName, this.notificationHubName, this.updateParameter) + .map(new Func1() { + @Override + public NotificationHubResourceInner call(NotificationHubResourceInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + NotificationHubsInner client = this.manager().inner().notificationHubs(); + return client.getAsync(this.resourceGroupName, this.namespaceName, this.notificationHubName); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + private void resetCreateUpdateParameters() { + this.createParameter = new NotificationHubCreateOrUpdateParameters(); + this.updateParameter = new NotificationHubPatchParameters(); + } + + @Override + public AdmCredential admCredential() { + return this.inner().admCredential(); + } + + @Override + public ApnsCredential apnsCredential() { + return this.inner().apnsCredential(); + } + + @Override + public List authorizationRules() { + return this.inner().authorizationRules(); + } + + @Override + public BaiduCredential baiduCredential() { + return this.inner().baiduCredential(); + } + + @Override + public GcmCredential gcmCredential() { + return this.inner().gcmCredential(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String location() { + return this.inner().location(); + } + + @Override + public MpnsCredential mpnsCredential() { + return this.inner().mpnsCredential(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public String notificationHubResourceName() { + return this.inner().notificationHubResourceName(); + } + + @Override + public String registrationTtl() { + return this.inner().registrationTtl(); + } + + @Override + public Sku sku() { + return this.inner().sku(); + } + + @Override + public Map tags() { + return this.inner().getTags(); + } + + @Override + public String type() { + return this.inner().type(); + } + + @Override + public WnsCredential wnsCredential() { + return this.inner().wnsCredential(); + } + + @Override + public NotificationHubResourceImpl withExistingNamespace(String resourceGroupName, String namespaceName) { + this.resourceGroupName = resourceGroupName; + this.namespaceName = namespaceName; + return this; + } + + @Override + public NotificationHubResourceImpl withNotificationHubCreateOrUpdateParametersName(String notificationHubCreateOrUpdateParametersName) { + this.createParameter.withNotificationHubCreateOrUpdateParametersName(notificationHubCreateOrUpdateParametersName); + return this; + } + + @Override + public NotificationHubResourceImpl withNotificationHubPatchParametersName(String notificationHubPatchParametersName) { + this.updateParameter.withNotificationHubPatchParametersName(notificationHubPatchParametersName); + return this; + } + + @Override + public NotificationHubResourceImpl withAdmCredential(AdmCredential admCredential) { + if (isInCreateMode()) { + this.createParameter.withAdmCredential(admCredential); + } else { + this.updateParameter.withAdmCredential(admCredential); + } + return this; + } + + @Override + public NotificationHubResourceImpl withApnsCredential(ApnsCredential apnsCredential) { + if (isInCreateMode()) { + this.createParameter.withApnsCredential(apnsCredential); + } else { + this.updateParameter.withApnsCredential(apnsCredential); + } + return this; + } + + @Override + public NotificationHubResourceImpl withAuthorizationRules(List authorizationRules) { + if (isInCreateMode()) { + this.createParameter.withAuthorizationRules(authorizationRules); + } else { + this.updateParameter.withAuthorizationRules(authorizationRules); + } + return this; + } + + @Override + public NotificationHubResourceImpl withBaiduCredential(BaiduCredential baiduCredential) { + if (isInCreateMode()) { + this.createParameter.withBaiduCredential(baiduCredential); + } else { + this.updateParameter.withBaiduCredential(baiduCredential); + } + return this; + } + + @Override + public NotificationHubResourceImpl withGcmCredential(GcmCredential gcmCredential) { + if (isInCreateMode()) { + this.createParameter.withGcmCredential(gcmCredential); + } else { + this.updateParameter.withGcmCredential(gcmCredential); + } + return this; + } + + @Override + public NotificationHubResourceImpl withLocation(String location) { + if (isInCreateMode()) { + this.createParameter.withLocation(location); + } else { + this.updateParameter.withLocation(location); + } + return this; + } + + @Override + public NotificationHubResourceImpl withMpnsCredential(MpnsCredential mpnsCredential) { + if (isInCreateMode()) { + this.createParameter.withMpnsCredential(mpnsCredential); + } else { + this.updateParameter.withMpnsCredential(mpnsCredential); + } + return this; + } + + @Override + public NotificationHubResourceImpl withRegistrationTtl(String registrationTtl) { + if (isInCreateMode()) { + this.createParameter.withRegistrationTtl(registrationTtl); + } else { + this.updateParameter.withRegistrationTtl(registrationTtl); + } + return this; + } + + @Override + public NotificationHubResourceImpl withSku(Sku sku) { + if (isInCreateMode()) { + this.createParameter.withSku(sku); + } else { + this.updateParameter.withSku(sku); + } + return this; + } + + @Override + public NotificationHubResourceImpl withTags(Map tags) { + if (isInCreateMode()) { + this.createParameter.withTags(tags); + } else { + this.updateParameter.withTags(tags); + } + return this; + } + + @Override + public NotificationHubResourceImpl withWnsCredential(WnsCredential wnsCredential) { + if (isInCreateMode()) { + this.createParameter.withWnsCredential(wnsCredential); + } else { + this.updateParameter.withWnsCredential(wnsCredential); + } + return this; + } + +} diff --git a/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/implementation/NotificationHubResourceInner.java b/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/implementation/NotificationHubResourceInner.java new file mode 100644 index 000000000000..13ca3a15d956 --- /dev/null +++ b/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/implementation/NotificationHubResourceInner.java @@ -0,0 +1,291 @@ +/** + * 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.notificationhubs.v2017_04_01.implementation; + +import java.util.List; +import com.microsoft.azure.management.notificationhubs.v2017_04_01.SharedAccessAuthorizationRuleProperties; +import com.microsoft.azure.management.notificationhubs.v2017_04_01.ApnsCredential; +import com.microsoft.azure.management.notificationhubs.v2017_04_01.WnsCredential; +import com.microsoft.azure.management.notificationhubs.v2017_04_01.GcmCredential; +import com.microsoft.azure.management.notificationhubs.v2017_04_01.MpnsCredential; +import com.microsoft.azure.management.notificationhubs.v2017_04_01.AdmCredential; +import com.microsoft.azure.management.notificationhubs.v2017_04_01.BaiduCredential; +import com.microsoft.azure.management.notificationhubs.v2017_04_01.Sku; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.rest.SkipParentValidation; +import com.microsoft.azure.Resource; + +/** + * Description of a NotificationHub Resource. + */ +@JsonFlatten +@SkipParentValidation +public class NotificationHubResourceInner extends Resource { + /** + * The NotificationHub name. + */ + @JsonProperty(value = "properties.name") + private String notificationHubResourceName; + + /** + * The RegistrationTtl of the created NotificationHub. + */ + @JsonProperty(value = "properties.registrationTtl") + private String registrationTtl; + + /** + * The AuthorizationRules of the created NotificationHub. + */ + @JsonProperty(value = "properties.authorizationRules") + private List authorizationRules; + + /** + * The ApnsCredential of the created NotificationHub. + */ + @JsonProperty(value = "properties.apnsCredential") + private ApnsCredential apnsCredential; + + /** + * The WnsCredential of the created NotificationHub. + */ + @JsonProperty(value = "properties.wnsCredential") + private WnsCredential wnsCredential; + + /** + * The GcmCredential of the created NotificationHub. + */ + @JsonProperty(value = "properties.gcmCredential") + private GcmCredential gcmCredential; + + /** + * The MpnsCredential of the created NotificationHub. + */ + @JsonProperty(value = "properties.mpnsCredential") + private MpnsCredential mpnsCredential; + + /** + * The AdmCredential of the created NotificationHub. + */ + @JsonProperty(value = "properties.admCredential") + private AdmCredential admCredential; + + /** + * The BaiduCredential of the created NotificationHub. + */ + @JsonProperty(value = "properties.baiduCredential") + private BaiduCredential baiduCredential; + + /** + * The sku of the created namespace. + */ + @JsonProperty(value = "sku") + private Sku sku; + + /** + * Get the NotificationHub name. + * + * @return the notificationHubResourceName value + */ + public String notificationHubResourceName() { + return this.notificationHubResourceName; + } + + /** + * Set the NotificationHub name. + * + * @param notificationHubResourceName the notificationHubResourceName value to set + * @return the NotificationHubResourceInner object itself. + */ + public NotificationHubResourceInner withNotificationHubResourceName(String notificationHubResourceName) { + this.notificationHubResourceName = notificationHubResourceName; + return this; + } + + /** + * Get the RegistrationTtl of the created NotificationHub. + * + * @return the registrationTtl value + */ + public String registrationTtl() { + return this.registrationTtl; + } + + /** + * Set the RegistrationTtl of the created NotificationHub. + * + * @param registrationTtl the registrationTtl value to set + * @return the NotificationHubResourceInner object itself. + */ + public NotificationHubResourceInner withRegistrationTtl(String registrationTtl) { + this.registrationTtl = registrationTtl; + return this; + } + + /** + * Get the AuthorizationRules of the created NotificationHub. + * + * @return the authorizationRules value + */ + public List authorizationRules() { + return this.authorizationRules; + } + + /** + * Set the AuthorizationRules of the created NotificationHub. + * + * @param authorizationRules the authorizationRules value to set + * @return the NotificationHubResourceInner object itself. + */ + public NotificationHubResourceInner withAuthorizationRules(List authorizationRules) { + this.authorizationRules = authorizationRules; + return this; + } + + /** + * Get the ApnsCredential of the created NotificationHub. + * + * @return the apnsCredential value + */ + public ApnsCredential apnsCredential() { + return this.apnsCredential; + } + + /** + * Set the ApnsCredential of the created NotificationHub. + * + * @param apnsCredential the apnsCredential value to set + * @return the NotificationHubResourceInner object itself. + */ + public NotificationHubResourceInner withApnsCredential(ApnsCredential apnsCredential) { + this.apnsCredential = apnsCredential; + return this; + } + + /** + * Get the WnsCredential of the created NotificationHub. + * + * @return the wnsCredential value + */ + public WnsCredential wnsCredential() { + return this.wnsCredential; + } + + /** + * Set the WnsCredential of the created NotificationHub. + * + * @param wnsCredential the wnsCredential value to set + * @return the NotificationHubResourceInner object itself. + */ + public NotificationHubResourceInner withWnsCredential(WnsCredential wnsCredential) { + this.wnsCredential = wnsCredential; + return this; + } + + /** + * Get the GcmCredential of the created NotificationHub. + * + * @return the gcmCredential value + */ + public GcmCredential gcmCredential() { + return this.gcmCredential; + } + + /** + * Set the GcmCredential of the created NotificationHub. + * + * @param gcmCredential the gcmCredential value to set + * @return the NotificationHubResourceInner object itself. + */ + public NotificationHubResourceInner withGcmCredential(GcmCredential gcmCredential) { + this.gcmCredential = gcmCredential; + return this; + } + + /** + * Get the MpnsCredential of the created NotificationHub. + * + * @return the mpnsCredential value + */ + public MpnsCredential mpnsCredential() { + return this.mpnsCredential; + } + + /** + * Set the MpnsCredential of the created NotificationHub. + * + * @param mpnsCredential the mpnsCredential value to set + * @return the NotificationHubResourceInner object itself. + */ + public NotificationHubResourceInner withMpnsCredential(MpnsCredential mpnsCredential) { + this.mpnsCredential = mpnsCredential; + return this; + } + + /** + * Get the AdmCredential of the created NotificationHub. + * + * @return the admCredential value + */ + public AdmCredential admCredential() { + return this.admCredential; + } + + /** + * Set the AdmCredential of the created NotificationHub. + * + * @param admCredential the admCredential value to set + * @return the NotificationHubResourceInner object itself. + */ + public NotificationHubResourceInner withAdmCredential(AdmCredential admCredential) { + this.admCredential = admCredential; + return this; + } + + /** + * Get the BaiduCredential of the created NotificationHub. + * + * @return the baiduCredential value + */ + public BaiduCredential baiduCredential() { + return this.baiduCredential; + } + + /** + * Set the BaiduCredential of the created NotificationHub. + * + * @param baiduCredential the baiduCredential value to set + * @return the NotificationHubResourceInner object itself. + */ + public NotificationHubResourceInner withBaiduCredential(BaiduCredential baiduCredential) { + this.baiduCredential = baiduCredential; + return this; + } + + /** + * Get the sku of the created namespace. + * + * @return the sku value + */ + public Sku sku() { + return this.sku; + } + + /** + * Set the sku of the created namespace. + * + * @param sku the sku value to set + * @return the NotificationHubResourceInner object itself. + */ + public NotificationHubResourceInner withSku(Sku sku) { + this.sku = sku; + return this; + } + +} diff --git a/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/implementation/NotificationHubsImpl.java b/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/implementation/NotificationHubsImpl.java new file mode 100644 index 000000000000..f288f15a3855 --- /dev/null +++ b/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/implementation/NotificationHubsImpl.java @@ -0,0 +1,205 @@ +/** + * 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.notificationhubs.v2017_04_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.notificationhubs.v2017_04_01.NotificationHubs; +import rx.Completable; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.notificationhubs.v2017_04_01.DebugSendResponse; +import com.microsoft.azure.management.notificationhubs.v2017_04_01.PnsCredentialsResource; +import com.microsoft.azure.management.notificationhubs.v2017_04_01.NotificationHubResource; +import com.microsoft.azure.management.notificationhubs.v2017_04_01.CheckAvailabilityResult; +import com.microsoft.azure.management.notificationhubs.v2017_04_01.CheckAvailabilityParameters; +import com.microsoft.azure.management.notificationhubs.v2017_04_01.NotificationHubNamespaceSharedAccessAuthorizationRuleResource; +import com.microsoft.azure.management.notificationhubs.v2017_04_01.ResourceListKeys; + +class NotificationHubsImpl extends WrapperImpl implements NotificationHubs { + private final NotificationHubsManager manager; + + NotificationHubsImpl(NotificationHubsManager manager) { + super(manager.inner().notificationHubs()); + this.manager = manager; + } + + public NotificationHubsManager manager() { + return this.manager; + } + + @Override + public NotificationHubResourceImpl define(String name) { + return wrapModel(name); + } + + private NotificationHubResourceImpl wrapModel(NotificationHubResourceInner inner) { + return new NotificationHubResourceImpl(inner, manager()); + } + + private NotificationHubResourceImpl wrapModel(String name) { + return new NotificationHubResourceImpl(name, this.manager()); + } + + @Override + public Observable debugSendAsync(String resourceGroupName, String namespaceName, String notificationHubName) { + NotificationHubsInner client = this.inner(); + return client.debugSendAsync(resourceGroupName, namespaceName, notificationHubName) + .map(new Func1() { + @Override + public DebugSendResponse call(DebugSendResponseInner inner) { + return new DebugSendResponseImpl(inner, manager()); + } + }); + } + + @Override + public Observable getPnsCredentialsAsync(String resourceGroupName, String namespaceName, String notificationHubName) { + NotificationHubsInner client = this.inner(); + return client.getPnsCredentialsAsync(resourceGroupName, namespaceName, notificationHubName) + .map(new Func1() { + @Override + public PnsCredentialsResource call(PnsCredentialsResourceInner inner) { + return new PnsCredentialsResourceImpl(inner, manager()); + } + }); + } + + @Override + public Observable listAsync(final String resourceGroupName, final String namespaceName) { + NotificationHubsInner client = this.inner(); + return client.listAsync(resourceGroupName, namespaceName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public NotificationHubResource call(NotificationHubResourceInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Observable getAsync(String resourceGroupName, String namespaceName, String notificationHubName) { + NotificationHubsInner client = this.inner(); + return client.getAsync(resourceGroupName, namespaceName, notificationHubName) + .map(new Func1() { + @Override + public NotificationHubResource call(NotificationHubResourceInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Completable deleteAsync(String resourceGroupName, String namespaceName, String notificationHubName) { + NotificationHubsInner client = this.inner(); + return client.deleteAsync(resourceGroupName, namespaceName, notificationHubName).toCompletable(); + } + + @Override + public NotificationHubNamespaceSharedAccessAuthorizationRuleResourceImpl defineAuthorizationRule(String name) { + return wrapAuthorizationRuleModel(name); + } + + private NotificationHubNamespaceSharedAccessAuthorizationRuleResourceImpl wrapAuthorizationRuleModel(String name) { + return new NotificationHubNamespaceSharedAccessAuthorizationRuleResourceImpl(name, this.manager()); + } + + private NotificationHubNamespaceSharedAccessAuthorizationRuleResourceImpl wrapNotificationHubNamespaceSharedAccessAuthorizationRuleResourceModel(SharedAccessAuthorizationRuleResourceInner inner) { + return new NotificationHubNamespaceSharedAccessAuthorizationRuleResourceImpl(inner, manager()); + } + + private Observable getSharedAccessAuthorizationRuleResourceInnerUsingNotificationHubsInnerAsync(String id) { + String resourceGroupName = IdParsingUtils.getValueFromIdByName(id, "resourceGroups"); + String namespaceName = IdParsingUtils.getValueFromIdByName(id, "namespaces"); + String notificationHubName = IdParsingUtils.getValueFromIdByName(id, "notificationHubs"); + String authorizationRuleName = IdParsingUtils.getValueFromIdByName(id, "AuthorizationRules"); + NotificationHubsInner client = this.inner(); + return client.getAuthorizationRuleAsync(resourceGroupName, namespaceName, notificationHubName, authorizationRuleName); + } + + @Override + public Observable checkNotificationHubAvailabilityAsync(String resourceGroupName, String namespaceName, CheckAvailabilityParameters parameters) { + NotificationHubsInner client = this.inner(); + return client.checkNotificationHubAvailabilityAsync(resourceGroupName, namespaceName, parameters) + .map(new Func1() { + @Override + public CheckAvailabilityResult call(CheckAvailabilityResultInner inner) { + return new CheckAvailabilityResultImpl(inner, manager()); + } + }); + } + + @Override + public Observable getAuthorizationRuleAsync(String resourceGroupName, String namespaceName, String notificationHubName, String authorizationRuleName) { + NotificationHubsInner client = this.inner(); + return client.getAuthorizationRuleAsync(resourceGroupName, namespaceName, notificationHubName, authorizationRuleName) + .map(new Func1() { + @Override + public NotificationHubNamespaceSharedAccessAuthorizationRuleResource call(SharedAccessAuthorizationRuleResourceInner inner) { + return wrapNotificationHubNamespaceSharedAccessAuthorizationRuleResourceModel(inner); + } + }); + } + + @Override + public Observable listAuthorizationRulesAsync(final String resourceGroupName, final String namespaceName, final String notificationHubName) { + NotificationHubsInner client = this.inner(); + return client.listAuthorizationRulesAsync(resourceGroupName, namespaceName, notificationHubName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public NotificationHubNamespaceSharedAccessAuthorizationRuleResource call(SharedAccessAuthorizationRuleResourceInner inner) { + return wrapNotificationHubNamespaceSharedAccessAuthorizationRuleResourceModel(inner); + } + }); + } + + @Override + public Completable deleteAuthorizationRuleAsync(String resourceGroupName, String namespaceName, String notificationHubName, String authorizationRuleName) { + NotificationHubsInner client = this.inner(); + return client.deleteAuthorizationRuleAsync(resourceGroupName, namespaceName, notificationHubName, authorizationRuleName).toCompletable(); + } + + @Override + public Observable listKeysAsync(String resourceGroupName, String namespaceName, String notificationHubName, String authorizationRuleName) { + NotificationHubsInner client = this.inner(); + return client.listKeysAsync(resourceGroupName, namespaceName, notificationHubName, authorizationRuleName) + .map(new Func1() { + @Override + public ResourceListKeys call(ResourceListKeysInner inner) { + return new ResourceListKeysImpl(inner, manager()); + } + }); + } + + @Override + public Observable regenerateKeysAsync(String resourceGroupName, String namespaceName, String notificationHubName, String authorizationRuleName) { + NotificationHubsInner client = this.inner(); + return client.regenerateKeysAsync(resourceGroupName, namespaceName, notificationHubName, authorizationRuleName) + .map(new Func1() { + @Override + public ResourceListKeys call(ResourceListKeysInner inner) { + return new ResourceListKeysImpl(inner, manager()); + } + }); + } + +} diff --git a/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/implementation/NotificationHubsInner.java b/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/implementation/NotificationHubsInner.java new file mode 100644 index 000000000000..826ec8ddc570 --- /dev/null +++ b/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/implementation/NotificationHubsInner.java @@ -0,0 +1,2069 @@ +/** + * 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.notificationhubs.v2017_04_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.notificationhubs.v2017_04_01.CheckAvailabilityParameters; +import com.microsoft.azure.management.notificationhubs.v2017_04_01.NotificationHubCreateOrUpdateParameters; +import com.microsoft.azure.management.notificationhubs.v2017_04_01.NotificationHubPatchParameters; +import com.microsoft.azure.management.notificationhubs.v2017_04_01.PolicykeyResource; +import com.microsoft.azure.management.notificationhubs.v2017_04_01.SharedAccessAuthorizationRuleCreateOrUpdateParameters; +import com.microsoft.azure.management.notificationhubs.v2017_04_01.SharedAccessAuthorizationRuleProperties; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.PATCH; +import retrofit2.http.Path; +import retrofit2.http.POST; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in NotificationHubs. + */ +public class NotificationHubsInner { + /** The Retrofit service to perform REST calls. */ + private NotificationHubsService service; + /** The service client containing this operation class. */ + private NotificationHubsManagementClientImpl client; + + /** + * Initializes an instance of NotificationHubsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public NotificationHubsInner(Retrofit retrofit, NotificationHubsManagementClientImpl client) { + this.service = retrofit.create(NotificationHubsService.class); + this.client = client; + } + + /** + * The interface defining all the services for NotificationHubs to be + * used by Retrofit to perform actually REST calls. + */ + interface NotificationHubsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.notificationhubs.v2017_04_01.NotificationHubs checkNotificationHubAvailability" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/checkNotificationHubAvailability") + Observable> checkNotificationHubAvailability(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @Path("subscriptionId") String subscriptionId, @Body CheckAvailabilityParameters parameters, @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.notificationhubs.v2017_04_01.NotificationHubs createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/notificationHubs/{notificationHubName}") + Observable> createOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @Path("notificationHubName") String notificationHubName, @Path("subscriptionId") String subscriptionId, @Body NotificationHubCreateOrUpdateParameters parameters, @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.notificationhubs.v2017_04_01.NotificationHubs patch" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/notificationHubs/{notificationHubName}") + Observable> patch(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @Path("notificationHubName") String notificationHubName, @Path("subscriptionId") String subscriptionId, @Body NotificationHubPatchParameters parameters, @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.notificationhubs.v2017_04_01.NotificationHubs delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/notificationHubs/{notificationHubName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @Path("notificationHubName") String notificationHubName, @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.notificationhubs.v2017_04_01.NotificationHubs get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/notificationHubs/{notificationHubName}") + Observable> get(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @Path("notificationHubName") String notificationHubName, @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.notificationhubs.v2017_04_01.NotificationHubs debugSend" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/notificationHubs/{notificationHubName}/debugsend") + Observable> debugSend(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @Path("notificationHubName") String notificationHubName, @Path("subscriptionId") String subscriptionId, @Body Object parameters, @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.notificationhubs.v2017_04_01.NotificationHubs createOrUpdateAuthorizationRule" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/notificationHubs/{notificationHubName}/AuthorizationRules/{authorizationRuleName}") + Observable> createOrUpdateAuthorizationRule(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @Path("notificationHubName") String notificationHubName, @Path("authorizationRuleName") String authorizationRuleName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body SharedAccessAuthorizationRuleCreateOrUpdateParameters parameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.notificationhubs.v2017_04_01.NotificationHubs deleteAuthorizationRule" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/notificationHubs/{notificationHubName}/AuthorizationRules/{authorizationRuleName}", method = "DELETE", hasBody = true) + Observable> deleteAuthorizationRule(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @Path("notificationHubName") String notificationHubName, @Path("authorizationRuleName") String authorizationRuleName, @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.notificationhubs.v2017_04_01.NotificationHubs getAuthorizationRule" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/notificationHubs/{notificationHubName}/AuthorizationRules/{authorizationRuleName}") + Observable> getAuthorizationRule(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @Path("notificationHubName") String notificationHubName, @Path("authorizationRuleName") String authorizationRuleName, @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.notificationhubs.v2017_04_01.NotificationHubs list" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/notificationHubs") + Observable> list(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @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.notificationhubs.v2017_04_01.NotificationHubs listAuthorizationRules" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/notificationHubs/{notificationHubName}/AuthorizationRules") + Observable> listAuthorizationRules(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @Path("notificationHubName") String notificationHubName, @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.notificationhubs.v2017_04_01.NotificationHubs listKeys" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/notificationHubs/{notificationHubName}/AuthorizationRules/{authorizationRuleName}/listKeys") + Observable> listKeys(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @Path("notificationHubName") String notificationHubName, @Path("authorizationRuleName") String authorizationRuleName, @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.notificationhubs.v2017_04_01.NotificationHubs regenerateKeys" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/notificationHubs/{notificationHubName}/AuthorizationRules/{authorizationRuleName}/regenerateKeys") + Observable> regenerateKeys(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @Path("notificationHubName") String notificationHubName, @Path("authorizationRuleName") String authorizationRuleName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body PolicykeyResource parameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.notificationhubs.v2017_04_01.NotificationHubs getPnsCredentials" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/notificationHubs/{notificationHubName}/pnsCredentials") + Observable> getPnsCredentials(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @Path("notificationHubName") String notificationHubName, @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.notificationhubs.v2017_04_01.NotificationHubs 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.notificationhubs.v2017_04_01.NotificationHubs listAuthorizationRulesNext" }) + @GET + Observable> listAuthorizationRulesNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Checks the availability of the given notificationHub in a namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param parameters The notificationHub name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the CheckAvailabilityResultInner object if successful. + */ + public CheckAvailabilityResultInner checkNotificationHubAvailability(String resourceGroupName, String namespaceName, CheckAvailabilityParameters parameters) { + return checkNotificationHubAvailabilityWithServiceResponseAsync(resourceGroupName, namespaceName, parameters).toBlocking().single().body(); + } + + /** + * Checks the availability of the given notificationHub in a namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param parameters The notificationHub name. + * @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 checkNotificationHubAvailabilityAsync(String resourceGroupName, String namespaceName, CheckAvailabilityParameters parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(checkNotificationHubAvailabilityWithServiceResponseAsync(resourceGroupName, namespaceName, parameters), serviceCallback); + } + + /** + * Checks the availability of the given notificationHub in a namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param parameters The notificationHub name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the CheckAvailabilityResultInner object + */ + public Observable checkNotificationHubAvailabilityAsync(String resourceGroupName, String namespaceName, CheckAvailabilityParameters parameters) { + return checkNotificationHubAvailabilityWithServiceResponseAsync(resourceGroupName, namespaceName, parameters).map(new Func1, CheckAvailabilityResultInner>() { + @Override + public CheckAvailabilityResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Checks the availability of the given notificationHub in a namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param parameters The notificationHub name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the CheckAvailabilityResultInner object + */ + public Observable> checkNotificationHubAvailabilityWithServiceResponseAsync(String resourceGroupName, String namespaceName, CheckAvailabilityParameters parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (namespaceName == null) { + throw new IllegalArgumentException("Parameter namespaceName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters 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(parameters); + return service.checkNotificationHubAvailability(resourceGroupName, namespaceName, this.client.subscriptionId(), parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = checkNotificationHubAvailabilityDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse checkNotificationHubAvailabilityDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Creates/Update a NotificationHub in a namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param notificationHubName The notification hub name. + * @param parameters Parameters supplied to the create/update a NotificationHub Resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the NotificationHubResourceInner object if successful. + */ + public NotificationHubResourceInner createOrUpdate(String resourceGroupName, String namespaceName, String notificationHubName, NotificationHubCreateOrUpdateParameters parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, namespaceName, notificationHubName, parameters).toBlocking().single().body(); + } + + /** + * Creates/Update a NotificationHub in a namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param notificationHubName The notification hub name. + * @param parameters Parameters supplied to the create/update a NotificationHub Resource. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String resourceGroupName, String namespaceName, String notificationHubName, NotificationHubCreateOrUpdateParameters parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, namespaceName, notificationHubName, parameters), serviceCallback); + } + + /** + * Creates/Update a NotificationHub in a namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param notificationHubName The notification hub name. + * @param parameters Parameters supplied to the create/update a NotificationHub Resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the NotificationHubResourceInner object + */ + public Observable createOrUpdateAsync(String resourceGroupName, String namespaceName, String notificationHubName, NotificationHubCreateOrUpdateParameters parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, namespaceName, notificationHubName, parameters).map(new Func1, NotificationHubResourceInner>() { + @Override + public NotificationHubResourceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates/Update a NotificationHub in a namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param notificationHubName The notification hub name. + * @param parameters Parameters supplied to the create/update a NotificationHub Resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the NotificationHubResourceInner object + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String namespaceName, String notificationHubName, NotificationHubCreateOrUpdateParameters parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (namespaceName == null) { + throw new IllegalArgumentException("Parameter namespaceName is required and cannot be null."); + } + if (notificationHubName == null) { + throw new IllegalArgumentException("Parameter notificationHubName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters 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(parameters); + return service.createOrUpdate(resourceGroupName, namespaceName, notificationHubName, this.client.subscriptionId(), parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = createOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse createOrUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Patch a NotificationHub in a namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param notificationHubName The notification hub name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the NotificationHubResourceInner object if successful. + */ + public NotificationHubResourceInner patch(String resourceGroupName, String namespaceName, String notificationHubName) { + return patchWithServiceResponseAsync(resourceGroupName, namespaceName, notificationHubName).toBlocking().single().body(); + } + + /** + * Patch a NotificationHub in a namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param notificationHubName The notification hub name. + * @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 patchAsync(String resourceGroupName, String namespaceName, String notificationHubName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(patchWithServiceResponseAsync(resourceGroupName, namespaceName, notificationHubName), serviceCallback); + } + + /** + * Patch a NotificationHub in a namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param notificationHubName The notification hub name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the NotificationHubResourceInner object + */ + public Observable patchAsync(String resourceGroupName, String namespaceName, String notificationHubName) { + return patchWithServiceResponseAsync(resourceGroupName, namespaceName, notificationHubName).map(new Func1, NotificationHubResourceInner>() { + @Override + public NotificationHubResourceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Patch a NotificationHub in a namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param notificationHubName The notification hub name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the NotificationHubResourceInner object + */ + public Observable> patchWithServiceResponseAsync(String resourceGroupName, String namespaceName, String notificationHubName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (namespaceName == null) { + throw new IllegalArgumentException("Parameter namespaceName is required and cannot be null."); + } + if (notificationHubName == null) { + throw new IllegalArgumentException("Parameter notificationHubName is required and cannot be null."); + } + 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."); + } + final NotificationHubPatchParameters parameters = null; + return service.patch(resourceGroupName, namespaceName, notificationHubName, this.client.subscriptionId(), parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = patchDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Patch a NotificationHub in a namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param notificationHubName The notification hub name. + * @param parameters Parameters supplied to patch a NotificationHub Resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the NotificationHubResourceInner object if successful. + */ + public NotificationHubResourceInner patch(String resourceGroupName, String namespaceName, String notificationHubName, NotificationHubPatchParameters parameters) { + return patchWithServiceResponseAsync(resourceGroupName, namespaceName, notificationHubName, parameters).toBlocking().single().body(); + } + + /** + * Patch a NotificationHub in a namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param notificationHubName The notification hub name. + * @param parameters Parameters supplied to patch a NotificationHub Resource. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture patchAsync(String resourceGroupName, String namespaceName, String notificationHubName, NotificationHubPatchParameters parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(patchWithServiceResponseAsync(resourceGroupName, namespaceName, notificationHubName, parameters), serviceCallback); + } + + /** + * Patch a NotificationHub in a namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param notificationHubName The notification hub name. + * @param parameters Parameters supplied to patch a NotificationHub Resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the NotificationHubResourceInner object + */ + public Observable patchAsync(String resourceGroupName, String namespaceName, String notificationHubName, NotificationHubPatchParameters parameters) { + return patchWithServiceResponseAsync(resourceGroupName, namespaceName, notificationHubName, parameters).map(new Func1, NotificationHubResourceInner>() { + @Override + public NotificationHubResourceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Patch a NotificationHub in a namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param notificationHubName The notification hub name. + * @param parameters Parameters supplied to patch a NotificationHub Resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the NotificationHubResourceInner object + */ + public Observable> patchWithServiceResponseAsync(String resourceGroupName, String namespaceName, String notificationHubName, NotificationHubPatchParameters parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (namespaceName == null) { + throw new IllegalArgumentException("Parameter namespaceName is required and cannot be null."); + } + if (notificationHubName == null) { + throw new IllegalArgumentException("Parameter notificationHubName is required and cannot be null."); + } + 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."); + } + Validator.validate(parameters); + return service.patch(resourceGroupName, namespaceName, notificationHubName, this.client.subscriptionId(), parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = patchDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse patchDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Deletes a notification hub associated with a namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param notificationHubName The notification hub name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException 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 namespaceName, String notificationHubName) { + deleteWithServiceResponseAsync(resourceGroupName, namespaceName, notificationHubName).toBlocking().single().body(); + } + + /** + * Deletes a notification hub associated with a namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param notificationHubName The notification hub name. + * @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 namespaceName, String notificationHubName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, namespaceName, notificationHubName), serviceCallback); + } + + /** + * Deletes a notification hub associated with a namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param notificationHubName The notification hub name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable deleteAsync(String resourceGroupName, String namespaceName, String notificationHubName) { + return deleteWithServiceResponseAsync(resourceGroupName, namespaceName, notificationHubName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes a notification hub associated with a namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param notificationHubName The notification hub name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String namespaceName, String notificationHubName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (namespaceName == null) { + throw new IllegalArgumentException("Parameter namespaceName is required and cannot be null."); + } + if (notificationHubName == null) { + throw new IllegalArgumentException("Parameter notificationHubName is required and cannot be null."); + } + 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.delete(resourceGroupName, namespaceName, notificationHubName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = deleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse deleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Lists the notification hubs associated with a namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param notificationHubName The notification hub name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the NotificationHubResourceInner object if successful. + */ + public NotificationHubResourceInner get(String resourceGroupName, String namespaceName, String notificationHubName) { + return getWithServiceResponseAsync(resourceGroupName, namespaceName, notificationHubName).toBlocking().single().body(); + } + + /** + * Lists the notification hubs associated with a namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param notificationHubName The notification hub name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String resourceGroupName, String namespaceName, String notificationHubName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, namespaceName, notificationHubName), serviceCallback); + } + + /** + * Lists the notification hubs associated with a namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param notificationHubName The notification hub name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the NotificationHubResourceInner object + */ + public Observable getAsync(String resourceGroupName, String namespaceName, String notificationHubName) { + return getWithServiceResponseAsync(resourceGroupName, namespaceName, notificationHubName).map(new Func1, NotificationHubResourceInner>() { + @Override + public NotificationHubResourceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Lists the notification hubs associated with a namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param notificationHubName The notification hub name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the NotificationHubResourceInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String namespaceName, String notificationHubName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (namespaceName == null) { + throw new IllegalArgumentException("Parameter namespaceName is required and cannot be null."); + } + if (notificationHubName == null) { + throw new IllegalArgumentException("Parameter notificationHubName is required and cannot be null."); + } + 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.get(resourceGroupName, namespaceName, notificationHubName, this.client.subscriptionId(), 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 CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * test send a push notification. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param notificationHubName The notification hub name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the DebugSendResponseInner object if successful. + */ + public DebugSendResponseInner debugSend(String resourceGroupName, String namespaceName, String notificationHubName) { + return debugSendWithServiceResponseAsync(resourceGroupName, namespaceName, notificationHubName).toBlocking().single().body(); + } + + /** + * test send a push notification. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param notificationHubName The notification hub name. + * @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 debugSendAsync(String resourceGroupName, String namespaceName, String notificationHubName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(debugSendWithServiceResponseAsync(resourceGroupName, namespaceName, notificationHubName), serviceCallback); + } + + /** + * test send a push notification. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param notificationHubName The notification hub name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DebugSendResponseInner object + */ + public Observable debugSendAsync(String resourceGroupName, String namespaceName, String notificationHubName) { + return debugSendWithServiceResponseAsync(resourceGroupName, namespaceName, notificationHubName).map(new Func1, DebugSendResponseInner>() { + @Override + public DebugSendResponseInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * test send a push notification. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param notificationHubName The notification hub name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DebugSendResponseInner object + */ + public Observable> debugSendWithServiceResponseAsync(String resourceGroupName, String namespaceName, String notificationHubName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (namespaceName == null) { + throw new IllegalArgumentException("Parameter namespaceName is required and cannot be null."); + } + if (notificationHubName == null) { + throw new IllegalArgumentException("Parameter notificationHubName is required and cannot be null."); + } + 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."); + } + final Object parameters = null; + return service.debugSend(resourceGroupName, namespaceName, notificationHubName, this.client.subscriptionId(), parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = debugSendDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * test send a push notification. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param notificationHubName The notification hub name. + * @param parameters Debug send parameters + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the DebugSendResponseInner object if successful. + */ + public DebugSendResponseInner debugSend(String resourceGroupName, String namespaceName, String notificationHubName, Object parameters) { + return debugSendWithServiceResponseAsync(resourceGroupName, namespaceName, notificationHubName, parameters).toBlocking().single().body(); + } + + /** + * test send a push notification. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param notificationHubName The notification hub name. + * @param parameters Debug send parameters + * @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 debugSendAsync(String resourceGroupName, String namespaceName, String notificationHubName, Object parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(debugSendWithServiceResponseAsync(resourceGroupName, namespaceName, notificationHubName, parameters), serviceCallback); + } + + /** + * test send a push notification. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param notificationHubName The notification hub name. + * @param parameters Debug send parameters + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DebugSendResponseInner object + */ + public Observable debugSendAsync(String resourceGroupName, String namespaceName, String notificationHubName, Object parameters) { + return debugSendWithServiceResponseAsync(resourceGroupName, namespaceName, notificationHubName, parameters).map(new Func1, DebugSendResponseInner>() { + @Override + public DebugSendResponseInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * test send a push notification. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param notificationHubName The notification hub name. + * @param parameters Debug send parameters + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DebugSendResponseInner object + */ + public Observable> debugSendWithServiceResponseAsync(String resourceGroupName, String namespaceName, String notificationHubName, Object parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (namespaceName == null) { + throw new IllegalArgumentException("Parameter namespaceName is required and cannot be null."); + } + if (notificationHubName == null) { + throw new IllegalArgumentException("Parameter notificationHubName is required and cannot be null."); + } + 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.debugSend(resourceGroupName, namespaceName, notificationHubName, this.client.subscriptionId(), parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = debugSendDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse debugSendDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(201, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Creates/Updates an authorization rule for a NotificationHub. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param notificationHubName The notification hub name. + * @param authorizationRuleName Authorization Rule Name. + * @param properties Properties of the Namespace AuthorizationRules. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the SharedAccessAuthorizationRuleResourceInner object if successful. + */ + public SharedAccessAuthorizationRuleResourceInner createOrUpdateAuthorizationRule(String resourceGroupName, String namespaceName, String notificationHubName, String authorizationRuleName, SharedAccessAuthorizationRuleProperties properties) { + return createOrUpdateAuthorizationRuleWithServiceResponseAsync(resourceGroupName, namespaceName, notificationHubName, authorizationRuleName, properties).toBlocking().single().body(); + } + + /** + * Creates/Updates an authorization rule for a NotificationHub. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param notificationHubName The notification hub name. + * @param authorizationRuleName Authorization Rule Name. + * @param properties Properties of the Namespace AuthorizationRules. + * @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 createOrUpdateAuthorizationRuleAsync(String resourceGroupName, String namespaceName, String notificationHubName, String authorizationRuleName, SharedAccessAuthorizationRuleProperties properties, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateAuthorizationRuleWithServiceResponseAsync(resourceGroupName, namespaceName, notificationHubName, authorizationRuleName, properties), serviceCallback); + } + + /** + * Creates/Updates an authorization rule for a NotificationHub. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param notificationHubName The notification hub name. + * @param authorizationRuleName Authorization Rule Name. + * @param properties Properties of the Namespace AuthorizationRules. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SharedAccessAuthorizationRuleResourceInner object + */ + public Observable createOrUpdateAuthorizationRuleAsync(String resourceGroupName, String namespaceName, String notificationHubName, String authorizationRuleName, SharedAccessAuthorizationRuleProperties properties) { + return createOrUpdateAuthorizationRuleWithServiceResponseAsync(resourceGroupName, namespaceName, notificationHubName, authorizationRuleName, properties).map(new Func1, SharedAccessAuthorizationRuleResourceInner>() { + @Override + public SharedAccessAuthorizationRuleResourceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates/Updates an authorization rule for a NotificationHub. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param notificationHubName The notification hub name. + * @param authorizationRuleName Authorization Rule Name. + * @param properties Properties of the Namespace AuthorizationRules. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SharedAccessAuthorizationRuleResourceInner object + */ + public Observable> createOrUpdateAuthorizationRuleWithServiceResponseAsync(String resourceGroupName, String namespaceName, String notificationHubName, String authorizationRuleName, SharedAccessAuthorizationRuleProperties properties) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (namespaceName == null) { + throw new IllegalArgumentException("Parameter namespaceName is required and cannot be null."); + } + if (notificationHubName == null) { + throw new IllegalArgumentException("Parameter notificationHubName is required and cannot be null."); + } + if (authorizationRuleName == null) { + throw new IllegalArgumentException("Parameter authorizationRuleName is required and cannot be null."); + } + 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 (properties == null) { + throw new IllegalArgumentException("Parameter properties is required and cannot be null."); + } + Validator.validate(properties); + SharedAccessAuthorizationRuleCreateOrUpdateParameters parameters = new SharedAccessAuthorizationRuleCreateOrUpdateParameters(); + parameters.withProperties(properties); + return service.createOrUpdateAuthorizationRule(resourceGroupName, namespaceName, notificationHubName, authorizationRuleName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), parameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = createOrUpdateAuthorizationRuleDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse createOrUpdateAuthorizationRuleDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Deletes a notificationHub authorization rule. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param notificationHubName The notification hub name. + * @param authorizationRuleName Authorization Rule Name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void deleteAuthorizationRule(String resourceGroupName, String namespaceName, String notificationHubName, String authorizationRuleName) { + deleteAuthorizationRuleWithServiceResponseAsync(resourceGroupName, namespaceName, notificationHubName, authorizationRuleName).toBlocking().single().body(); + } + + /** + * Deletes a notificationHub authorization rule. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param notificationHubName The notification hub name. + * @param authorizationRuleName Authorization Rule Name. + * @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 deleteAuthorizationRuleAsync(String resourceGroupName, String namespaceName, String notificationHubName, String authorizationRuleName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteAuthorizationRuleWithServiceResponseAsync(resourceGroupName, namespaceName, notificationHubName, authorizationRuleName), serviceCallback); + } + + /** + * Deletes a notificationHub authorization rule. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param notificationHubName The notification hub name. + * @param authorizationRuleName Authorization Rule Name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable deleteAuthorizationRuleAsync(String resourceGroupName, String namespaceName, String notificationHubName, String authorizationRuleName) { + return deleteAuthorizationRuleWithServiceResponseAsync(resourceGroupName, namespaceName, notificationHubName, authorizationRuleName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes a notificationHub authorization rule. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param notificationHubName The notification hub name. + * @param authorizationRuleName Authorization Rule Name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> deleteAuthorizationRuleWithServiceResponseAsync(String resourceGroupName, String namespaceName, String notificationHubName, String authorizationRuleName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (namespaceName == null) { + throw new IllegalArgumentException("Parameter namespaceName is required and cannot be null."); + } + if (notificationHubName == null) { + throw new IllegalArgumentException("Parameter notificationHubName is required and cannot be null."); + } + if (authorizationRuleName == null) { + throw new IllegalArgumentException("Parameter authorizationRuleName is required and cannot be null."); + } + 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.deleteAuthorizationRule(resourceGroupName, namespaceName, notificationHubName, authorizationRuleName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = deleteAuthorizationRuleDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse deleteAuthorizationRuleDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets an authorization rule for a NotificationHub by name. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name + * @param notificationHubName The notification hub name. + * @param authorizationRuleName authorization rule name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the SharedAccessAuthorizationRuleResourceInner object if successful. + */ + public SharedAccessAuthorizationRuleResourceInner getAuthorizationRule(String resourceGroupName, String namespaceName, String notificationHubName, String authorizationRuleName) { + return getAuthorizationRuleWithServiceResponseAsync(resourceGroupName, namespaceName, notificationHubName, authorizationRuleName).toBlocking().single().body(); + } + + /** + * Gets an authorization rule for a NotificationHub by name. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name + * @param notificationHubName The notification hub name. + * @param authorizationRuleName authorization rule name. + * @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 getAuthorizationRuleAsync(String resourceGroupName, String namespaceName, String notificationHubName, String authorizationRuleName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getAuthorizationRuleWithServiceResponseAsync(resourceGroupName, namespaceName, notificationHubName, authorizationRuleName), serviceCallback); + } + + /** + * Gets an authorization rule for a NotificationHub by name. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name + * @param notificationHubName The notification hub name. + * @param authorizationRuleName authorization rule name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SharedAccessAuthorizationRuleResourceInner object + */ + public Observable getAuthorizationRuleAsync(String resourceGroupName, String namespaceName, String notificationHubName, String authorizationRuleName) { + return getAuthorizationRuleWithServiceResponseAsync(resourceGroupName, namespaceName, notificationHubName, authorizationRuleName).map(new Func1, SharedAccessAuthorizationRuleResourceInner>() { + @Override + public SharedAccessAuthorizationRuleResourceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets an authorization rule for a NotificationHub by name. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name + * @param notificationHubName The notification hub name. + * @param authorizationRuleName authorization rule name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SharedAccessAuthorizationRuleResourceInner object + */ + public Observable> getAuthorizationRuleWithServiceResponseAsync(String resourceGroupName, String namespaceName, String notificationHubName, String authorizationRuleName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (namespaceName == null) { + throw new IllegalArgumentException("Parameter namespaceName is required and cannot be null."); + } + if (notificationHubName == null) { + throw new IllegalArgumentException("Parameter notificationHubName is required and cannot be null."); + } + if (authorizationRuleName == null) { + throw new IllegalArgumentException("Parameter authorizationRuleName is required and cannot be null."); + } + 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.getAuthorizationRule(resourceGroupName, namespaceName, notificationHubName, authorizationRuleName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getAuthorizationRuleDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getAuthorizationRuleDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Lists the notification hubs associated with a namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException 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<NotificationHubResourceInner> object if successful. + */ + public PagedList list(final String resourceGroupName, final String namespaceName) { + ServiceResponse> response = listSinglePageAsync(resourceGroupName, namespaceName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists the notification hubs associated with a namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @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 String resourceGroupName, final String namespaceName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(resourceGroupName, namespaceName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists the notification hubs associated with a namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<NotificationHubResourceInner> object + */ + public Observable> listAsync(final String resourceGroupName, final String namespaceName) { + return listWithServiceResponseAsync(resourceGroupName, namespaceName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists the notification hubs associated with a namespace. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<NotificationHubResourceInner> object + */ + public Observable>> listWithServiceResponseAsync(final String resourceGroupName, final String namespaceName) { + return listSinglePageAsync(resourceGroupName, namespaceName) + .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 the notification hubs associated with a namespace. + * + ServiceResponse> * @param resourceGroupName The name of the resource group. + ServiceResponse> * @param namespaceName The namespace name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<NotificationHubResourceInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync(final String resourceGroupName, final String namespaceName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (namespaceName == null) { + throw new IllegalArgumentException("Parameter namespaceName is required and cannot be null."); + } + 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(resourceGroupName, namespaceName, 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 CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets the authorization rules for a NotificationHub. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name + * @param notificationHubName The notification hub name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException 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<SharedAccessAuthorizationRuleResourceInner> object if successful. + */ + public PagedList listAuthorizationRules(final String resourceGroupName, final String namespaceName, final String notificationHubName) { + ServiceResponse> response = listAuthorizationRulesSinglePageAsync(resourceGroupName, namespaceName, notificationHubName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listAuthorizationRulesNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets the authorization rules for a NotificationHub. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name + * @param notificationHubName The notification hub name. + * @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> listAuthorizationRulesAsync(final String resourceGroupName, final String namespaceName, final String notificationHubName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listAuthorizationRulesSinglePageAsync(resourceGroupName, namespaceName, notificationHubName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listAuthorizationRulesNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets the authorization rules for a NotificationHub. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name + * @param notificationHubName The notification hub name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<SharedAccessAuthorizationRuleResourceInner> object + */ + public Observable> listAuthorizationRulesAsync(final String resourceGroupName, final String namespaceName, final String notificationHubName) { + return listAuthorizationRulesWithServiceResponseAsync(resourceGroupName, namespaceName, notificationHubName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets the authorization rules for a NotificationHub. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name + * @param notificationHubName The notification hub name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<SharedAccessAuthorizationRuleResourceInner> object + */ + public Observable>> listAuthorizationRulesWithServiceResponseAsync(final String resourceGroupName, final String namespaceName, final String notificationHubName) { + return listAuthorizationRulesSinglePageAsync(resourceGroupName, namespaceName, notificationHubName) + .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(listAuthorizationRulesNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets the authorization rules for a NotificationHub. + * + ServiceResponse> * @param resourceGroupName The name of the resource group. + ServiceResponse> * @param namespaceName The namespace name + ServiceResponse> * @param notificationHubName The notification hub name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<SharedAccessAuthorizationRuleResourceInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listAuthorizationRulesSinglePageAsync(final String resourceGroupName, final String namespaceName, final String notificationHubName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (namespaceName == null) { + throw new IllegalArgumentException("Parameter namespaceName is required and cannot be null."); + } + if (notificationHubName == null) { + throw new IllegalArgumentException("Parameter notificationHubName is required and cannot be null."); + } + 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.listAuthorizationRules(resourceGroupName, namespaceName, notificationHubName, 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 = listAuthorizationRulesDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listAuthorizationRulesDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets the Primary and Secondary ConnectionStrings to the NotificationHub. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param notificationHubName The notification hub name. + * @param authorizationRuleName The connection string of the NotificationHub for the specified authorizationRule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ResourceListKeysInner object if successful. + */ + public ResourceListKeysInner listKeys(String resourceGroupName, String namespaceName, String notificationHubName, String authorizationRuleName) { + return listKeysWithServiceResponseAsync(resourceGroupName, namespaceName, notificationHubName, authorizationRuleName).toBlocking().single().body(); + } + + /** + * Gets the Primary and Secondary ConnectionStrings to the NotificationHub. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param notificationHubName The notification hub name. + * @param authorizationRuleName The connection string of the NotificationHub for the specified authorizationRule. + * @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 listKeysAsync(String resourceGroupName, String namespaceName, String notificationHubName, String authorizationRuleName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(listKeysWithServiceResponseAsync(resourceGroupName, namespaceName, notificationHubName, authorizationRuleName), serviceCallback); + } + + /** + * Gets the Primary and Secondary ConnectionStrings to the NotificationHub. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param notificationHubName The notification hub name. + * @param authorizationRuleName The connection string of the NotificationHub for the specified authorizationRule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ResourceListKeysInner object + */ + public Observable listKeysAsync(String resourceGroupName, String namespaceName, String notificationHubName, String authorizationRuleName) { + return listKeysWithServiceResponseAsync(resourceGroupName, namespaceName, notificationHubName, authorizationRuleName).map(new Func1, ResourceListKeysInner>() { + @Override + public ResourceListKeysInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the Primary and Secondary ConnectionStrings to the NotificationHub. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param notificationHubName The notification hub name. + * @param authorizationRuleName The connection string of the NotificationHub for the specified authorizationRule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ResourceListKeysInner object + */ + public Observable> listKeysWithServiceResponseAsync(String resourceGroupName, String namespaceName, String notificationHubName, String authorizationRuleName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (namespaceName == null) { + throw new IllegalArgumentException("Parameter namespaceName is required and cannot be null."); + } + if (notificationHubName == null) { + throw new IllegalArgumentException("Parameter notificationHubName is required and cannot be null."); + } + if (authorizationRuleName == null) { + throw new IllegalArgumentException("Parameter authorizationRuleName is required and cannot be null."); + } + 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.listKeys(resourceGroupName, namespaceName, notificationHubName, authorizationRuleName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = listKeysDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse listKeysDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Regenerates the Primary/Secondary Keys to the NotificationHub Authorization Rule. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param notificationHubName The notification hub name. + * @param authorizationRuleName The connection string of the NotificationHub for the specified authorizationRule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ResourceListKeysInner object if successful. + */ + public ResourceListKeysInner regenerateKeys(String resourceGroupName, String namespaceName, String notificationHubName, String authorizationRuleName) { + return regenerateKeysWithServiceResponseAsync(resourceGroupName, namespaceName, notificationHubName, authorizationRuleName).toBlocking().single().body(); + } + + /** + * Regenerates the Primary/Secondary Keys to the NotificationHub Authorization Rule. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param notificationHubName The notification hub name. + * @param authorizationRuleName The connection string of the NotificationHub for the specified authorizationRule. + * @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 regenerateKeysAsync(String resourceGroupName, String namespaceName, String notificationHubName, String authorizationRuleName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(regenerateKeysWithServiceResponseAsync(resourceGroupName, namespaceName, notificationHubName, authorizationRuleName), serviceCallback); + } + + /** + * Regenerates the Primary/Secondary Keys to the NotificationHub Authorization Rule. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param notificationHubName The notification hub name. + * @param authorizationRuleName The connection string of the NotificationHub for the specified authorizationRule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ResourceListKeysInner object + */ + public Observable regenerateKeysAsync(String resourceGroupName, String namespaceName, String notificationHubName, String authorizationRuleName) { + return regenerateKeysWithServiceResponseAsync(resourceGroupName, namespaceName, notificationHubName, authorizationRuleName).map(new Func1, ResourceListKeysInner>() { + @Override + public ResourceListKeysInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Regenerates the Primary/Secondary Keys to the NotificationHub Authorization Rule. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param notificationHubName The notification hub name. + * @param authorizationRuleName The connection string of the NotificationHub for the specified authorizationRule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ResourceListKeysInner object + */ + public Observable> regenerateKeysWithServiceResponseAsync(String resourceGroupName, String namespaceName, String notificationHubName, String authorizationRuleName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (namespaceName == null) { + throw new IllegalArgumentException("Parameter namespaceName is required and cannot be null."); + } + if (notificationHubName == null) { + throw new IllegalArgumentException("Parameter notificationHubName is required and cannot be null."); + } + if (authorizationRuleName == null) { + throw new IllegalArgumentException("Parameter authorizationRuleName is required and cannot be null."); + } + 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."); + } + final String policyKey = null; + PolicykeyResource parameters = new PolicykeyResource(); + parameters.withPolicyKey(null); + return service.regenerateKeys(resourceGroupName, namespaceName, notificationHubName, authorizationRuleName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), parameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = regenerateKeysDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Regenerates the Primary/Secondary Keys to the NotificationHub Authorization Rule. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param notificationHubName The notification hub name. + * @param authorizationRuleName The connection string of the NotificationHub for the specified authorizationRule. + * @param policyKey Name of the key that has to be regenerated for the Namespace/Notification Hub Authorization Rule. The value can be Primary Key/Secondary Key. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ResourceListKeysInner object if successful. + */ + public ResourceListKeysInner regenerateKeys(String resourceGroupName, String namespaceName, String notificationHubName, String authorizationRuleName, String policyKey) { + return regenerateKeysWithServiceResponseAsync(resourceGroupName, namespaceName, notificationHubName, authorizationRuleName, policyKey).toBlocking().single().body(); + } + + /** + * Regenerates the Primary/Secondary Keys to the NotificationHub Authorization Rule. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param notificationHubName The notification hub name. + * @param authorizationRuleName The connection string of the NotificationHub for the specified authorizationRule. + * @param policyKey Name of the key that has to be regenerated for the Namespace/Notification Hub Authorization Rule. The value can be Primary Key/Secondary Key. + * @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 regenerateKeysAsync(String resourceGroupName, String namespaceName, String notificationHubName, String authorizationRuleName, String policyKey, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(regenerateKeysWithServiceResponseAsync(resourceGroupName, namespaceName, notificationHubName, authorizationRuleName, policyKey), serviceCallback); + } + + /** + * Regenerates the Primary/Secondary Keys to the NotificationHub Authorization Rule. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param notificationHubName The notification hub name. + * @param authorizationRuleName The connection string of the NotificationHub for the specified authorizationRule. + * @param policyKey Name of the key that has to be regenerated for the Namespace/Notification Hub Authorization Rule. The value can be Primary Key/Secondary Key. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ResourceListKeysInner object + */ + public Observable regenerateKeysAsync(String resourceGroupName, String namespaceName, String notificationHubName, String authorizationRuleName, String policyKey) { + return regenerateKeysWithServiceResponseAsync(resourceGroupName, namespaceName, notificationHubName, authorizationRuleName, policyKey).map(new Func1, ResourceListKeysInner>() { + @Override + public ResourceListKeysInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Regenerates the Primary/Secondary Keys to the NotificationHub Authorization Rule. + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param notificationHubName The notification hub name. + * @param authorizationRuleName The connection string of the NotificationHub for the specified authorizationRule. + * @param policyKey Name of the key that has to be regenerated for the Namespace/Notification Hub Authorization Rule. The value can be Primary Key/Secondary Key. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ResourceListKeysInner object + */ + public Observable> regenerateKeysWithServiceResponseAsync(String resourceGroupName, String namespaceName, String notificationHubName, String authorizationRuleName, String policyKey) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (namespaceName == null) { + throw new IllegalArgumentException("Parameter namespaceName is required and cannot be null."); + } + if (notificationHubName == null) { + throw new IllegalArgumentException("Parameter notificationHubName is required and cannot be null."); + } + if (authorizationRuleName == null) { + throw new IllegalArgumentException("Parameter authorizationRuleName is required and cannot be null."); + } + 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."); + } + PolicykeyResource parameters = new PolicykeyResource(); + parameters.withPolicyKey(policyKey); + return service.regenerateKeys(resourceGroupName, namespaceName, notificationHubName, authorizationRuleName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), parameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = regenerateKeysDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse regenerateKeysDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Lists the PNS Credentials associated with a notification hub . + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param notificationHubName The notification hub name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PnsCredentialsResourceInner object if successful. + */ + public PnsCredentialsResourceInner getPnsCredentials(String resourceGroupName, String namespaceName, String notificationHubName) { + return getPnsCredentialsWithServiceResponseAsync(resourceGroupName, namespaceName, notificationHubName).toBlocking().single().body(); + } + + /** + * Lists the PNS Credentials associated with a notification hub . + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param notificationHubName The notification hub name. + * @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 getPnsCredentialsAsync(String resourceGroupName, String namespaceName, String notificationHubName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getPnsCredentialsWithServiceResponseAsync(resourceGroupName, namespaceName, notificationHubName), serviceCallback); + } + + /** + * Lists the PNS Credentials associated with a notification hub . + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param notificationHubName The notification hub name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PnsCredentialsResourceInner object + */ + public Observable getPnsCredentialsAsync(String resourceGroupName, String namespaceName, String notificationHubName) { + return getPnsCredentialsWithServiceResponseAsync(resourceGroupName, namespaceName, notificationHubName).map(new Func1, PnsCredentialsResourceInner>() { + @Override + public PnsCredentialsResourceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Lists the PNS Credentials associated with a notification hub . + * + * @param resourceGroupName The name of the resource group. + * @param namespaceName The namespace name. + * @param notificationHubName The notification hub name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PnsCredentialsResourceInner object + */ + public Observable> getPnsCredentialsWithServiceResponseAsync(String resourceGroupName, String namespaceName, String notificationHubName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (namespaceName == null) { + throw new IllegalArgumentException("Parameter namespaceName is required and cannot be null."); + } + if (notificationHubName == null) { + throw new IllegalArgumentException("Parameter notificationHubName is required and cannot be null."); + } + 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.getPnsCredentials(resourceGroupName, namespaceName, notificationHubName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getPnsCredentialsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getPnsCredentialsDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Lists the notification hubs associated with a namespace. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException 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<NotificationHubResourceInner> 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 the notification hubs associated with a namespace. + * + * @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 the notification hubs associated with a namespace. + * + * @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<NotificationHubResourceInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists the notification hubs associated with a namespace. + * + * @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<NotificationHubResourceInner> 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 the notification hubs associated with a namespace. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<NotificationHubResourceInner> 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 CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets the authorization rules for a NotificationHub. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException 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<SharedAccessAuthorizationRuleResourceInner> object if successful. + */ + public PagedList listAuthorizationRulesNext(final String nextPageLink) { + ServiceResponse> response = listAuthorizationRulesNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listAuthorizationRulesNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets the authorization rules for a NotificationHub. + * + * @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> listAuthorizationRulesNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listAuthorizationRulesNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listAuthorizationRulesNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets the authorization rules for a NotificationHub. + * + * @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<SharedAccessAuthorizationRuleResourceInner> object + */ + public Observable> listAuthorizationRulesNextAsync(final String nextPageLink) { + return listAuthorizationRulesNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets the authorization rules for a NotificationHub. + * + * @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<SharedAccessAuthorizationRuleResourceInner> object + */ + public Observable>> listAuthorizationRulesNextWithServiceResponseAsync(final String nextPageLink) { + return listAuthorizationRulesNextSinglePageAsync(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(listAuthorizationRulesNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets the authorization rules for a NotificationHub. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<SharedAccessAuthorizationRuleResourceInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listAuthorizationRulesNextSinglePageAsync(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.listAuthorizationRulesNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listAuthorizationRulesNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listAuthorizationRulesNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/implementation/NotificationHubsManagementClientImpl.java b/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/implementation/NotificationHubsManagementClientImpl.java new file mode 100644 index 000000000000..dbd5f3e14829 --- /dev/null +++ b/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/implementation/NotificationHubsManagementClientImpl.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.notificationhubs.v2017_04_01.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 NotificationHubsManagementClientImpl class. + */ +public class NotificationHubsManagementClientImpl 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; + } + + /** Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. */ + private String subscriptionId; + + /** + * Gets Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + * + * @return the subscriptionId value. + */ + public String subscriptionId() { + return this.subscriptionId; + } + + /** + * Sets Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + * + * @param subscriptionId the subscriptionId value. + * @return the service client itself + */ + public NotificationHubsManagementClientImpl withSubscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; + return this; + } + + /** Client Api Version. */ + private String apiVersion; + + /** + * Gets Client Api Version. + * + * @return the apiVersion value. + */ + public String apiVersion() { + return this.apiVersion; + } + + /** The preferred language for the response. */ + private String acceptLanguage; + + /** + * Gets The preferred language for the response. + * + * @return the acceptLanguage value. + */ + public String acceptLanguage() { + return this.acceptLanguage; + } + + /** + * Sets The preferred language for the response. + * + * @param acceptLanguage the acceptLanguage value. + * @return the service client itself + */ + public NotificationHubsManagementClientImpl 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 NotificationHubsManagementClientImpl 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 NotificationHubsManagementClientImpl withGenerateClientRequestId(boolean generateClientRequestId) { + this.generateClientRequestId = generateClientRequestId; + return this; + } + + /** + * 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 NamespacesInner object to access its operations. + */ + private NamespacesInner namespaces; + + /** + * Gets the NamespacesInner object to access its operations. + * @return the NamespacesInner object. + */ + public NamespacesInner namespaces() { + return this.namespaces; + } + + /** + * The NotificationHubsInner object to access its operations. + */ + private NotificationHubsInner notificationHubs; + + /** + * Gets the NotificationHubsInner object to access its operations. + * @return the NotificationHubsInner object. + */ + public NotificationHubsInner notificationHubs() { + return this.notificationHubs; + } + + /** + * Initializes an instance of NotificationHubsManagementClient client. + * + * @param credentials the management credentials for Azure + */ + public NotificationHubsManagementClientImpl(ServiceClientCredentials credentials) { + this("https://management.azure.com", credentials); + } + + /** + * Initializes an instance of NotificationHubsManagementClient client. + * + * @param baseUrl the base URL of the host + * @param credentials the management credentials for Azure + */ + public NotificationHubsManagementClientImpl(String baseUrl, ServiceClientCredentials credentials) { + super(baseUrl, credentials); + initialize(); + } + + /** + * Initializes an instance of NotificationHubsManagementClient client. + * + * @param restClient the REST client to connect to Azure. + */ + public NotificationHubsManagementClientImpl(RestClient restClient) { + super(restClient); + initialize(); + } + + protected void initialize() { + this.apiVersion = "2017-04-01"; + this.acceptLanguage = "en-US"; + this.longRunningOperationRetryTimeout = 30; + this.generateClientRequestId = true; + this.operations = new OperationsInner(restClient().retrofit(), this); + this.namespaces = new NamespacesInner(restClient().retrofit(), this); + this.notificationHubs = new NotificationHubsInner(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(), "NotificationHubsManagementClient", "2017-04-01"); + } +} diff --git a/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/implementation/NotificationHubsManager.java b/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/implementation/NotificationHubsManager.java new file mode 100644 index 000000000000..2e9200f1823d --- /dev/null +++ b/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/implementation/NotificationHubsManager.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.notificationhubs.v2017_04_01.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.notificationhubs.v2017_04_01.Operations; +import com.microsoft.azure.management.notificationhubs.v2017_04_01.Namespaces; +import com.microsoft.azure.management.notificationhubs.v2017_04_01.NotificationHubs; +import com.microsoft.azure.arm.resources.implementation.AzureConfigurableCoreImpl; +import com.microsoft.azure.arm.resources.implementation.ManagerCore; + +/** + * Entry point to Azure NotificationHubs resource management. + */ +public final class NotificationHubsManager extends ManagerCore { + private Operations operations; + private Namespaces namespaces; + private NotificationHubs notificationHubs; + /** + * Get a Configurable instance that can be used to create NotificationHubsManager with optional configuration. + * + * @return the instance allowing configurations + */ + public static Configurable configure() { + return new NotificationHubsManager.ConfigurableImpl(); + } + /** + * Creates an instance of NotificationHubsManager that exposes NotificationHubs resource management API entry points. + * + * @param credentials the credentials to use + * @param subscriptionId the subscription UUID + * @return the NotificationHubsManager + */ + public static NotificationHubsManager authenticate(AzureTokenCredentials credentials, String subscriptionId) { + return new NotificationHubsManager(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 NotificationHubsManager that exposes NotificationHubs resource management API entry points. + * + * @param restClient the RestClient to be used for API calls. + * @param subscriptionId the subscription UUID + * @return the NotificationHubsManager + */ + public static NotificationHubsManager authenticate(RestClient restClient, String subscriptionId) { + return new NotificationHubsManager(restClient, subscriptionId); + } + /** + * The interface allowing configurations to be set. + */ + public interface Configurable extends AzureConfigurable { + /** + * Creates an instance of NotificationHubsManager that exposes NotificationHubs management API entry points. + * + * @param credentials the credentials to use + * @param subscriptionId the subscription UUID + * @return the interface exposing NotificationHubs management API entry points that work across subscriptions + */ + NotificationHubsManager authenticate(AzureTokenCredentials credentials, String subscriptionId); + } + + /** + * @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 Namespaces. + */ + public Namespaces namespaces() { + if (this.namespaces == null) { + this.namespaces = new NamespacesImpl(this); + } + return this.namespaces; + } + + /** + * @return Entry point to manage NotificationHubs. + */ + public NotificationHubs notificationHubs() { + if (this.notificationHubs == null) { + this.notificationHubs = new NotificationHubsImpl(this); + } + return this.notificationHubs; + } + + /** + * The implementation for Configurable interface. + */ + private static final class ConfigurableImpl extends AzureConfigurableCoreImpl implements Configurable { + public NotificationHubsManager authenticate(AzureTokenCredentials credentials, String subscriptionId) { + return NotificationHubsManager.authenticate(buildRestClient(credentials), subscriptionId); + } + } + private NotificationHubsManager(RestClient restClient, String subscriptionId) { + super( + restClient, + subscriptionId, + new NotificationHubsManagementClientImpl(restClient).withSubscriptionId(subscriptionId)); + } +} diff --git a/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/implementation/OperationImpl.java b/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/implementation/OperationImpl.java new file mode 100644 index 000000000000..56f9a28ce994 --- /dev/null +++ b/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/implementation/OperationImpl.java @@ -0,0 +1,37 @@ +/** + * 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.notificationhubs.v2017_04_01.implementation; + +import com.microsoft.azure.management.notificationhubs.v2017_04_01.Operation; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.notificationhubs.v2017_04_01.OperationDisplay; + +class OperationImpl extends WrapperImpl implements Operation { + private final NotificationHubsManager manager; + OperationImpl(OperationInner inner, NotificationHubsManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public NotificationHubsManager manager() { + return this.manager; + } + + @Override + public OperationDisplay display() { + return this.inner().display(); + } + + @Override + public String name() { + return this.inner().name(); + } + +} diff --git a/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/implementation/OperationInner.java b/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/implementation/OperationInner.java new file mode 100644 index 000000000000..f1c4a0f2b8d5 --- /dev/null +++ b/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/implementation/OperationInner.java @@ -0,0 +1,59 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.notificationhubs.v2017_04_01.implementation; + +import com.microsoft.azure.management.notificationhubs.v2017_04_01.OperationDisplay; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * A NotificationHubs REST API operation. + */ +public class OperationInner { + /** + * Operation name: {provider}/{resource}/{operation}. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /** + * The object that represents the operation. + */ + @JsonProperty(value = "display") + private OperationDisplay display; + + /** + * Get operation name: {provider}/{resource}/{operation}. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Get the object that represents the operation. + * + * @return the display value + */ + public OperationDisplay display() { + return this.display; + } + + /** + * Set the object that represents 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/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/implementation/OperationsImpl.java b/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/implementation/OperationsImpl.java new file mode 100644 index 000000000000..1288932250d7 --- /dev/null +++ b/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/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.notificationhubs.v2017_04_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.notificationhubs.v2017_04_01.Operations; +import rx.functions.Func1; +import rx.Observable; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.notificationhubs.v2017_04_01.Operation; + +class OperationsImpl extends WrapperImpl implements Operations { + private final NotificationHubsManager manager; + + OperationsImpl(NotificationHubsManager manager) { + super(manager.inner().operations()); + this.manager = manager; + } + + public NotificationHubsManager 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/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/implementation/OperationsInner.java b/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/implementation/OperationsInner.java new file mode 100644 index 000000000000..8373138dd537 --- /dev/null +++ b/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/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.notificationhubs.v2017_04_01.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.notificationhubs.v2017_04_01.ErrorResponseException; +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 NotificationHubsManagementClientImpl 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, NotificationHubsManagementClientImpl 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.notificationhubs.v2017_04_01.Operations list" }) + @GET("providers/Microsoft.NotificationHubs/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.notificationhubs.v2017_04_01.Operations listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Lists all of the available NotificationHubs REST API operations. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException 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 NotificationHubs 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 NotificationHubs 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 NotificationHubs 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 NotificationHubs 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 ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Lists all of the available NotificationHubs REST API operations. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException 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 NotificationHubs 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 NotificationHubs 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 NotificationHubs 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 NotificationHubs 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 ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + +} diff --git a/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/implementation/PageImpl.java b/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/implementation/PageImpl.java new file mode 100644 index 000000000000..a1234b05e73d --- /dev/null +++ b/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/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.notificationhubs.v2017_04_01.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/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/implementation/PnsCredentialsResourceImpl.java b/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/implementation/PnsCredentialsResourceImpl.java new file mode 100644 index 000000000000..81e1e1576e9e --- /dev/null +++ b/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/implementation/PnsCredentialsResourceImpl.java @@ -0,0 +1,94 @@ +/** + * 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.notificationhubs.v2017_04_01.implementation; + +import com.microsoft.azure.management.notificationhubs.v2017_04_01.PnsCredentialsResource; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.notificationhubs.v2017_04_01.AdmCredential; +import com.microsoft.azure.management.notificationhubs.v2017_04_01.ApnsCredential; +import com.microsoft.azure.management.notificationhubs.v2017_04_01.BaiduCredential; +import com.microsoft.azure.management.notificationhubs.v2017_04_01.GcmCredential; +import com.microsoft.azure.management.notificationhubs.v2017_04_01.MpnsCredential; +import com.microsoft.azure.management.notificationhubs.v2017_04_01.Sku; +import java.util.Map; +import com.microsoft.azure.management.notificationhubs.v2017_04_01.WnsCredential; + +class PnsCredentialsResourceImpl extends WrapperImpl implements PnsCredentialsResource { + private final NotificationHubsManager manager; + PnsCredentialsResourceImpl(PnsCredentialsResourceInner inner, NotificationHubsManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public NotificationHubsManager manager() { + return this.manager; + } + + @Override + public AdmCredential admCredential() { + return this.inner().admCredential(); + } + + @Override + public ApnsCredential apnsCredential() { + return this.inner().apnsCredential(); + } + + @Override + public BaiduCredential baiduCredential() { + return this.inner().baiduCredential(); + } + + @Override + public GcmCredential gcmCredential() { + return this.inner().gcmCredential(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String location() { + return this.inner().location(); + } + + @Override + public MpnsCredential mpnsCredential() { + return this.inner().mpnsCredential(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public Sku sku() { + return this.inner().sku(); + } + + @Override + public Map tags() { + return this.inner().getTags(); + } + + @Override + public String type() { + return this.inner().type(); + } + + @Override + public WnsCredential wnsCredential() { + return this.inner().wnsCredential(); + } + +} diff --git a/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/implementation/PnsCredentialsResourceInner.java b/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/implementation/PnsCredentialsResourceInner.java new file mode 100644 index 000000000000..b26f39f4f08b --- /dev/null +++ b/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/implementation/PnsCredentialsResourceInner.java @@ -0,0 +1,211 @@ +/** + * 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.notificationhubs.v2017_04_01.implementation; + +import com.microsoft.azure.management.notificationhubs.v2017_04_01.ApnsCredential; +import com.microsoft.azure.management.notificationhubs.v2017_04_01.WnsCredential; +import com.microsoft.azure.management.notificationhubs.v2017_04_01.GcmCredential; +import com.microsoft.azure.management.notificationhubs.v2017_04_01.MpnsCredential; +import com.microsoft.azure.management.notificationhubs.v2017_04_01.AdmCredential; +import com.microsoft.azure.management.notificationhubs.v2017_04_01.BaiduCredential; +import com.microsoft.azure.management.notificationhubs.v2017_04_01.Sku; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.rest.SkipParentValidation; +import com.microsoft.azure.Resource; + +/** + * Description of a NotificationHub PNS Credentials. + */ +@JsonFlatten +@SkipParentValidation +public class PnsCredentialsResourceInner extends Resource { + /** + * The ApnsCredential of the created NotificationHub. + */ + @JsonProperty(value = "properties.apnsCredential") + private ApnsCredential apnsCredential; + + /** + * The WnsCredential of the created NotificationHub. + */ + @JsonProperty(value = "properties.wnsCredential") + private WnsCredential wnsCredential; + + /** + * The GcmCredential of the created NotificationHub. + */ + @JsonProperty(value = "properties.gcmCredential") + private GcmCredential gcmCredential; + + /** + * The MpnsCredential of the created NotificationHub. + */ + @JsonProperty(value = "properties.mpnsCredential") + private MpnsCredential mpnsCredential; + + /** + * The AdmCredential of the created NotificationHub. + */ + @JsonProperty(value = "properties.admCredential") + private AdmCredential admCredential; + + /** + * The BaiduCredential of the created NotificationHub. + */ + @JsonProperty(value = "properties.baiduCredential") + private BaiduCredential baiduCredential; + + /** + * The sku of the created namespace. + */ + @JsonProperty(value = "sku") + private Sku sku; + + /** + * Get the ApnsCredential of the created NotificationHub. + * + * @return the apnsCredential value + */ + public ApnsCredential apnsCredential() { + return this.apnsCredential; + } + + /** + * Set the ApnsCredential of the created NotificationHub. + * + * @param apnsCredential the apnsCredential value to set + * @return the PnsCredentialsResourceInner object itself. + */ + public PnsCredentialsResourceInner withApnsCredential(ApnsCredential apnsCredential) { + this.apnsCredential = apnsCredential; + return this; + } + + /** + * Get the WnsCredential of the created NotificationHub. + * + * @return the wnsCredential value + */ + public WnsCredential wnsCredential() { + return this.wnsCredential; + } + + /** + * Set the WnsCredential of the created NotificationHub. + * + * @param wnsCredential the wnsCredential value to set + * @return the PnsCredentialsResourceInner object itself. + */ + public PnsCredentialsResourceInner withWnsCredential(WnsCredential wnsCredential) { + this.wnsCredential = wnsCredential; + return this; + } + + /** + * Get the GcmCredential of the created NotificationHub. + * + * @return the gcmCredential value + */ + public GcmCredential gcmCredential() { + return this.gcmCredential; + } + + /** + * Set the GcmCredential of the created NotificationHub. + * + * @param gcmCredential the gcmCredential value to set + * @return the PnsCredentialsResourceInner object itself. + */ + public PnsCredentialsResourceInner withGcmCredential(GcmCredential gcmCredential) { + this.gcmCredential = gcmCredential; + return this; + } + + /** + * Get the MpnsCredential of the created NotificationHub. + * + * @return the mpnsCredential value + */ + public MpnsCredential mpnsCredential() { + return this.mpnsCredential; + } + + /** + * Set the MpnsCredential of the created NotificationHub. + * + * @param mpnsCredential the mpnsCredential value to set + * @return the PnsCredentialsResourceInner object itself. + */ + public PnsCredentialsResourceInner withMpnsCredential(MpnsCredential mpnsCredential) { + this.mpnsCredential = mpnsCredential; + return this; + } + + /** + * Get the AdmCredential of the created NotificationHub. + * + * @return the admCredential value + */ + public AdmCredential admCredential() { + return this.admCredential; + } + + /** + * Set the AdmCredential of the created NotificationHub. + * + * @param admCredential the admCredential value to set + * @return the PnsCredentialsResourceInner object itself. + */ + public PnsCredentialsResourceInner withAdmCredential(AdmCredential admCredential) { + this.admCredential = admCredential; + return this; + } + + /** + * Get the BaiduCredential of the created NotificationHub. + * + * @return the baiduCredential value + */ + public BaiduCredential baiduCredential() { + return this.baiduCredential; + } + + /** + * Set the BaiduCredential of the created NotificationHub. + * + * @param baiduCredential the baiduCredential value to set + * @return the PnsCredentialsResourceInner object itself. + */ + public PnsCredentialsResourceInner withBaiduCredential(BaiduCredential baiduCredential) { + this.baiduCredential = baiduCredential; + return this; + } + + /** + * Get the sku of the created namespace. + * + * @return the sku value + */ + public Sku sku() { + return this.sku; + } + + /** + * Set the sku of the created namespace. + * + * @param sku the sku value to set + * @return the PnsCredentialsResourceInner object itself. + */ + public PnsCredentialsResourceInner withSku(Sku sku) { + this.sku = sku; + return this; + } + +} diff --git a/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/implementation/ResourceListKeysImpl.java b/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/implementation/ResourceListKeysImpl.java new file mode 100644 index 000000000000..468ba39610d8 --- /dev/null +++ b/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/implementation/ResourceListKeysImpl.java @@ -0,0 +1,51 @@ +/** + * 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.notificationhubs.v2017_04_01.implementation; + +import com.microsoft.azure.management.notificationhubs.v2017_04_01.ResourceListKeys; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; + +class ResourceListKeysImpl extends WrapperImpl implements ResourceListKeys { + private final NotificationHubsManager manager; + ResourceListKeysImpl(ResourceListKeysInner inner, NotificationHubsManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public NotificationHubsManager manager() { + return this.manager; + } + + @Override + public String keyName() { + return this.inner().keyName(); + } + + @Override + public String primaryConnectionString() { + return this.inner().primaryConnectionString(); + } + + @Override + public String primaryKey() { + return this.inner().primaryKey(); + } + + @Override + public String secondaryConnectionString() { + return this.inner().secondaryConnectionString(); + } + + @Override + public String secondaryKey() { + return this.inner().secondaryKey(); + } + +} diff --git a/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/implementation/ResourceListKeysInner.java b/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/implementation/ResourceListKeysInner.java new file mode 100644 index 000000000000..8c997229f3ca --- /dev/null +++ b/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/implementation/ResourceListKeysInner.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.notificationhubs.v2017_04_01.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Namespace/NotificationHub Connection String. + */ +public class ResourceListKeysInner { + /** + * PrimaryConnectionString of the AuthorizationRule. + */ + @JsonProperty(value = "primaryConnectionString") + private String primaryConnectionString; + + /** + * SecondaryConnectionString of the created AuthorizationRule. + */ + @JsonProperty(value = "secondaryConnectionString") + private String secondaryConnectionString; + + /** + * PrimaryKey of the created AuthorizationRule. + */ + @JsonProperty(value = "primaryKey") + private String primaryKey; + + /** + * SecondaryKey of the created AuthorizationRule. + */ + @JsonProperty(value = "secondaryKey") + private String secondaryKey; + + /** + * KeyName of the created AuthorizationRule. + */ + @JsonProperty(value = "keyName") + private String keyName; + + /** + * Get primaryConnectionString of the AuthorizationRule. + * + * @return the primaryConnectionString value + */ + public String primaryConnectionString() { + return this.primaryConnectionString; + } + + /** + * Set primaryConnectionString of the AuthorizationRule. + * + * @param primaryConnectionString the primaryConnectionString value to set + * @return the ResourceListKeysInner object itself. + */ + public ResourceListKeysInner withPrimaryConnectionString(String primaryConnectionString) { + this.primaryConnectionString = primaryConnectionString; + return this; + } + + /** + * Get secondaryConnectionString of the created AuthorizationRule. + * + * @return the secondaryConnectionString value + */ + public String secondaryConnectionString() { + return this.secondaryConnectionString; + } + + /** + * Set secondaryConnectionString of the created AuthorizationRule. + * + * @param secondaryConnectionString the secondaryConnectionString value to set + * @return the ResourceListKeysInner object itself. + */ + public ResourceListKeysInner withSecondaryConnectionString(String secondaryConnectionString) { + this.secondaryConnectionString = secondaryConnectionString; + return this; + } + + /** + * Get primaryKey of the created AuthorizationRule. + * + * @return the primaryKey value + */ + public String primaryKey() { + return this.primaryKey; + } + + /** + * Set primaryKey of the created AuthorizationRule. + * + * @param primaryKey the primaryKey value to set + * @return the ResourceListKeysInner object itself. + */ + public ResourceListKeysInner withPrimaryKey(String primaryKey) { + this.primaryKey = primaryKey; + return this; + } + + /** + * Get secondaryKey of the created AuthorizationRule. + * + * @return the secondaryKey value + */ + public String secondaryKey() { + return this.secondaryKey; + } + + /** + * Set secondaryKey of the created AuthorizationRule. + * + * @param secondaryKey the secondaryKey value to set + * @return the ResourceListKeysInner object itself. + */ + public ResourceListKeysInner withSecondaryKey(String secondaryKey) { + this.secondaryKey = secondaryKey; + return this; + } + + /** + * Get keyName of the created AuthorizationRule. + * + * @return the keyName value + */ + public String keyName() { + return this.keyName; + } + + /** + * Set keyName of the created AuthorizationRule. + * + * @param keyName the keyName value to set + * @return the ResourceListKeysInner object itself. + */ + public ResourceListKeysInner withKeyName(String keyName) { + this.keyName = keyName; + return this; + } + +} diff --git a/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/implementation/SharedAccessAuthorizationRuleListResultImpl.java b/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/implementation/SharedAccessAuthorizationRuleListResultImpl.java new file mode 100644 index 000000000000..7f3ab68a7e7a --- /dev/null +++ b/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/implementation/SharedAccessAuthorizationRuleListResultImpl.java @@ -0,0 +1,37 @@ +/** + * 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.notificationhubs.v2017_04_01.implementation; + +import com.microsoft.azure.management.notificationhubs.v2017_04_01.SharedAccessAuthorizationRuleListResult; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import java.util.List; + +class SharedAccessAuthorizationRuleListResultImpl extends WrapperImpl implements SharedAccessAuthorizationRuleListResult { + private final NotificationHubsManager manager; + SharedAccessAuthorizationRuleListResultImpl(SharedAccessAuthorizationRuleListResultInner inner, NotificationHubsManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public NotificationHubsManager manager() { + return this.manager; + } + + @Override + public String nextLink() { + return this.inner().nextLink(); + } + + @Override + public List value() { + return this.inner().value(); + } + +} diff --git a/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/implementation/SharedAccessAuthorizationRuleListResultInner.java b/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/implementation/SharedAccessAuthorizationRuleListResultInner.java new file mode 100644 index 000000000000..9e0003fd99bd --- /dev/null +++ b/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/implementation/SharedAccessAuthorizationRuleListResultInner.java @@ -0,0 +1,71 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.notificationhubs.v2017_04_01.implementation; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The response of the List Namespace operation. + */ +public class SharedAccessAuthorizationRuleListResultInner { + /** + * Result of the List AuthorizationRules operation. + */ + @JsonProperty(value = "value") + private List value; + + /** + * Link to the next set of results. Not empty if Value contains incomplete + * list of AuthorizationRules. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get result of the List AuthorizationRules operation. + * + * @return the value value + */ + public List value() { + return this.value; + } + + /** + * Set result of the List AuthorizationRules operation. + * + * @param value the value value to set + * @return the SharedAccessAuthorizationRuleListResultInner object itself. + */ + public SharedAccessAuthorizationRuleListResultInner withValue(List value) { + this.value = value; + return this; + } + + /** + * Get link to the next set of results. Not empty if Value contains incomplete list of AuthorizationRules. + * + * @return the nextLink value + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set link to the next set of results. Not empty if Value contains incomplete list of AuthorizationRules. + * + * @param nextLink the nextLink value to set + * @return the SharedAccessAuthorizationRuleListResultInner object itself. + */ + public SharedAccessAuthorizationRuleListResultInner withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + +} diff --git a/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/implementation/SharedAccessAuthorizationRuleResourceInner.java b/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/implementation/SharedAccessAuthorizationRuleResourceInner.java new file mode 100644 index 000000000000..1541fd0842e4 --- /dev/null +++ b/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/implementation/SharedAccessAuthorizationRuleResourceInner.java @@ -0,0 +1,199 @@ +/** + * 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.notificationhubs.v2017_04_01.implementation; + +import java.util.List; +import com.microsoft.azure.management.notificationhubs.v2017_04_01.AccessRights; +import com.microsoft.azure.management.notificationhubs.v2017_04_01.Sku; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.rest.SkipParentValidation; +import com.microsoft.azure.Resource; + +/** + * Description of a Namespace AuthorizationRules. + */ +@JsonFlatten +@SkipParentValidation +public class SharedAccessAuthorizationRuleResourceInner extends Resource { + /** + * The rights associated with the rule. + */ + @JsonProperty(value = "properties.rights") + private List rights; + + /** + * A base64-encoded 256-bit primary key for signing and validating the SAS + * token. + */ + @JsonProperty(value = "properties.primaryKey", access = JsonProperty.Access.WRITE_ONLY) + private String primaryKey; + + /** + * A base64-encoded 256-bit primary key for signing and validating the SAS + * token. + */ + @JsonProperty(value = "properties.secondaryKey", access = JsonProperty.Access.WRITE_ONLY) + private String secondaryKey; + + /** + * A string that describes the authorization rule. + */ + @JsonProperty(value = "properties.keyName", access = JsonProperty.Access.WRITE_ONLY) + private String keyName; + + /** + * A string that describes the claim type. + */ + @JsonProperty(value = "properties.claimType", access = JsonProperty.Access.WRITE_ONLY) + private String claimType; + + /** + * A string that describes the claim value. + */ + @JsonProperty(value = "properties.claimValue", access = JsonProperty.Access.WRITE_ONLY) + private String claimValue; + + /** + * The last modified time for this rule. + */ + @JsonProperty(value = "properties.modifiedTime", access = JsonProperty.Access.WRITE_ONLY) + private String modifiedTime; + + /** + * The created time for this rule. + */ + @JsonProperty(value = "properties.createdTime", access = JsonProperty.Access.WRITE_ONLY) + private String createdTime; + + /** + * The revision number for the rule. + */ + @JsonProperty(value = "properties.revision", access = JsonProperty.Access.WRITE_ONLY) + private Integer revision; + + /** + * The sku of the created namespace. + */ + @JsonProperty(value = "sku") + private Sku sku; + + /** + * Get the rights associated with the rule. + * + * @return the rights value + */ + public List rights() { + return this.rights; + } + + /** + * Set the rights associated with the rule. + * + * @param rights the rights value to set + * @return the SharedAccessAuthorizationRuleResourceInner object itself. + */ + public SharedAccessAuthorizationRuleResourceInner withRights(List rights) { + this.rights = rights; + return this; + } + + /** + * Get a base64-encoded 256-bit primary key for signing and validating the SAS token. + * + * @return the primaryKey value + */ + public String primaryKey() { + return this.primaryKey; + } + + /** + * Get a base64-encoded 256-bit primary key for signing and validating the SAS token. + * + * @return the secondaryKey value + */ + public String secondaryKey() { + return this.secondaryKey; + } + + /** + * Get a string that describes the authorization rule. + * + * @return the keyName value + */ + public String keyName() { + return this.keyName; + } + + /** + * Get a string that describes the claim type. + * + * @return the claimType value + */ + public String claimType() { + return this.claimType; + } + + /** + * Get a string that describes the claim value. + * + * @return the claimValue value + */ + public String claimValue() { + return this.claimValue; + } + + /** + * Get the last modified time for this rule. + * + * @return the modifiedTime value + */ + public String modifiedTime() { + return this.modifiedTime; + } + + /** + * Get the created time for this rule. + * + * @return the createdTime value + */ + public String createdTime() { + return this.createdTime; + } + + /** + * Get the revision number for the rule. + * + * @return the revision value + */ + public Integer revision() { + return this.revision; + } + + /** + * Get the sku of the created namespace. + * + * @return the sku value + */ + public Sku sku() { + return this.sku; + } + + /** + * Set the sku of the created namespace. + * + * @param sku the sku value to set + * @return the SharedAccessAuthorizationRuleResourceInner object itself. + */ + public SharedAccessAuthorizationRuleResourceInner withSku(Sku sku) { + this.sku = sku; + return this; + } + +} diff --git a/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/implementation/package-info.java b/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/implementation/package-info.java new file mode 100644 index 000000000000..b105be980c7e --- /dev/null +++ b/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/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 NotificationHubsManagementClient. + * Azure NotificationHub client. + */ +package com.microsoft.azure.management.notificationhubs.v2017_04_01.implementation; diff --git a/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/package-info.java b/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/package-info.java new file mode 100644 index 000000000000..435ec812f8c1 --- /dev/null +++ b/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/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 NotificationHubsManagementClient. + * Azure NotificationHub client. + */ +package com.microsoft.azure.management.notificationhubs.v2017_04_01;