diff --git a/signalr/resource-manager/v2018_10_01/pom.xml b/signalr/resource-manager/v2018_10_01/pom.xml new file mode 100644 index 000000000000..9cfae155ebc1 --- /dev/null +++ b/signalr/resource-manager/v2018_10_01/pom.xml @@ -0,0 +1,133 @@ + + + 4.0.0 + com.microsoft.azure.signalr.v2018_10_01 + + com.microsoft.azure + azure-arm-parent + 0.0.2-beta + ../../../pom.xml + + azure-mgmt-signalrservice + 1.0.0-beta + jar + Microsoft Azure SDK for SignalRService Management + This package contains Microsoft SignalRService Management SDK. + https://github.com/Azure/azure-libraries-for-java + + + The MIT License (MIT) + http://opensource.org/licenses/MIT + repo + + + + scm:git:https://github.com/Azure/azure-libraries-for-java + scm:git:git@github.com:Azure/azure-libraries-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/signalr/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/signalr/v2018_10_01/Dimension.java b/signalr/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/signalr/v2018_10_01/Dimension.java new file mode 100644 index 000000000000..738629168dc7 --- /dev/null +++ b/signalr/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/signalr/v2018_10_01/Dimension.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.signalr.v2018_10_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Specifications of the Dimension of metrics. + */ +public class Dimension { + /** + * The public facing name of the dimension. + */ + @JsonProperty(value = "name") + private String name; + + /** + * Localized friendly display name of the dimension. + */ + @JsonProperty(value = "displayName") + private String displayName; + + /** + * Name of the dimension as it appears in MDM. + */ + @JsonProperty(value = "internalName") + private String internalName; + + /** + * A Boolean flag indicating whether this dimension should be included for + * the shoebox export scenario. + */ + @JsonProperty(value = "toBeExportedForShoebox") + private Boolean toBeExportedForShoebox; + + /** + * Get the public facing name of the dimension. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the public facing name of the dimension. + * + * @param name the name value to set + * @return the Dimension object itself. + */ + public Dimension withName(String name) { + this.name = name; + return this; + } + + /** + * Get localized friendly display name of the dimension. + * + * @return the displayName value + */ + public String displayName() { + return this.displayName; + } + + /** + * Set localized friendly display name of the dimension. + * + * @param displayName the displayName value to set + * @return the Dimension object itself. + */ + public Dimension withDisplayName(String displayName) { + this.displayName = displayName; + return this; + } + + /** + * Get name of the dimension as it appears in MDM. + * + * @return the internalName value + */ + public String internalName() { + return this.internalName; + } + + /** + * Set name of the dimension as it appears in MDM. + * + * @param internalName the internalName value to set + * @return the Dimension object itself. + */ + public Dimension withInternalName(String internalName) { + this.internalName = internalName; + return this; + } + + /** + * Get a Boolean flag indicating whether this dimension should be included for the shoebox export scenario. + * + * @return the toBeExportedForShoebox value + */ + public Boolean toBeExportedForShoebox() { + return this.toBeExportedForShoebox; + } + + /** + * Set a Boolean flag indicating whether this dimension should be included for the shoebox export scenario. + * + * @param toBeExportedForShoebox the toBeExportedForShoebox value to set + * @return the Dimension object itself. + */ + public Dimension withToBeExportedForShoebox(Boolean toBeExportedForShoebox) { + this.toBeExportedForShoebox = toBeExportedForShoebox; + return this; + } + +} diff --git a/signalr/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/signalr/v2018_10_01/KeyType.java b/signalr/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/signalr/v2018_10_01/KeyType.java new file mode 100644 index 000000000000..c777183b2036 --- /dev/null +++ b/signalr/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/signalr/v2018_10_01/KeyType.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.signalr.v2018_10_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for KeyType. + */ +public final class KeyType extends ExpandableStringEnum { + /** Static value Primary for KeyType. */ + public static final KeyType PRIMARY = fromString("Primary"); + + /** Static value Secondary for KeyType. */ + public static final KeyType SECONDARY = fromString("Secondary"); + + /** + * Creates or finds a KeyType from its string representation. + * @param name a name to look for + * @return the corresponding KeyType + */ + @JsonCreator + public static KeyType fromString(String name) { + return fromString(name, KeyType.class); + } + + /** + * @return known KeyType values + */ + public static Collection values() { + return values(KeyType.class); + } +} diff --git a/signalr/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/signalr/v2018_10_01/MetricSpecification.java b/signalr/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/signalr/v2018_10_01/MetricSpecification.java new file mode 100644 index 000000000000..2dbdc5777158 --- /dev/null +++ b/signalr/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/signalr/v2018_10_01/MetricSpecification.java @@ -0,0 +1,237 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.signalr.v2018_10_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Specifications of the Metrics for Azure Monitoring. + */ +public class MetricSpecification { + /** + * Name of the metric. + */ + @JsonProperty(value = "name") + private String name; + + /** + * Localized friendly display name of the metric. + */ + @JsonProperty(value = "displayName") + private String displayName; + + /** + * Localized friendly description of the metric. + */ + @JsonProperty(value = "displayDescription") + private String displayDescription; + + /** + * The unit that makes sense for the metric. + */ + @JsonProperty(value = "unit") + private String unit; + + /** + * Only provide one value for this field. Valid values: Average, Minimum, + * Maximum, Total, Count. + */ + @JsonProperty(value = "aggregationType") + private String aggregationType; + + /** + * Optional. If set to true, then zero will be returned for time duration + * where no metric is emitted/published. + * Ex. a metric that returns the number of times a particular error code + * was emitted. The error code may not appear + * often, instead of the RP publishing 0, Shoebox can auto fill in 0s for + * time periods where nothing was emitted. + */ + @JsonProperty(value = "fillGapWithZero") + private String fillGapWithZero; + + /** + * The name of the metric category that the metric belongs to. A metric can + * only belong to a single category. + */ + @JsonProperty(value = "category") + private String category; + + /** + * The dimensions of the metrics. + */ + @JsonProperty(value = "dimensions") + private List dimensions; + + /** + * Get name of the metric. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set name of the metric. + * + * @param name the name value to set + * @return the MetricSpecification object itself. + */ + public MetricSpecification withName(String name) { + this.name = name; + return this; + } + + /** + * Get localized friendly display name of the metric. + * + * @return the displayName value + */ + public String displayName() { + return this.displayName; + } + + /** + * Set localized friendly display name of the metric. + * + * @param displayName the displayName value to set + * @return the MetricSpecification object itself. + */ + public MetricSpecification withDisplayName(String displayName) { + this.displayName = displayName; + return this; + } + + /** + * Get localized friendly description of the metric. + * + * @return the displayDescription value + */ + public String displayDescription() { + return this.displayDescription; + } + + /** + * Set localized friendly description of the metric. + * + * @param displayDescription the displayDescription value to set + * @return the MetricSpecification object itself. + */ + public MetricSpecification withDisplayDescription(String displayDescription) { + this.displayDescription = displayDescription; + return this; + } + + /** + * Get the unit that makes sense for the metric. + * + * @return the unit value + */ + public String unit() { + return this.unit; + } + + /** + * Set the unit that makes sense for the metric. + * + * @param unit the unit value to set + * @return the MetricSpecification object itself. + */ + public MetricSpecification withUnit(String unit) { + this.unit = unit; + return this; + } + + /** + * Get only provide one value for this field. Valid values: Average, Minimum, Maximum, Total, Count. + * + * @return the aggregationType value + */ + public String aggregationType() { + return this.aggregationType; + } + + /** + * Set only provide one value for this field. Valid values: Average, Minimum, Maximum, Total, Count. + * + * @param aggregationType the aggregationType value to set + * @return the MetricSpecification object itself. + */ + public MetricSpecification withAggregationType(String aggregationType) { + this.aggregationType = aggregationType; + return this; + } + + /** + * Get optional. If set to true, then zero will be returned for time duration where no metric is emitted/published. + Ex. a metric that returns the number of times a particular error code was emitted. The error code may not appear + often, instead of the RP publishing 0, Shoebox can auto fill in 0s for time periods where nothing was emitted. + * + * @return the fillGapWithZero value + */ + public String fillGapWithZero() { + return this.fillGapWithZero; + } + + /** + * Set optional. If set to true, then zero will be returned for time duration where no metric is emitted/published. + Ex. a metric that returns the number of times a particular error code was emitted. The error code may not appear + often, instead of the RP publishing 0, Shoebox can auto fill in 0s for time periods where nothing was emitted. + * + * @param fillGapWithZero the fillGapWithZero value to set + * @return the MetricSpecification object itself. + */ + public MetricSpecification withFillGapWithZero(String fillGapWithZero) { + this.fillGapWithZero = fillGapWithZero; + return this; + } + + /** + * Get the name of the metric category that the metric belongs to. A metric can only belong to a single category. + * + * @return the category value + */ + public String category() { + return this.category; + } + + /** + * Set the name of the metric category that the metric belongs to. A metric can only belong to a single category. + * + * @param category the category value to set + * @return the MetricSpecification object itself. + */ + public MetricSpecification withCategory(String category) { + this.category = category; + return this; + } + + /** + * Get the dimensions of the metrics. + * + * @return the dimensions value + */ + public List dimensions() { + return this.dimensions; + } + + /** + * Set the dimensions of the metrics. + * + * @param dimensions the dimensions value to set + * @return the MetricSpecification object itself. + */ + public MetricSpecification withDimensions(List dimensions) { + this.dimensions = dimensions; + return this; + } + +} diff --git a/signalr/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/signalr/v2018_10_01/NameAvailability.java b/signalr/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/signalr/v2018_10_01/NameAvailability.java new file mode 100644 index 000000000000..d63103b27011 --- /dev/null +++ b/signalr/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/signalr/v2018_10_01/NameAvailability.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.signalr.v2018_10_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.signalr.v2018_10_01.implementation.SignalRServiceManager; +import com.microsoft.azure.management.signalr.v2018_10_01.implementation.NameAvailabilityInner; + +/** + * Type representing NameAvailability. + */ +public interface NameAvailability extends HasInner, HasManager { + /** + * @return the message value. + */ + String message(); + + /** + * @return the nameAvailable value. + */ + Boolean nameAvailable(); + + /** + * @return the reason value. + */ + String reason(); + +} diff --git a/signalr/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/signalr/v2018_10_01/NameAvailabilityParameters.java b/signalr/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/signalr/v2018_10_01/NameAvailabilityParameters.java new file mode 100644 index 000000000000..6d0d76d1f5d6 --- /dev/null +++ b/signalr/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/signalr/v2018_10_01/NameAvailabilityParameters.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.signalr.v2018_10_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Data POST-ed to the nameAvailability action. + */ +public class NameAvailabilityParameters { + /** + * The resource type. Should be always "Microsoft.SignalRService/SignalR". + */ + @JsonProperty(value = "type", required = true) + private String type; + + /** + * The SignalR service name to validate. e.g."my-signalR-name-here". + */ + @JsonProperty(value = "name", required = true) + private String name; + + /** + * Get the resource type. Should be always "Microsoft.SignalRService/SignalR". + * + * @return the type value + */ + public String type() { + return this.type; + } + + /** + * Set the resource type. Should be always "Microsoft.SignalRService/SignalR". + * + * @param type the type value to set + * @return the NameAvailabilityParameters object itself. + */ + public NameAvailabilityParameters withType(String type) { + this.type = type; + return this; + } + + /** + * Get the SignalR service name to validate. e.g."my-signalR-name-here". + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the SignalR service name to validate. e.g."my-signalR-name-here". + * + * @param name the name value to set + * @return the NameAvailabilityParameters object itself. + */ + public NameAvailabilityParameters withName(String name) { + this.name = name; + return this; + } + +} diff --git a/signalr/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/signalr/v2018_10_01/Operation.java b/signalr/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/signalr/v2018_10_01/Operation.java new file mode 100644 index 000000000000..5a3a86492dee --- /dev/null +++ b/signalr/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/signalr/v2018_10_01/Operation.java @@ -0,0 +1,40 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.signalr.v2018_10_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.signalr.v2018_10_01.implementation.SignalRServiceManager; +import com.microsoft.azure.management.signalr.v2018_10_01.implementation.OperationInner; + +/** + * Type representing Operation. + */ +public interface Operation extends HasInner, HasManager { + /** + * @return the display value. + */ + OperationDisplay display(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the origin value. + */ + String origin(); + + /** + * @return the properties value. + */ + OperationProperties properties(); + +} diff --git a/signalr/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/signalr/v2018_10_01/OperationDisplay.java b/signalr/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/signalr/v2018_10_01/OperationDisplay.java new file mode 100644 index 000000000000..3c907bb1251a --- /dev/null +++ b/signalr/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/signalr/v2018_10_01/OperationDisplay.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.signalr.v2018_10_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The object that describes a operation. + */ +public class OperationDisplay { + /** + * Friendly name of the resource provider. + */ + @JsonProperty(value = "provider") + private String provider; + + /** + * Resource type on which the operation is performed. + */ + @JsonProperty(value = "resource") + private String resource; + + /** + * The localized friendly name for the operation. + */ + @JsonProperty(value = "operation") + private String operation; + + /** + * The localized friendly description for the operation. + */ + @JsonProperty(value = "description") + private String description; + + /** + * Get friendly name of the resource provider. + * + * @return the provider value + */ + public String provider() { + return this.provider; + } + + /** + * Set friendly name of the resource provider. + * + * @param provider the provider value to set + * @return the OperationDisplay object itself. + */ + public OperationDisplay withProvider(String provider) { + this.provider = provider; + return this; + } + + /** + * Get resource type on which the operation is performed. + * + * @return the resource value + */ + public String resource() { + return this.resource; + } + + /** + * Set resource type on which the operation is performed. + * + * @param resource the resource value to set + * @return the OperationDisplay object itself. + */ + public OperationDisplay withResource(String resource) { + this.resource = resource; + return this; + } + + /** + * Get the localized friendly name for the operation. + * + * @return the operation value + */ + public String operation() { + return this.operation; + } + + /** + * Set the localized friendly name for the operation. + * + * @param operation the operation value to set + * @return the OperationDisplay object itself. + */ + public OperationDisplay withOperation(String operation) { + this.operation = operation; + return this; + } + + /** + * Get the localized friendly description for the operation. + * + * @return the description value + */ + public String description() { + return this.description; + } + + /** + * Set the localized friendly description for the operation. + * + * @param description the description value to set + * @return the OperationDisplay object itself. + */ + public OperationDisplay withDescription(String description) { + this.description = description; + return this; + } + +} diff --git a/signalr/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/signalr/v2018_10_01/OperationProperties.java b/signalr/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/signalr/v2018_10_01/OperationProperties.java new file mode 100644 index 000000000000..cf8e26d552cf --- /dev/null +++ b/signalr/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/signalr/v2018_10_01/OperationProperties.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.signalr.v2018_10_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Extra Operation properties. + */ +public class OperationProperties { + /** + * The service specifications. + */ + @JsonProperty(value = "serviceSpecification") + private ServiceSpecification serviceSpecification; + + /** + * Get the service specifications. + * + * @return the serviceSpecification value + */ + public ServiceSpecification serviceSpecification() { + return this.serviceSpecification; + } + + /** + * Set the service specifications. + * + * @param serviceSpecification the serviceSpecification value to set + * @return the OperationProperties object itself. + */ + public OperationProperties withServiceSpecification(ServiceSpecification serviceSpecification) { + this.serviceSpecification = serviceSpecification; + return this; + } + +} diff --git a/signalr/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/signalr/v2018_10_01/Operations.java b/signalr/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/signalr/v2018_10_01/Operations.java new file mode 100644 index 000000000000..a2578ae3c1bd --- /dev/null +++ b/signalr/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/signalr/v2018_10_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.signalr.v2018_10_01; + +import rx.Observable; +import com.microsoft.azure.management.signalr.v2018_10_01.implementation.OperationsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing Operations. + */ +public interface Operations extends HasInner { + /** + * Lists all of the available REST API operations of the Microsoft.SignalRService provider. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(); + +} diff --git a/signalr/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/signalr/v2018_10_01/ProvisioningState.java b/signalr/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/signalr/v2018_10_01/ProvisioningState.java new file mode 100644 index 000000000000..7690d6b0f0f4 --- /dev/null +++ b/signalr/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/signalr/v2018_10_01/ProvisioningState.java @@ -0,0 +1,62 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.signalr.v2018_10_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for ProvisioningState. + */ +public final class ProvisioningState extends ExpandableStringEnum { + /** Static value Unknown for ProvisioningState. */ + public static final ProvisioningState UNKNOWN = fromString("Unknown"); + + /** Static value Succeeded for ProvisioningState. */ + public static final ProvisioningState SUCCEEDED = fromString("Succeeded"); + + /** Static value Failed for ProvisioningState. */ + public static final ProvisioningState FAILED = fromString("Failed"); + + /** Static value Canceled for ProvisioningState. */ + public static final ProvisioningState CANCELED = fromString("Canceled"); + + /** Static value Running for ProvisioningState. */ + public static final ProvisioningState RUNNING = fromString("Running"); + + /** Static value Creating for ProvisioningState. */ + public static final ProvisioningState CREATING = fromString("Creating"); + + /** Static value Updating for ProvisioningState. */ + public static final ProvisioningState UPDATING = fromString("Updating"); + + /** Static value Deleting for ProvisioningState. */ + public static final ProvisioningState DELETING = fromString("Deleting"); + + /** Static value Moving for ProvisioningState. */ + public static final ProvisioningState MOVING = fromString("Moving"); + + /** + * Creates or finds a ProvisioningState from its string representation. + * @param name a name to look for + * @return the corresponding ProvisioningState + */ + @JsonCreator + public static ProvisioningState fromString(String name) { + return fromString(name, ProvisioningState.class); + } + + /** + * @return known ProvisioningState values + */ + public static Collection values() { + return values(ProvisioningState.class); + } +} diff --git a/signalr/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/signalr/v2018_10_01/RegenerateKeyParameters.java b/signalr/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/signalr/v2018_10_01/RegenerateKeyParameters.java new file mode 100644 index 000000000000..d619d17aa442 --- /dev/null +++ b/signalr/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/signalr/v2018_10_01/RegenerateKeyParameters.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.signalr.v2018_10_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Parameters describes the request to regenerate access keys. + */ +public class RegenerateKeyParameters { + /** + * The keyType to regenerate. Must be either 'primary' or + * 'secondary'(case-insensitive). Possible values include: 'Primary', + * 'Secondary'. + */ + @JsonProperty(value = "keyType") + private KeyType keyType; + + /** + * Get the keyType to regenerate. Must be either 'primary' or 'secondary'(case-insensitive). Possible values include: 'Primary', 'Secondary'. + * + * @return the keyType value + */ + public KeyType keyType() { + return this.keyType; + } + + /** + * Set the keyType to regenerate. Must be either 'primary' or 'secondary'(case-insensitive). Possible values include: 'Primary', 'Secondary'. + * + * @param keyType the keyType value to set + * @return the RegenerateKeyParameters object itself. + */ + public RegenerateKeyParameters withKeyType(KeyType keyType) { + this.keyType = keyType; + return this; + } + +} diff --git a/signalr/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/signalr/v2018_10_01/ResourceSku.java b/signalr/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/signalr/v2018_10_01/ResourceSku.java new file mode 100644 index 000000000000..f53f19503317 --- /dev/null +++ b/signalr/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/signalr/v2018_10_01/ResourceSku.java @@ -0,0 +1,156 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.signalr.v2018_10_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The billing information of the resource.(e.g. basic vs. standard). + */ +public class ResourceSku { + /** + * The name of the SKU. This is typically a letter + number code, such as + * A0 or P3. Required (if sku is specified). + */ + @JsonProperty(value = "name", required = true) + private String name; + + /** + * Optional tier of this particular SKU. `Basic` is deprecated, use + * `Standard` instead for Basic tier. Possible values include: 'Free', + * 'Basic', 'Standard', 'Premium'. + */ + @JsonProperty(value = "tier") + private SignalRSkuTier tier; + + /** + * Optional, string. When the name field is the combination of tier and + * some other value, this would be the standalone code. + */ + @JsonProperty(value = "size") + private String size; + + /** + * Optional, string. If the service has different generations of hardware, + * for the same SKU, then that can be captured here. + */ + @JsonProperty(value = "family") + private String family; + + /** + * Optional, integer. If the SKU supports scale out/in then the capacity + * integer should be included. If scale out/in is not + * possible for the resource this may be omitted. + */ + @JsonProperty(value = "capacity") + private Integer capacity; + + /** + * Get the name of the SKU. This is typically a letter + number code, such as A0 or P3. Required (if sku is specified). + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name of the SKU. This is typically a letter + number code, such as A0 or P3. Required (if sku is specified). + * + * @param name the name value to set + * @return the ResourceSku object itself. + */ + public ResourceSku withName(String name) { + this.name = name; + return this; + } + + /** + * Get optional tier of this particular SKU. `Basic` is deprecated, use `Standard` instead for Basic tier. Possible values include: 'Free', 'Basic', 'Standard', 'Premium'. + * + * @return the tier value + */ + public SignalRSkuTier tier() { + return this.tier; + } + + /** + * Set optional tier of this particular SKU. `Basic` is deprecated, use `Standard` instead for Basic tier. Possible values include: 'Free', 'Basic', 'Standard', 'Premium'. + * + * @param tier the tier value to set + * @return the ResourceSku object itself. + */ + public ResourceSku withTier(SignalRSkuTier tier) { + this.tier = tier; + return this; + } + + /** + * Get optional, string. When the name field is the combination of tier and some other value, this would be the standalone code. + * + * @return the size value + */ + public String size() { + return this.size; + } + + /** + * Set optional, string. When the name field is the combination of tier and some other value, this would be the standalone code. + * + * @param size the size value to set + * @return the ResourceSku object itself. + */ + public ResourceSku withSize(String size) { + this.size = size; + return this; + } + + /** + * Get optional, string. If the service has different generations of hardware, for the same SKU, then that can be captured here. + * + * @return the family value + */ + public String family() { + return this.family; + } + + /** + * Set optional, string. If the service has different generations of hardware, for the same SKU, then that can be captured here. + * + * @param family the family value to set + * @return the ResourceSku object itself. + */ + public ResourceSku withFamily(String family) { + this.family = family; + return this; + } + + /** + * Get optional, integer. If the SKU supports scale out/in then the capacity integer should be included. If scale out/in is not + possible for the resource this may be omitted. + * + * @return the capacity value + */ + public Integer capacity() { + return this.capacity; + } + + /** + * Set optional, integer. If the SKU supports scale out/in then the capacity integer should be included. If scale out/in is not + possible for the resource this may be omitted. + * + * @param capacity the capacity value to set + * @return the ResourceSku object itself. + */ + public ResourceSku withCapacity(Integer capacity) { + this.capacity = capacity; + return this; + } + +} diff --git a/signalr/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/signalr/v2018_10_01/ServiceSpecification.java b/signalr/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/signalr/v2018_10_01/ServiceSpecification.java new file mode 100644 index 000000000000..91198028db82 --- /dev/null +++ b/signalr/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/signalr/v2018_10_01/ServiceSpecification.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.signalr.v2018_10_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * An object that describes a specification. + */ +public class ServiceSpecification { + /** + * Specifications of the Metrics for Azure Monitoring. + */ + @JsonProperty(value = "metricSpecifications") + private List metricSpecifications; + + /** + * Get specifications of the Metrics for Azure Monitoring. + * + * @return the metricSpecifications value + */ + public List metricSpecifications() { + return this.metricSpecifications; + } + + /** + * Set specifications of the Metrics for Azure Monitoring. + * + * @param metricSpecifications the metricSpecifications value to set + * @return the ServiceSpecification object itself. + */ + public ServiceSpecification withMetricSpecifications(List metricSpecifications) { + this.metricSpecifications = metricSpecifications; + return this; + } + +} diff --git a/signalr/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/signalr/v2018_10_01/SignalRCreateOrUpdateProperties.java b/signalr/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/signalr/v2018_10_01/SignalRCreateOrUpdateProperties.java new file mode 100644 index 000000000000..ba4ad5ecff64 --- /dev/null +++ b/signalr/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/signalr/v2018_10_01/SignalRCreateOrUpdateProperties.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.signalr.v2018_10_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Settings used to provision or configure the resource. + */ +public class SignalRCreateOrUpdateProperties { + /** + * Prefix for the hostName of the SignalR service. Retained for future use. + * The hostname will be of format: + * &lt;hostNamePrefix&gt;.service.signalr.net. + */ + @JsonProperty(value = "hostNamePrefix") + private String hostNamePrefix; + + /** + * Get prefix for the hostName of the SignalR service. Retained for future use. + The hostname will be of format: &lt;hostNamePrefix&gt;.service.signalr.net. + * + * @return the hostNamePrefix value + */ + public String hostNamePrefix() { + return this.hostNamePrefix; + } + + /** + * Set prefix for the hostName of the SignalR service. Retained for future use. + The hostname will be of format: &lt;hostNamePrefix&gt;.service.signalr.net. + * + * @param hostNamePrefix the hostNamePrefix value to set + * @return the SignalRCreateOrUpdateProperties object itself. + */ + public SignalRCreateOrUpdateProperties withHostNamePrefix(String hostNamePrefix) { + this.hostNamePrefix = hostNamePrefix; + return this; + } + +} diff --git a/signalr/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/signalr/v2018_10_01/SignalRCreateParameters.java b/signalr/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/signalr/v2018_10_01/SignalRCreateParameters.java new file mode 100644 index 000000000000..e73f20492c62 --- /dev/null +++ b/signalr/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/signalr/v2018_10_01/SignalRCreateParameters.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.signalr.v2018_10_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Parameters for SignalR service create/update operation. + * + * Keep the same schema as AzSignalR.Models.SignalRResource. + */ +public class SignalRCreateParameters extends SignalRUpdateParameters { + /** + * Azure GEO region: e.g. West US | East US | North Central US | South + * Central US | West Europe | North Europe | East Asia | Southeast Asia | + * etc. + * The geo region of a resource never changes after it is created. + */ + @JsonProperty(value = "location", required = true) + private String location; + + /** + * Get azure GEO region: e.g. West US | East US | North Central US | South Central US | West Europe | North Europe | East Asia | Southeast Asia | etc. + The geo region of a resource never changes after it is created. + * + * @return the location value + */ + public String location() { + return this.location; + } + + /** + * Set azure GEO region: e.g. West US | East US | North Central US | South Central US | West Europe | North Europe | East Asia | Southeast Asia | etc. + The geo region of a resource never changes after it is created. + * + * @param location the location value to set + * @return the SignalRCreateParameters object itself. + */ + public SignalRCreateParameters withLocation(String location) { + this.location = location; + return this; + } + +} diff --git a/signalr/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/signalr/v2018_10_01/SignalRKeys.java b/signalr/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/signalr/v2018_10_01/SignalRKeys.java new file mode 100644 index 000000000000..d297b5d80ec7 --- /dev/null +++ b/signalr/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/signalr/v2018_10_01/SignalRKeys.java @@ -0,0 +1,40 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.signalr.v2018_10_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.signalr.v2018_10_01.implementation.SignalRServiceManager; +import com.microsoft.azure.management.signalr.v2018_10_01.implementation.SignalRKeysInner; + +/** + * Type representing SignalRKeys. + */ +public interface SignalRKeys extends HasInner, HasManager { + /** + * @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/signalr/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/signalr/v2018_10_01/SignalRResource.java b/signalr/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/signalr/v2018_10_01/SignalRResource.java new file mode 100644 index 000000000000..0cdbd389a77d --- /dev/null +++ b/signalr/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/signalr/v2018_10_01/SignalRResource.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.signalr.v2018_10_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.signalr.v2018_10_01.implementation.SignalRServiceManager; +import com.microsoft.azure.management.signalr.v2018_10_01.implementation.SignalRResourceInner; +import java.util.Map; + +/** + * Type representing SignalRResource. + */ +public interface SignalRResource extends HasInner, HasManager { + /** + * @return the externalIP value. + */ + String externalIP(); + + /** + * @return the hostName value. + */ + String hostName(); + + /** + * @return the hostNamePrefix value. + */ + String hostNamePrefix(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the location value. + */ + String location(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * @return the publicPort value. + */ + Integer publicPort(); + + /** + * @return the serverPort value. + */ + Integer serverPort(); + + /** + * @return the sku value. + */ + ResourceSku sku(); + + /** + * @return the tags value. + */ + Map tags(); + + /** + * @return the type value. + */ + String type(); + + /** + * @return the version value. + */ + String version(); + +} diff --git a/signalr/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/signalr/v2018_10_01/SignalRSkuTier.java b/signalr/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/signalr/v2018_10_01/SignalRSkuTier.java new file mode 100644 index 000000000000..420bd3513753 --- /dev/null +++ b/signalr/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/signalr/v2018_10_01/SignalRSkuTier.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.signalr.v2018_10_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for SignalRSkuTier. + */ +public final class SignalRSkuTier extends ExpandableStringEnum { + /** Static value Free for SignalRSkuTier. */ + public static final SignalRSkuTier FREE = fromString("Free"); + + /** Static value Basic for SignalRSkuTier. */ + public static final SignalRSkuTier BASIC = fromString("Basic"); + + /** Static value Standard for SignalRSkuTier. */ + public static final SignalRSkuTier STANDARD = fromString("Standard"); + + /** Static value Premium for SignalRSkuTier. */ + public static final SignalRSkuTier PREMIUM = fromString("Premium"); + + /** + * Creates or finds a SignalRSkuTier from its string representation. + * @param name a name to look for + * @return the corresponding SignalRSkuTier + */ + @JsonCreator + public static SignalRSkuTier fromString(String name) { + return fromString(name, SignalRSkuTier.class); + } + + /** + * @return known SignalRSkuTier values + */ + public static Collection values() { + return values(SignalRSkuTier.class); + } +} diff --git a/signalr/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/signalr/v2018_10_01/SignalRUpdateParameters.java b/signalr/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/signalr/v2018_10_01/SignalRUpdateParameters.java new file mode 100644 index 000000000000..e306b3c0a5dd --- /dev/null +++ b/signalr/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/signalr/v2018_10_01/SignalRUpdateParameters.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.signalr.v2018_10_01; + +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Parameters for SignalR service update operation. + */ +public class SignalRUpdateParameters { + /** + * A list of key value pairs that describe the resource. + */ + @JsonProperty(value = "tags") + private Map tags; + + /** + * The billing information of the resource.(e.g. basic vs. standard). + */ + @JsonProperty(value = "sku") + private ResourceSku sku; + + /** + * Settings used to provision or configure the resource. + */ + @JsonProperty(value = "properties") + private SignalRCreateOrUpdateProperties properties; + + /** + * Get a list of key value pairs that describe the resource. + * + * @return the tags value + */ + public Map tags() { + return this.tags; + } + + /** + * Set a list of key value pairs that describe the resource. + * + * @param tags the tags value to set + * @return the SignalRUpdateParameters object itself. + */ + public SignalRUpdateParameters withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Get the billing information of the resource.(e.g. basic vs. standard). + * + * @return the sku value + */ + public ResourceSku sku() { + return this.sku; + } + + /** + * Set the billing information of the resource.(e.g. basic vs. standard). + * + * @param sku the sku value to set + * @return the SignalRUpdateParameters object itself. + */ + public SignalRUpdateParameters withSku(ResourceSku sku) { + this.sku = sku; + return this; + } + + /** + * Get settings used to provision or configure the resource. + * + * @return the properties value + */ + public SignalRCreateOrUpdateProperties properties() { + return this.properties; + } + + /** + * Set settings used to provision or configure the resource. + * + * @param properties the properties value to set + * @return the SignalRUpdateParameters object itself. + */ + public SignalRUpdateParameters withProperties(SignalRCreateOrUpdateProperties properties) { + this.properties = properties; + return this; + } + +} diff --git a/signalr/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/signalr/v2018_10_01/SignalRUsage.java b/signalr/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/signalr/v2018_10_01/SignalRUsage.java new file mode 100644 index 000000000000..06ee3c348d0d --- /dev/null +++ b/signalr/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/signalr/v2018_10_01/SignalRUsage.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.signalr.v2018_10_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.signalr.v2018_10_01.implementation.SignalRUsageInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.signalr.v2018_10_01.implementation.SignalRServiceManager; + +/** + * Type representing SignalRUsage. + */ +public interface SignalRUsage extends HasInner, HasManager { + /** + * @return the currentValue value. + */ + Long currentValue(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the limit value. + */ + Long limit(); + + /** + * @return the name value. + */ + SignalRUsageName name(); + + /** + * @return the unit value. + */ + String unit(); + +} diff --git a/signalr/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/signalr/v2018_10_01/SignalRUsageName.java b/signalr/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/signalr/v2018_10_01/SignalRUsageName.java new file mode 100644 index 000000000000..623a1e988855 --- /dev/null +++ b/signalr/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/signalr/v2018_10_01/SignalRUsageName.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.signalr.v2018_10_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Localizable String object containing the name and a localized value. + */ +public class SignalRUsageName { + /** + * The indentifier of the usage. + */ + @JsonProperty(value = "value") + private String value; + + /** + * Localized name of the usage. + */ + @JsonProperty(value = "localizedValue") + private String localizedValue; + + /** + * Get the indentifier of the usage. + * + * @return the value value + */ + public String value() { + return this.value; + } + + /** + * Set the indentifier of the usage. + * + * @param value the value value to set + * @return the SignalRUsageName object itself. + */ + public SignalRUsageName withValue(String value) { + this.value = value; + return this; + } + + /** + * Get localized name of the usage. + * + * @return the localizedValue value + */ + public String localizedValue() { + return this.localizedValue; + } + + /** + * Set localized name of the usage. + * + * @param localizedValue the localizedValue value to set + * @return the SignalRUsageName object itself. + */ + public SignalRUsageName withLocalizedValue(String localizedValue) { + this.localizedValue = localizedValue; + return this; + } + +} diff --git a/signalr/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/signalr/v2018_10_01/SignalRs.java b/signalr/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/signalr/v2018_10_01/SignalRs.java new file mode 100644 index 000000000000..01eb2fe0771e --- /dev/null +++ b/signalr/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/signalr/v2018_10_01/SignalRs.java @@ -0,0 +1,104 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.signalr.v2018_10_01; + +import rx.Observable; +import rx.Completable; + +/** + * Type representing SignalRs. + */ +public interface SignalRs { + /** + * Checks that the SignalR name is valid and is not already in use. + * + * @param location the region + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable checkNameAvailabilityAsync(String location); + + /** + * Get the access keys of the SignalR resource. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param resourceName The name of the SignalR resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listKeysAsync(String resourceGroupName, String resourceName); + + /** + * Regenerate SignalR service access key. PrimaryKey and SecondaryKey cannot be regenerated at the same time. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param resourceName The name of the SignalR resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable regenerateKeyAsync(String resourceGroupName, String resourceName); + + /** + * Get the SignalR service and its properties. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param resourceName The name of the SignalR resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getByResourceGroupAsync(String resourceGroupName, String resourceName); + + /** + * Create a new SignalR service and update an exiting SignalR service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param resourceName The name of the SignalR resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable createOrUpdateAsync(String resourceGroupName, String resourceName); + + /** + * Operation to delete a SignalR service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param resourceName The name of the SignalR resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable deleteAsync(String resourceGroupName, String resourceName); + + /** + * Operation to update an exiting SignalR service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param resourceName The name of the SignalR resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable updateAsync(String resourceGroupName, String resourceName); + + /** + * Handles requests to list all resources in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(); + + /** + * Handles requests to list all resources in a resource group. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listByResourceGroupAsync(final String resourceGroupName); + +} diff --git a/signalr/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/signalr/v2018_10_01/Usages.java b/signalr/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/signalr/v2018_10_01/Usages.java new file mode 100644 index 000000000000..b334c0390547 --- /dev/null +++ b/signalr/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/signalr/v2018_10_01/Usages.java @@ -0,0 +1,28 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.signalr.v2018_10_01; + +import rx.Observable; +import com.microsoft.azure.management.signalr.v2018_10_01.implementation.UsagesInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing Usages. + */ +public interface Usages extends HasInner { + /** + * List usage quotas for Azure SignalR service by location. + * + * @param location the location like "eastus" + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(final String location); + +} diff --git a/signalr/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/signalr/v2018_10_01/implementation/IdParsingUtils.java b/signalr/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/signalr/v2018_10_01/implementation/IdParsingUtils.java new file mode 100644 index 000000000000..7593095d432b --- /dev/null +++ b/signalr/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/signalr/v2018_10_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.signalr.v2018_10_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/signalr/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/signalr/v2018_10_01/implementation/NameAvailabilityImpl.java b/signalr/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/signalr/v2018_10_01/implementation/NameAvailabilityImpl.java new file mode 100644 index 000000000000..8c6768c159f5 --- /dev/null +++ b/signalr/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/signalr/v2018_10_01/implementation/NameAvailabilityImpl.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.signalr.v2018_10_01.implementation; + +import com.microsoft.azure.management.signalr.v2018_10_01.NameAvailability; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; + +class NameAvailabilityImpl extends WrapperImpl implements NameAvailability { + private final SignalRServiceManager manager; + NameAvailabilityImpl(NameAvailabilityInner inner, SignalRServiceManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public SignalRServiceManager manager() { + return this.manager; + } + + @Override + public String message() { + return this.inner().message(); + } + + @Override + public Boolean nameAvailable() { + return this.inner().nameAvailable(); + } + + @Override + public String reason() { + return this.inner().reason(); + } + +} diff --git a/signalr/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/signalr/v2018_10_01/implementation/NameAvailabilityInner.java b/signalr/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/signalr/v2018_10_01/implementation/NameAvailabilityInner.java new file mode 100644 index 000000000000..a998a34c77ef --- /dev/null +++ b/signalr/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/signalr/v2018_10_01/implementation/NameAvailabilityInner.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.signalr.v2018_10_01.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Result of the request to check name availability. It contains a flag and + * possible reason of failure. + */ +public class NameAvailabilityInner { + /** + * Indicates whether the name is available or not. + */ + @JsonProperty(value = "nameAvailable") + private Boolean nameAvailable; + + /** + * The reason of the availability. Required if name is not available. + */ + @JsonProperty(value = "reason") + private String reason; + + /** + * The message of the operation. + */ + @JsonProperty(value = "message") + private String message; + + /** + * Get indicates whether the name is available or not. + * + * @return the nameAvailable value + */ + public Boolean nameAvailable() { + return this.nameAvailable; + } + + /** + * Set indicates whether the name is available or not. + * + * @param nameAvailable the nameAvailable value to set + * @return the NameAvailabilityInner object itself. + */ + public NameAvailabilityInner withNameAvailable(Boolean nameAvailable) { + this.nameAvailable = nameAvailable; + return this; + } + + /** + * Get the reason of the availability. Required if name is not available. + * + * @return the reason value + */ + public String reason() { + return this.reason; + } + + /** + * Set the reason of the availability. Required if name is not available. + * + * @param reason the reason value to set + * @return the NameAvailabilityInner object itself. + */ + public NameAvailabilityInner withReason(String reason) { + this.reason = reason; + return this; + } + + /** + * Get the message of the operation. + * + * @return the message value + */ + public String message() { + return this.message; + } + + /** + * Set the message of the operation. + * + * @param message the message value to set + * @return the NameAvailabilityInner object itself. + */ + public NameAvailabilityInner withMessage(String message) { + this.message = message; + return this; + } + +} diff --git a/signalr/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/signalr/v2018_10_01/implementation/OperationImpl.java b/signalr/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/signalr/v2018_10_01/implementation/OperationImpl.java new file mode 100644 index 000000000000..b45aa8930444 --- /dev/null +++ b/signalr/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/signalr/v2018_10_01/implementation/OperationImpl.java @@ -0,0 +1,48 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.signalr.v2018_10_01.implementation; + +import com.microsoft.azure.management.signalr.v2018_10_01.Operation; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.signalr.v2018_10_01.OperationDisplay; +import com.microsoft.azure.management.signalr.v2018_10_01.OperationProperties; + +class OperationImpl extends WrapperImpl implements Operation { + private final SignalRServiceManager manager; + OperationImpl(OperationInner inner, SignalRServiceManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public SignalRServiceManager manager() { + return this.manager; + } + + @Override + public OperationDisplay display() { + return this.inner().display(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public String origin() { + return this.inner().origin(); + } + + @Override + public OperationProperties properties() { + return this.inner().properties(); + } + +} diff --git a/signalr/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/signalr/v2018_10_01/implementation/OperationInner.java b/signalr/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/signalr/v2018_10_01/implementation/OperationInner.java new file mode 100644 index 000000000000..5a92aa05e8f4 --- /dev/null +++ b/signalr/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/signalr/v2018_10_01/implementation/OperationInner.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.signalr.v2018_10_01.implementation; + +import com.microsoft.azure.management.signalr.v2018_10_01.OperationDisplay; +import com.microsoft.azure.management.signalr.v2018_10_01.OperationProperties; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * REST API operation supported by SignalR resource provider. + */ +public class OperationInner { + /** + * Name of the operation with format: {provider}/{resource}/{operation}. + */ + @JsonProperty(value = "name") + private String name; + + /** + * The object that describes the operation. + */ + @JsonProperty(value = "display") + private OperationDisplay display; + + /** + * Optional. The intended executor of the operation; governs the display of + * the operation in the RBAC UX and the audit logs UX. + */ + @JsonProperty(value = "origin") + private String origin; + + /** + * Extra properties for the operation. + */ + @JsonProperty(value = "properties") + private OperationProperties properties; + + /** + * Get name of the operation with format: {provider}/{resource}/{operation}. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set name of the operation with format: {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 describes the operation. + * + * @return the display value + */ + public OperationDisplay display() { + return this.display; + } + + /** + * Set the object that describes the operation. + * + * @param display the display value to set + * @return the OperationInner object itself. + */ + public OperationInner withDisplay(OperationDisplay display) { + this.display = display; + return this; + } + + /** + * Get optional. The intended executor of the operation; governs the display of the operation in the RBAC UX and the audit logs UX. + * + * @return the origin value + */ + public String origin() { + return this.origin; + } + + /** + * Set optional. The intended executor of the operation; governs the display of the operation in the RBAC UX and the audit logs UX. + * + * @param origin the origin value to set + * @return the OperationInner object itself. + */ + public OperationInner withOrigin(String origin) { + this.origin = origin; + return this; + } + + /** + * Get extra properties for the operation. + * + * @return the properties value + */ + public OperationProperties properties() { + return this.properties; + } + + /** + * Set extra properties for the operation. + * + * @param properties the properties value to set + * @return the OperationInner object itself. + */ + public OperationInner withProperties(OperationProperties properties) { + this.properties = properties; + return this; + } + +} diff --git a/signalr/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/signalr/v2018_10_01/implementation/OperationsImpl.java b/signalr/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/signalr/v2018_10_01/implementation/OperationsImpl.java new file mode 100644 index 000000000000..64b3c156fd18 --- /dev/null +++ b/signalr/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/signalr/v2018_10_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.signalr.v2018_10_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.signalr.v2018_10_01.Operations; +import rx.functions.Func1; +import rx.Observable; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.signalr.v2018_10_01.Operation; + +class OperationsImpl extends WrapperImpl implements Operations { + private final SignalRServiceManager manager; + + OperationsImpl(SignalRServiceManager manager) { + super(manager.inner().operations()); + this.manager = manager; + } + + public SignalRServiceManager 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/signalr/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/signalr/v2018_10_01/implementation/OperationsInner.java b/signalr/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/signalr/v2018_10_01/implementation/OperationsInner.java new file mode 100644 index 000000000000..14e1c8e375cc --- /dev/null +++ b/signalr/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/signalr/v2018_10_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.signalr.v2018_10_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.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 SignalRManagementClientImpl 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, SignalRManagementClientImpl 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.signalr.v2018_10_01.Operations list" }) + @GET("providers/Microsoft.SignalRService/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.signalr.v2018_10_01.Operations listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Lists all of the available REST API operations of the Microsoft.SignalRService provider. + * + * @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<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 REST API operations of the Microsoft.SignalRService provider. + * + * @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 REST API operations of the Microsoft.SignalRService provider. + * + * @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 REST API operations of the Microsoft.SignalRService provider. + * + * @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 REST API operations of the Microsoft.SignalRService provider. + * + * @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 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 of the available REST API operations of the Microsoft.SignalRService provider. + * + * @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<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 REST API operations of the Microsoft.SignalRService provider. + * + * @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 REST API operations of the Microsoft.SignalRService provider. + * + * @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 REST API operations of the Microsoft.SignalRService provider. + * + * @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 REST API operations of the Microsoft.SignalRService provider. + * + 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 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/signalr/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/signalr/v2018_10_01/implementation/PageImpl.java b/signalr/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/signalr/v2018_10_01/implementation/PageImpl.java new file mode 100644 index 000000000000..0e845887c591 --- /dev/null +++ b/signalr/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/signalr/v2018_10_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.signalr.v2018_10_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/signalr/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/signalr/v2018_10_01/implementation/SignalRKeysImpl.java b/signalr/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/signalr/v2018_10_01/implementation/SignalRKeysImpl.java new file mode 100644 index 000000000000..e2d18e642289 --- /dev/null +++ b/signalr/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/signalr/v2018_10_01/implementation/SignalRKeysImpl.java @@ -0,0 +1,46 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.signalr.v2018_10_01.implementation; + +import com.microsoft.azure.management.signalr.v2018_10_01.SignalRKeys; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; + +class SignalRKeysImpl extends WrapperImpl implements SignalRKeys { + private final SignalRServiceManager manager; + SignalRKeysImpl(SignalRKeysInner inner, SignalRServiceManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public SignalRServiceManager manager() { + return this.manager; + } + + @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/signalr/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/signalr/v2018_10_01/implementation/SignalRKeysInner.java b/signalr/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/signalr/v2018_10_01/implementation/SignalRKeysInner.java new file mode 100644 index 000000000000..6253805f97e4 --- /dev/null +++ b/signalr/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/signalr/v2018_10_01/implementation/SignalRKeysInner.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.signalr.v2018_10_01.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * A class represents the access keys of SignalR service. + */ +public class SignalRKeysInner { + /** + * The primary access key. + */ + @JsonProperty(value = "primaryKey") + private String primaryKey; + + /** + * The secondary access key. + */ + @JsonProperty(value = "secondaryKey") + private String secondaryKey; + + /** + * SignalR connection string constructed via the primaryKey. + */ + @JsonProperty(value = "primaryConnectionString") + private String primaryConnectionString; + + /** + * SignalR connection string constructed via the secondaryKey. + */ + @JsonProperty(value = "secondaryConnectionString") + private String secondaryConnectionString; + + /** + * Get the primary access key. + * + * @return the primaryKey value + */ + public String primaryKey() { + return this.primaryKey; + } + + /** + * Set the primary access key. + * + * @param primaryKey the primaryKey value to set + * @return the SignalRKeysInner object itself. + */ + public SignalRKeysInner withPrimaryKey(String primaryKey) { + this.primaryKey = primaryKey; + return this; + } + + /** + * Get the secondary access key. + * + * @return the secondaryKey value + */ + public String secondaryKey() { + return this.secondaryKey; + } + + /** + * Set the secondary access key. + * + * @param secondaryKey the secondaryKey value to set + * @return the SignalRKeysInner object itself. + */ + public SignalRKeysInner withSecondaryKey(String secondaryKey) { + this.secondaryKey = secondaryKey; + return this; + } + + /** + * Get signalR connection string constructed via the primaryKey. + * + * @return the primaryConnectionString value + */ + public String primaryConnectionString() { + return this.primaryConnectionString; + } + + /** + * Set signalR connection string constructed via the primaryKey. + * + * @param primaryConnectionString the primaryConnectionString value to set + * @return the SignalRKeysInner object itself. + */ + public SignalRKeysInner withPrimaryConnectionString(String primaryConnectionString) { + this.primaryConnectionString = primaryConnectionString; + return this; + } + + /** + * Get signalR connection string constructed via the secondaryKey. + * + * @return the secondaryConnectionString value + */ + public String secondaryConnectionString() { + return this.secondaryConnectionString; + } + + /** + * Set signalR connection string constructed via the secondaryKey. + * + * @param secondaryConnectionString the secondaryConnectionString value to set + * @return the SignalRKeysInner object itself. + */ + public SignalRKeysInner withSecondaryConnectionString(String secondaryConnectionString) { + this.secondaryConnectionString = secondaryConnectionString; + return this; + } + +} diff --git a/signalr/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/signalr/v2018_10_01/implementation/SignalRManagementClientImpl.java b/signalr/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/signalr/v2018_10_01/implementation/SignalRManagementClientImpl.java new file mode 100644 index 000000000000..fe16102c5936 --- /dev/null +++ b/signalr/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/signalr/v2018_10_01/implementation/SignalRManagementClientImpl.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.signalr.v2018_10_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 SignalRManagementClientImpl class. + */ +public class SignalRManagementClientImpl 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; + } + + /** Client Api Version. Possible values include: '2018-03-01-preview', '2018-10-01'. */ + private String apiVersion; + + /** + * Gets Client Api Version. Possible values include: '2018-03-01-preview', '2018-10-01'. + * + * @return the apiVersion value. + */ + public String apiVersion() { + return this.apiVersion; + } + + /** Gets subscription Id which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. */ + private String subscriptionId; + + /** + * Gets Gets subscription Id which uniquely identify the 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 Id which uniquely identify the 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 SignalRManagementClientImpl withSubscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; + return this; + } + + /** Gets or sets the preferred language for the response. */ + private String acceptLanguage; + + /** + * Gets Gets or sets the preferred language for the response. + * + * @return the acceptLanguage value. + */ + public String acceptLanguage() { + return this.acceptLanguage; + } + + /** + * Sets Gets or sets the preferred language for the response. + * + * @param acceptLanguage the acceptLanguage value. + * @return the service client itself + */ + public SignalRManagementClientImpl withAcceptLanguage(String acceptLanguage) { + this.acceptLanguage = acceptLanguage; + return this; + } + + /** Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30. */ + private int longRunningOperationRetryTimeout; + + /** + * Gets Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30. + * + * @return the longRunningOperationRetryTimeout value. + */ + public int longRunningOperationRetryTimeout() { + return this.longRunningOperationRetryTimeout; + } + + /** + * Sets Gets or 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 SignalRManagementClientImpl withLongRunningOperationRetryTimeout(int longRunningOperationRetryTimeout) { + this.longRunningOperationRetryTimeout = longRunningOperationRetryTimeout; + return this; + } + + /** 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 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 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 SignalRManagementClientImpl 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 SignalRsInner object to access its operations. + */ + private SignalRsInner signalRs; + + /** + * Gets the SignalRsInner object to access its operations. + * @return the SignalRsInner object. + */ + public SignalRsInner signalRs() { + return this.signalRs; + } + + /** + * The UsagesInner object to access its operations. + */ + private UsagesInner usages; + + /** + * Gets the UsagesInner object to access its operations. + * @return the UsagesInner object. + */ + public UsagesInner usages() { + return this.usages; + } + + /** + * Initializes an instance of SignalRManagementClient client. + * + * @param credentials the management credentials for Azure + */ + public SignalRManagementClientImpl(ServiceClientCredentials credentials) { + this("https://management.azure.com", credentials); + } + + /** + * Initializes an instance of SignalRManagementClient client. + * + * @param baseUrl the base URL of the host + * @param credentials the management credentials for Azure + */ + public SignalRManagementClientImpl(String baseUrl, ServiceClientCredentials credentials) { + super(baseUrl, credentials); + initialize(); + } + + /** + * Initializes an instance of SignalRManagementClient client. + * + * @param restClient the REST client to connect to Azure. + */ + public SignalRManagementClientImpl(RestClient restClient) { + super(restClient); + initialize(); + } + + protected void initialize() { + this.apiVersion = 2018-10-01; + this.acceptLanguage = "en-US"; + this.longRunningOperationRetryTimeout = 30; + this.generateClientRequestId = true; + this.operations = new OperationsInner(restClient().retrofit(), this); + this.signalRs = new SignalRsInner(restClient().retrofit(), this); + this.usages = new UsagesInner(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)", super.userAgent(), "SignalRManagementClient", "2018-10-01"); + } +} diff --git a/signalr/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/signalr/v2018_10_01/implementation/SignalRResourceImpl.java b/signalr/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/signalr/v2018_10_01/implementation/SignalRResourceImpl.java new file mode 100644 index 000000000000..bfff4e1cbfb5 --- /dev/null +++ b/signalr/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/signalr/v2018_10_01/implementation/SignalRResourceImpl.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.signalr.v2018_10_01.implementation; + +import com.microsoft.azure.management.signalr.v2018_10_01.SignalRResource; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.signalr.v2018_10_01.ProvisioningState; +import com.microsoft.azure.management.signalr.v2018_10_01.ResourceSku; +import java.util.Map; + +class SignalRResourceImpl extends WrapperImpl implements SignalRResource { + private final SignalRServiceManager manager; + SignalRResourceImpl(SignalRResourceInner inner, SignalRServiceManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public SignalRServiceManager manager() { + return this.manager; + } + + @Override + public String externalIP() { + return this.inner().externalIP(); + } + + @Override + public String hostName() { + return this.inner().hostName(); + } + + @Override + public String hostNamePrefix() { + return this.inner().hostNamePrefix(); + } + + @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 ProvisioningState provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public Integer publicPort() { + return this.inner().publicPort(); + } + + @Override + public Integer serverPort() { + return this.inner().serverPort(); + } + + @Override + public ResourceSku sku() { + return this.inner().sku(); + } + + @Override + public Map tags() { + return this.inner().getTags(); + } + + @Override + public String type() { + return this.inner().type(); + } + + @Override + public String version() { + return this.inner().version(); + } + +} diff --git a/signalr/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/signalr/v2018_10_01/implementation/SignalRResourceInner.java b/signalr/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/signalr/v2018_10_01/implementation/SignalRResourceInner.java new file mode 100644 index 000000000000..102d76a99bfe --- /dev/null +++ b/signalr/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/signalr/v2018_10_01/implementation/SignalRResourceInner.java @@ -0,0 +1,186 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.signalr.v2018_10_01.implementation; + +import com.microsoft.azure.management.signalr.v2018_10_01.ResourceSku; +import com.microsoft.azure.management.signalr.v2018_10_01.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.rest.SkipParentValidation; +import com.microsoft.azure.Resource; + +/** + * A class represent a SignalR service resource. + */ +@JsonFlatten +@SkipParentValidation +public class SignalRResourceInner extends Resource { + /** + * SKU of the service. + */ + @JsonProperty(value = "sku") + private ResourceSku sku; + + /** + * Prefix for the hostName of the SignalR service. Retained for future use. + * The hostname will be of format: + * &lt;hostNamePrefix&gt;.service.signalr.net. + */ + @JsonProperty(value = "properties.hostNamePrefix") + private String hostNamePrefix; + + /** + * Provisioning state of the resource. Possible values include: 'Unknown', + * 'Succeeded', 'Failed', 'Canceled', 'Running', 'Creating', 'Updating', + * 'Deleting', 'Moving'. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /** + * The publicly accessible IP of the SignalR service. + */ + @JsonProperty(value = "properties.externalIP", access = JsonProperty.Access.WRITE_ONLY) + private String externalIP; + + /** + * FQDN of the SignalR service instance. Format: xxx.service.signalr.net. + */ + @JsonProperty(value = "properties.hostName", access = JsonProperty.Access.WRITE_ONLY) + private String hostName; + + /** + * The publicly accessibly port of the SignalR service which is designed + * for browser/client side usage. + */ + @JsonProperty(value = "properties.publicPort", access = JsonProperty.Access.WRITE_ONLY) + private Integer publicPort; + + /** + * The publicly accessibly port of the SignalR service which is designed + * for customer server side usage. + */ + @JsonProperty(value = "properties.serverPort", access = JsonProperty.Access.WRITE_ONLY) + private Integer serverPort; + + /** + * Version of the SignalR resource. Probably you need the same or higher + * version of client SDKs. + */ + @JsonProperty(value = "properties.version") + private String version; + + /** + * Get sKU of the service. + * + * @return the sku value + */ + public ResourceSku sku() { + return this.sku; + } + + /** + * Set sKU of the service. + * + * @param sku the sku value to set + * @return the SignalRResourceInner object itself. + */ + public SignalRResourceInner withSku(ResourceSku sku) { + this.sku = sku; + return this; + } + + /** + * Get prefix for the hostName of the SignalR service. Retained for future use. + The hostname will be of format: &lt;hostNamePrefix&gt;.service.signalr.net. + * + * @return the hostNamePrefix value + */ + public String hostNamePrefix() { + return this.hostNamePrefix; + } + + /** + * Set prefix for the hostName of the SignalR service. Retained for future use. + The hostname will be of format: &lt;hostNamePrefix&gt;.service.signalr.net. + * + * @param hostNamePrefix the hostNamePrefix value to set + * @return the SignalRResourceInner object itself. + */ + public SignalRResourceInner withHostNamePrefix(String hostNamePrefix) { + this.hostNamePrefix = hostNamePrefix; + return this; + } + + /** + * Get provisioning state of the resource. Possible values include: 'Unknown', 'Succeeded', 'Failed', 'Canceled', 'Running', 'Creating', 'Updating', 'Deleting', 'Moving'. + * + * @return the provisioningState value + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the publicly accessible IP of the SignalR service. + * + * @return the externalIP value + */ + public String externalIP() { + return this.externalIP; + } + + /** + * Get fQDN of the SignalR service instance. Format: xxx.service.signalr.net. + * + * @return the hostName value + */ + public String hostName() { + return this.hostName; + } + + /** + * Get the publicly accessibly port of the SignalR service which is designed for browser/client side usage. + * + * @return the publicPort value + */ + public Integer publicPort() { + return this.publicPort; + } + + /** + * Get the publicly accessibly port of the SignalR service which is designed for customer server side usage. + * + * @return the serverPort value + */ + public Integer serverPort() { + return this.serverPort; + } + + /** + * Get version of the SignalR resource. Probably you need the same or higher version of client SDKs. + * + * @return the version value + */ + public String version() { + return this.version; + } + + /** + * Set version of the SignalR resource. Probably you need the same or higher version of client SDKs. + * + * @param version the version value to set + * @return the SignalRResourceInner object itself. + */ + public SignalRResourceInner withVersion(String version) { + this.version = version; + return this; + } + +} diff --git a/signalr/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/signalr/v2018_10_01/implementation/SignalRServiceManager.java b/signalr/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/signalr/v2018_10_01/implementation/SignalRServiceManager.java new file mode 100644 index 000000000000..c5b95cee035f --- /dev/null +++ b/signalr/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/signalr/v2018_10_01/implementation/SignalRServiceManager.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.signalr.v2018_10_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.signalr.v2018_10_01.Operations; +import com.microsoft.azure.management.signalr.v2018_10_01.SignalRs; +import com.microsoft.azure.management.signalr.v2018_10_01.Usages; +import com.microsoft.azure.arm.resources.implementation.AzureConfigurableCoreImpl; +import com.microsoft.azure.arm.resources.implementation.ManagerCore; + +/** + * Entry point to Azure SignalRService resource management. + */ +public final class SignalRServiceManager extends ManagerCore { + private Operations operations; + private SignalRs signalRs; + private Usages usages; + /** + * Get a Configurable instance that can be used to create SignalRServiceManager with optional configuration. + * + * @return the instance allowing configurations + */ + public static Configurable configure() { + return new SignalRServiceManager.ConfigurableImpl(); + } + /** + * Creates an instance of SignalRServiceManager that exposes SignalRService resource management API entry points. + * + * @param credentials the credentials to use + * @param subscriptionId the subscription UUID + * @return the SignalRServiceManager + */ + public static SignalRServiceManager authenticate(AzureTokenCredentials credentials, String subscriptionId) { + return new SignalRServiceManager(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 SignalRServiceManager that exposes SignalRService resource management API entry points. + * + * @param restClient the RestClient to be used for API calls. + * @param subscriptionId the subscription UUID + * @return the SignalRServiceManager + */ + public static SignalRServiceManager authenticate(RestClient restClient, String subscriptionId) { + return new SignalRServiceManager(restClient, subscriptionId); + } + /** + * The interface allowing configurations to be set. + */ + public interface Configurable extends AzureConfigurable { + /** + * Creates an instance of SignalRServiceManager that exposes SignalRService management API entry points. + * + * @param credentials the credentials to use + * @param subscriptionId the subscription UUID + * @return the interface exposing SignalRService management API entry points that work across subscriptions + */ + SignalRServiceManager 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 SignalRs. + */ + public SignalRs signalRs() { + if (this.signalRs == null) { + this.signalRs = new SignalRsImpl(this); + } + return this.signalRs; + } + + /** + * @return Entry point to manage Usages. + */ + public Usages usages() { + if (this.usages == null) { + this.usages = new UsagesImpl(this); + } + return this.usages; + } + + /** + * The implementation for Configurable interface. + */ + private static final class ConfigurableImpl extends AzureConfigurableCoreImpl implements Configurable { + public SignalRServiceManager authenticate(AzureTokenCredentials credentials, String subscriptionId) { + return SignalRServiceManager.authenticate(buildRestClient(credentials), subscriptionId); + } + } + private SignalRServiceManager(RestClient restClient, String subscriptionId) { + super( + restClient, + subscriptionId, + new SignalRManagementClientImpl(restClient).withSubscriptionId(subscriptionId)); + } +} diff --git a/signalr/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/signalr/v2018_10_01/implementation/SignalRUsageImpl.java b/signalr/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/signalr/v2018_10_01/implementation/SignalRUsageImpl.java new file mode 100644 index 000000000000..82292f4377bd --- /dev/null +++ b/signalr/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/signalr/v2018_10_01/implementation/SignalRUsageImpl.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.signalr.v2018_10_01.implementation; + +import com.microsoft.azure.management.signalr.v2018_10_01.SignalRUsage; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import rx.Observable; +import com.microsoft.azure.management.signalr.v2018_10_01.SignalRUsageName; + +class SignalRUsageImpl extends WrapperImpl implements SignalRUsage { + private final SignalRServiceManager manager; + + SignalRUsageImpl(SignalRUsageInner inner, SignalRServiceManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public SignalRServiceManager manager() { + return this.manager; + } + + + + @Override + public Long currentValue() { + return this.inner().currentValue(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public Long limit() { + return this.inner().limit(); + } + + @Override + public SignalRUsageName name() { + return this.inner().name(); + } + + @Override + public String unit() { + return this.inner().unit(); + } + +} diff --git a/signalr/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/signalr/v2018_10_01/implementation/SignalRUsageInner.java b/signalr/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/signalr/v2018_10_01/implementation/SignalRUsageInner.java new file mode 100644 index 000000000000..80c4664d1478 --- /dev/null +++ b/signalr/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/signalr/v2018_10_01/implementation/SignalRUsageInner.java @@ -0,0 +1,150 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.signalr.v2018_10_01.implementation; + +import com.microsoft.azure.management.signalr.v2018_10_01.SignalRUsageName; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Object that describes a specific usage of SignalR resources. + */ +public class SignalRUsageInner { + /** + * Fully qualified ARM resource id. + */ + @JsonProperty(value = "id") + private String id; + + /** + * Current value for the usage quota. + */ + @JsonProperty(value = "currentValue") + private Long currentValue; + + /** + * The maximum permitted value for the usage quota. If there is no limit, + * this value will be -1. + */ + @JsonProperty(value = "limit") + private Long limit; + + /** + * Localizable String object containing the name and a localized value. + */ + @JsonProperty(value = "name") + private SignalRUsageName name; + + /** + * Representing the units of the usage quota. Possible values are: Count, + * Bytes, Seconds, Percent, CountPerSecond, BytesPerSecond. + */ + @JsonProperty(value = "unit") + private String unit; + + /** + * Get fully qualified ARM resource id. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set fully qualified ARM resource id. + * + * @param id the id value to set + * @return the SignalRUsageInner object itself. + */ + public SignalRUsageInner withId(String id) { + this.id = id; + return this; + } + + /** + * Get current value for the usage quota. + * + * @return the currentValue value + */ + public Long currentValue() { + return this.currentValue; + } + + /** + * Set current value for the usage quota. + * + * @param currentValue the currentValue value to set + * @return the SignalRUsageInner object itself. + */ + public SignalRUsageInner withCurrentValue(Long currentValue) { + this.currentValue = currentValue; + return this; + } + + /** + * Get the maximum permitted value for the usage quota. If there is no limit, this value will be -1. + * + * @return the limit value + */ + public Long limit() { + return this.limit; + } + + /** + * Set the maximum permitted value for the usage quota. If there is no limit, this value will be -1. + * + * @param limit the limit value to set + * @return the SignalRUsageInner object itself. + */ + public SignalRUsageInner withLimit(Long limit) { + this.limit = limit; + return this; + } + + /** + * Get localizable String object containing the name and a localized value. + * + * @return the name value + */ + public SignalRUsageName name() { + return this.name; + } + + /** + * Set localizable String object containing the name and a localized value. + * + * @param name the name value to set + * @return the SignalRUsageInner object itself. + */ + public SignalRUsageInner withName(SignalRUsageName name) { + this.name = name; + return this; + } + + /** + * Get representing the units of the usage quota. Possible values are: Count, Bytes, Seconds, Percent, CountPerSecond, BytesPerSecond. + * + * @return the unit value + */ + public String unit() { + return this.unit; + } + + /** + * Set representing the units of the usage quota. Possible values are: Count, Bytes, Seconds, Percent, CountPerSecond, BytesPerSecond. + * + * @param unit the unit value to set + * @return the SignalRUsageInner object itself. + */ + public SignalRUsageInner withUnit(String unit) { + this.unit = unit; + return this; + } + +} diff --git a/signalr/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/signalr/v2018_10_01/implementation/SignalRsImpl.java b/signalr/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/signalr/v2018_10_01/implementation/SignalRsImpl.java new file mode 100644 index 000000000000..3e820869960f --- /dev/null +++ b/signalr/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/signalr/v2018_10_01/implementation/SignalRsImpl.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. + * abc + */ + +package com.microsoft.azure.management.signalr.v2018_10_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.signalr.v2018_10_01.SignalRs; +import rx.functions.Func1; +import rx.Observable; +import com.microsoft.azure.management.signalr.v2018_10_01.NameAvailability; +import com.microsoft.azure.management.signalr.v2018_10_01.SignalRKeys; +import rx.Completable; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.signalr.v2018_10_01.SignalRResource; + +class SignalRsImpl extends WrapperImpl implements SignalRs { + private final SignalRServiceManager manager; + + SignalRsImpl(SignalRServiceManager manager) { + super(manager.inner().signalRs()); + this.manager = manager; + } + + public SignalRServiceManager manager() { + return this.manager; + } + + @Override + public Observable checkNameAvailabilityAsync(String location) { + SignalRsInner client = this.inner(); + return client.checkNameAvailabilityAsync(location) + .map(new Func1() { + @Override + public NameAvailability call(NameAvailabilityInner inner) { + return new NameAvailabilityImpl(inner, manager()); + } + }); + } + + @Override + public Observable listKeysAsync(String resourceGroupName, String resourceName) { + SignalRsInner client = this.inner(); + return client.listKeysAsync(resourceGroupName, resourceName) + .map(new Func1() { + @Override + public SignalRKeys call(SignalRKeysInner inner) { + return new SignalRKeysImpl(inner, manager()); + } + }); + } + + @Override + public Observable regenerateKeyAsync(String resourceGroupName, String resourceName) { + SignalRsInner client = this.inner(); + return client.regenerateKeyAsync(resourceGroupName, resourceName) + .map(new Func1() { + @Override + public SignalRKeys call(SignalRKeysInner inner) { + return new SignalRKeysImpl(inner, manager()); + } + }); + } + + @Override + public Observable getByResourceGroupAsync(String resourceGroupName, String resourceName) { + SignalRsInner client = this.inner(); + return client.getByResourceGroupAsync(resourceGroupName, resourceName) + .map(new Func1() { + @Override + public SignalRResource call(SignalRResourceInner inner) { + return new SignalRResourceImpl(inner, manager()); + } + }); + } + + @Override + public Observable createOrUpdateAsync(String resourceGroupName, String resourceName) { + SignalRsInner client = this.inner(); + return client.createOrUpdateAsync(resourceGroupName, resourceName) + .map(new Func1() { + @Override + public SignalRResource call(SignalRResourceInner inner) { + return new SignalRResourceImpl(inner, manager()); + } + }); + } + + @Override + public Completable deleteAsync(String resourceGroupName, String resourceName) { + SignalRsInner client = this.inner(); + return client.deleteAsync(resourceGroupName, resourceName).toCompletable(); + } + + @Override + public Observable updateAsync(String resourceGroupName, String resourceName) { + SignalRsInner client = this.inner(); + return client.updateAsync(resourceGroupName, resourceName) + .map(new Func1() { + @Override + public SignalRResource call(SignalRResourceInner inner) { + return new SignalRResourceImpl(inner, manager()); + } + }); + } + + @Override + public Observable listAsync() { + SignalRsInner client = this.inner(); + return client.listAsync() + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public SignalRResource call(SignalRResourceInner inner) { + return new SignalRResourceImpl(inner, manager()); + } + }); + } + + @Override + public Observable listByResourceGroupAsync(final String resourceGroupName) { + SignalRsInner 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 SignalRResource call(SignalRResourceInner inner) { + return new SignalRResourceImpl(inner, manager()); + } + }); + } + +} diff --git a/signalr/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/signalr/v2018_10_01/implementation/SignalRsInner.java b/signalr/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/signalr/v2018_10_01/implementation/SignalRsInner.java new file mode 100644 index 000000000000..5ed15691b047 --- /dev/null +++ b/signalr/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/signalr/v2018_10_01/implementation/SignalRsInner.java @@ -0,0 +1,2019 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.signalr.v2018_10_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.signalr.v2018_10_01.KeyType; +import com.microsoft.azure.management.signalr.v2018_10_01.NameAvailabilityParameters; +import com.microsoft.azure.management.signalr.v2018_10_01.RegenerateKeyParameters; +import com.microsoft.azure.management.signalr.v2018_10_01.SignalRCreateParameters; +import com.microsoft.azure.management.signalr.v2018_10_01.SignalRUpdateParameters; +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 SignalRs. + */ +public class SignalRsInner implements InnerSupportsGet, InnerSupportsDelete, InnerSupportsListing { + /** The Retrofit service to perform REST calls. */ + private SignalRsService service; + /** The service client containing this operation class. */ + private SignalRManagementClientImpl client; + + /** + * Initializes an instance of SignalRsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public SignalRsInner(Retrofit retrofit, SignalRManagementClientImpl client) { + this.service = retrofit.create(SignalRsService.class); + this.client = client; + } + + /** + * The interface defining all the services for SignalRs to be + * used by Retrofit to perform actually REST calls. + */ + interface SignalRsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.signalr.v2018_10_01.SignalRs checkNameAvailability" }) + @POST("subscriptions/{subscriptionId}/providers/Microsoft.SignalRService/locations/{location}/checkNameAvailability") + Observable> checkNameAvailability(@Path("location") String location, @Path("subscriptionId") String subscriptionId, @Body NameAvailabilityParameters 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.signalr.v2018_10_01.SignalRs list" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.SignalRService/SignalR") + 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.signalr.v2018_10_01.SignalRs listByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/SignalR") + 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.signalr.v2018_10_01.SignalRs listKeys" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/SignalR/{resourceName}/listKeys") + Observable> listKeys(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("resourceName") String resourceName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.signalr.v2018_10_01.SignalRs regenerateKey" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/SignalR/{resourceName}/regenerateKey") + Observable> regenerateKey(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("resourceName") String resourceName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body RegenerateKeyParameters parameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.signalr.v2018_10_01.SignalRs beginRegenerateKey" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/SignalR/{resourceName}/regenerateKey") + Observable> beginRegenerateKey(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("resourceName") String resourceName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body RegenerateKeyParameters parameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.signalr.v2018_10_01.SignalRs getByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/SignalR/{resourceName}") + Observable> getByResourceGroup(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("resourceName") String resourceName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.signalr.v2018_10_01.SignalRs createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/SignalR/{resourceName}") + Observable> createOrUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("resourceName") String resourceName, @Body SignalRCreateParameters 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.signalr.v2018_10_01.SignalRs beginCreateOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/SignalR/{resourceName}") + Observable> beginCreateOrUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("resourceName") String resourceName, @Body SignalRCreateParameters 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.signalr.v2018_10_01.SignalRs delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/SignalR/{resourceName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("resourceName") String resourceName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.signalr.v2018_10_01.SignalRs beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/SignalR/{resourceName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("resourceName") String resourceName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.signalr.v2018_10_01.SignalRs update" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/SignalR/{resourceName}") + Observable> update(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("resourceName") String resourceName, @Body SignalRUpdateParameters 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.signalr.v2018_10_01.SignalRs beginUpdate" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/SignalR/{resourceName}") + Observable> beginUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("resourceName") String resourceName, @Body SignalRUpdateParameters 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.signalr.v2018_10_01.SignalRs 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.signalr.v2018_10_01.SignalRs listByResourceGroupNext" }) + @GET + Observable> listByResourceGroupNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Checks that the SignalR name is valid and is not already in use. + * + * @param location the region + * @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 NameAvailabilityInner object if successful. + */ + public NameAvailabilityInner checkNameAvailability(String location) { + return checkNameAvailabilityWithServiceResponseAsync(location).toBlocking().single().body(); + } + + /** + * Checks that the SignalR name is valid and is not already in use. + * + * @param location the region + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture checkNameAvailabilityAsync(String location, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(checkNameAvailabilityWithServiceResponseAsync(location), serviceCallback); + } + + /** + * Checks that the SignalR name is valid and is not already in use. + * + * @param location the region + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the NameAvailabilityInner object + */ + public Observable checkNameAvailabilityAsync(String location) { + return checkNameAvailabilityWithServiceResponseAsync(location).map(new Func1, NameAvailabilityInner>() { + @Override + public NameAvailabilityInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Checks that the SignalR name is valid and is not already in use. + * + * @param location the region + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the NameAvailabilityInner object + */ + public Observable> checkNameAvailabilityWithServiceResponseAsync(String location) { + if (location == null) { + throw new IllegalArgumentException("Parameter location 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 NameAvailabilityParameters parameters = null; + return service.checkNameAvailability(location, 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 = checkNameAvailabilityDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Checks that the SignalR name is valid and is not already in use. + * + * @param location the region + * @param parameters Parameters supplied to the 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 NameAvailabilityInner object if successful. + */ + public NameAvailabilityInner checkNameAvailability(String location, NameAvailabilityParameters parameters) { + return checkNameAvailabilityWithServiceResponseAsync(location, parameters).toBlocking().single().body(); + } + + /** + * Checks that the SignalR name is valid and is not already in use. + * + * @param location the region + * @param parameters Parameters supplied to 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 checkNameAvailabilityAsync(String location, NameAvailabilityParameters parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(checkNameAvailabilityWithServiceResponseAsync(location, parameters), serviceCallback); + } + + /** + * Checks that the SignalR name is valid and is not already in use. + * + * @param location the region + * @param parameters Parameters supplied to the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the NameAvailabilityInner object + */ + public Observable checkNameAvailabilityAsync(String location, NameAvailabilityParameters parameters) { + return checkNameAvailabilityWithServiceResponseAsync(location, parameters).map(new Func1, NameAvailabilityInner>() { + @Override + public NameAvailabilityInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Checks that the SignalR name is valid and is not already in use. + * + * @param location the region + * @param parameters Parameters supplied to the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the NameAvailabilityInner object + */ + public Observable> checkNameAvailabilityWithServiceResponseAsync(String location, NameAvailabilityParameters parameters) { + if (location == null) { + throw new IllegalArgumentException("Parameter location 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.checkNameAvailability(location, 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 = checkNameAvailabilityDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse checkNameAvailabilityDelegate(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); + } + + /** + * Handles requests to list all resources in a 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<SignalRResourceInner> 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(); + } + }; + } + + /** + * Handles requests to list all resources in a subscription. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Handles requests to list all resources in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<SignalRResourceInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Handles requests to list all resources in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<SignalRResourceInner> 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)); + } + }); + } + + /** + * Handles requests to list all resources in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<SignalRResourceInner> 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); + } + + /** + * Handles requests to list all resources in a resource group. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @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<SignalRResourceInner> 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(); + } + }; + } + + /** + * Handles requests to list all resources in a resource group. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @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); + } + + /** + * Handles requests to list all resources in a resource group. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<SignalRResourceInner> object + */ + public Observable> listByResourceGroupAsync(final String resourceGroupName) { + return listByResourceGroupWithServiceResponseAsync(resourceGroupName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Handles requests to list all resources in a resource group. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<SignalRResourceInner> 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)); + } + }); + } + + /** + * Handles requests to list all resources in a resource group. + * + ServiceResponse> * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<SignalRResourceInner> 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 CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Get the access keys of the SignalR resource. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param resourceName The name of the SignalR 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 SignalRKeysInner object if successful. + */ + public SignalRKeysInner listKeys(String resourceGroupName, String resourceName) { + return listKeysWithServiceResponseAsync(resourceGroupName, resourceName).toBlocking().single().body(); + } + + /** + * Get the access keys of the SignalR resource. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param resourceName The name of the SignalR 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 listKeysAsync(String resourceGroupName, String resourceName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(listKeysWithServiceResponseAsync(resourceGroupName, resourceName), serviceCallback); + } + + /** + * Get the access keys of the SignalR resource. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param resourceName The name of the SignalR resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SignalRKeysInner object + */ + public Observable listKeysAsync(String resourceGroupName, String resourceName) { + return listKeysWithServiceResponseAsync(resourceGroupName, resourceName).map(new Func1, SignalRKeysInner>() { + @Override + public SignalRKeysInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get the access keys of the SignalR resource. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param resourceName The name of the SignalR resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SignalRKeysInner object + */ + public Observable> listKeysWithServiceResponseAsync(String resourceGroupName, String resourceName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (resourceName == null) { + throw new IllegalArgumentException("Parameter resourceName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.listKeys(this.client.subscriptionId(), resourceGroupName, resourceName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = 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); + } + + /** + * Regenerate SignalR service access key. PrimaryKey and SecondaryKey cannot be regenerated at the same time. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param resourceName The name of the SignalR 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 SignalRKeysInner object if successful. + */ + public SignalRKeysInner regenerateKey(String resourceGroupName, String resourceName) { + return regenerateKeyWithServiceResponseAsync(resourceGroupName, resourceName).toBlocking().last().body(); + } + + /** + * Regenerate SignalR service access key. PrimaryKey and SecondaryKey cannot be regenerated at the same time. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param resourceName The name of the SignalR 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 regenerateKeyAsync(String resourceGroupName, String resourceName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(regenerateKeyWithServiceResponseAsync(resourceGroupName, resourceName), serviceCallback); + } + + /** + * Regenerate SignalR service access key. PrimaryKey and SecondaryKey cannot be regenerated at the same time. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param resourceName The name of the SignalR resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable regenerateKeyAsync(String resourceGroupName, String resourceName) { + return regenerateKeyWithServiceResponseAsync(resourceGroupName, resourceName).map(new Func1, SignalRKeysInner>() { + @Override + public SignalRKeysInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Regenerate SignalR service access key. PrimaryKey and SecondaryKey cannot be regenerated at the same time. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param resourceName The name of the SignalR resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> regenerateKeyWithServiceResponseAsync(String resourceGroupName, String resourceName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (resourceName == null) { + throw new IllegalArgumentException("Parameter resourceName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final KeyType keyType = null; + RegenerateKeyParameters parameters = new RegenerateKeyParameters(); + parameters.withKeyType(null); + Observable> observable = service.regenerateKey(this.client.subscriptionId(), resourceGroupName, resourceName, this.client.apiVersion(), this.client.acceptLanguage(), parameters, this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + /** + * Regenerate SignalR service access key. PrimaryKey and SecondaryKey cannot be regenerated at the same time. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param resourceName The name of the SignalR resource. + * @param keyType The keyType to regenerate. Must be either 'primary' or 'secondary'(case-insensitive). Possible values include: 'Primary', 'Secondary' + * @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 SignalRKeysInner object if successful. + */ + public SignalRKeysInner regenerateKey(String resourceGroupName, String resourceName, KeyType keyType) { + return regenerateKeyWithServiceResponseAsync(resourceGroupName, resourceName, keyType).toBlocking().last().body(); + } + + /** + * Regenerate SignalR service access key. PrimaryKey and SecondaryKey cannot be regenerated at the same time. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param resourceName The name of the SignalR resource. + * @param keyType The keyType to regenerate. Must be either 'primary' or 'secondary'(case-insensitive). Possible values include: 'Primary', 'Secondary' + * @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 regenerateKeyAsync(String resourceGroupName, String resourceName, KeyType keyType, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(regenerateKeyWithServiceResponseAsync(resourceGroupName, resourceName, keyType), serviceCallback); + } + + /** + * Regenerate SignalR service access key. PrimaryKey and SecondaryKey cannot be regenerated at the same time. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param resourceName The name of the SignalR resource. + * @param keyType The keyType to regenerate. Must be either 'primary' or 'secondary'(case-insensitive). Possible values include: 'Primary', 'Secondary' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable regenerateKeyAsync(String resourceGroupName, String resourceName, KeyType keyType) { + return regenerateKeyWithServiceResponseAsync(resourceGroupName, resourceName, keyType).map(new Func1, SignalRKeysInner>() { + @Override + public SignalRKeysInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Regenerate SignalR service access key. PrimaryKey and SecondaryKey cannot be regenerated at the same time. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param resourceName The name of the SignalR resource. + * @param keyType The keyType to regenerate. Must be either 'primary' or 'secondary'(case-insensitive). Possible values include: 'Primary', 'Secondary' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> regenerateKeyWithServiceResponseAsync(String resourceGroupName, String resourceName, KeyType keyType) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (resourceName == null) { + throw new IllegalArgumentException("Parameter resourceName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + RegenerateKeyParameters parameters = null; + if (keyType != null) { + parameters = new RegenerateKeyParameters(); + parameters.withKeyType(keyType); + } + Observable> observable = service.regenerateKey(this.client.subscriptionId(), resourceGroupName, resourceName, this.client.apiVersion(), this.client.acceptLanguage(), parameters, this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Regenerate SignalR service access key. PrimaryKey and SecondaryKey cannot be regenerated at the same time. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param resourceName The name of the SignalR 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 SignalRKeysInner object if successful. + */ + public SignalRKeysInner beginRegenerateKey(String resourceGroupName, String resourceName) { + return beginRegenerateKeyWithServiceResponseAsync(resourceGroupName, resourceName).toBlocking().single().body(); + } + + /** + * Regenerate SignalR service access key. PrimaryKey and SecondaryKey cannot be regenerated at the same time. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param resourceName The name of the SignalR 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 beginRegenerateKeyAsync(String resourceGroupName, String resourceName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginRegenerateKeyWithServiceResponseAsync(resourceGroupName, resourceName), serviceCallback); + } + + /** + * Regenerate SignalR service access key. PrimaryKey and SecondaryKey cannot be regenerated at the same time. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param resourceName The name of the SignalR resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SignalRKeysInner object + */ + public Observable beginRegenerateKeyAsync(String resourceGroupName, String resourceName) { + return beginRegenerateKeyWithServiceResponseAsync(resourceGroupName, resourceName).map(new Func1, SignalRKeysInner>() { + @Override + public SignalRKeysInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Regenerate SignalR service access key. PrimaryKey and SecondaryKey cannot be regenerated at the same time. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param resourceName The name of the SignalR resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SignalRKeysInner object + */ + public Observable> beginRegenerateKeyWithServiceResponseAsync(String resourceGroupName, String resourceName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (resourceName == null) { + throw new IllegalArgumentException("Parameter resourceName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final KeyType keyType = null; + RegenerateKeyParameters parameters = new RegenerateKeyParameters(); + parameters.withKeyType(null); + return service.beginRegenerateKey(this.client.subscriptionId(), resourceGroupName, resourceName, this.client.apiVersion(), this.client.acceptLanguage(), parameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginRegenerateKeyDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Regenerate SignalR service access key. PrimaryKey and SecondaryKey cannot be regenerated at the same time. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param resourceName The name of the SignalR resource. + * @param keyType The keyType to regenerate. Must be either 'primary' or 'secondary'(case-insensitive). Possible values include: 'Primary', 'Secondary' + * @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 SignalRKeysInner object if successful. + */ + public SignalRKeysInner beginRegenerateKey(String resourceGroupName, String resourceName, KeyType keyType) { + return beginRegenerateKeyWithServiceResponseAsync(resourceGroupName, resourceName, keyType).toBlocking().single().body(); + } + + /** + * Regenerate SignalR service access key. PrimaryKey and SecondaryKey cannot be regenerated at the same time. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param resourceName The name of the SignalR resource. + * @param keyType The keyType to regenerate. Must be either 'primary' or 'secondary'(case-insensitive). Possible values include: 'Primary', 'Secondary' + * @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 beginRegenerateKeyAsync(String resourceGroupName, String resourceName, KeyType keyType, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginRegenerateKeyWithServiceResponseAsync(resourceGroupName, resourceName, keyType), serviceCallback); + } + + /** + * Regenerate SignalR service access key. PrimaryKey and SecondaryKey cannot be regenerated at the same time. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param resourceName The name of the SignalR resource. + * @param keyType The keyType to regenerate. Must be either 'primary' or 'secondary'(case-insensitive). Possible values include: 'Primary', 'Secondary' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SignalRKeysInner object + */ + public Observable beginRegenerateKeyAsync(String resourceGroupName, String resourceName, KeyType keyType) { + return beginRegenerateKeyWithServiceResponseAsync(resourceGroupName, resourceName, keyType).map(new Func1, SignalRKeysInner>() { + @Override + public SignalRKeysInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Regenerate SignalR service access key. PrimaryKey and SecondaryKey cannot be regenerated at the same time. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param resourceName The name of the SignalR resource. + * @param keyType The keyType to regenerate. Must be either 'primary' or 'secondary'(case-insensitive). Possible values include: 'Primary', 'Secondary' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SignalRKeysInner object + */ + public Observable> beginRegenerateKeyWithServiceResponseAsync(String resourceGroupName, String resourceName, KeyType keyType) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (resourceName == null) { + throw new IllegalArgumentException("Parameter resourceName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + RegenerateKeyParameters parameters = null; + if (keyType != null) { + parameters = new RegenerateKeyParameters(); + parameters.withKeyType(keyType); + } + return service.beginRegenerateKey(this.client.subscriptionId(), resourceGroupName, resourceName, this.client.apiVersion(), this.client.acceptLanguage(), parameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginRegenerateKeyDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginRegenerateKeyDelegate(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); + } + + /** + * Get the SignalR service and its properties. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param resourceName The name of the SignalR 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 SignalRResourceInner object if successful. + */ + public SignalRResourceInner getByResourceGroup(String resourceGroupName, String resourceName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, resourceName).toBlocking().single().body(); + } + + /** + * Get the SignalR service and its properties. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param resourceName The name of the SignalR 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 getByResourceGroupAsync(String resourceGroupName, String resourceName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getByResourceGroupWithServiceResponseAsync(resourceGroupName, resourceName), serviceCallback); + } + + /** + * Get the SignalR service and its properties. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param resourceName The name of the SignalR resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SignalRResourceInner object + */ + public Observable getByResourceGroupAsync(String resourceGroupName, String resourceName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, resourceName).map(new Func1, SignalRResourceInner>() { + @Override + public SignalRResourceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get the SignalR service and its properties. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param resourceName The name of the SignalR resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SignalRResourceInner object + */ + public Observable> getByResourceGroupWithServiceResponseAsync(String resourceGroupName, String resourceName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (resourceName == null) { + throw new IllegalArgumentException("Parameter resourceName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.getByResourceGroup(this.client.subscriptionId(), resourceGroupName, resourceName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getByResourceGroupDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getByResourceGroupDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Create a new SignalR service and update an exiting SignalR service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param resourceName The name of the SignalR 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 SignalRResourceInner object if successful. + */ + public SignalRResourceInner createOrUpdate(String resourceGroupName, String resourceName) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, resourceName).toBlocking().last().body(); + } + + /** + * Create a new SignalR service and update an exiting SignalR service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param resourceName The name of the SignalR 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 resourceName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, resourceName), serviceCallback); + } + + /** + * Create a new SignalR service and update an exiting SignalR service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param resourceName The name of the SignalR resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createOrUpdateAsync(String resourceGroupName, String resourceName) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, resourceName).map(new Func1, SignalRResourceInner>() { + @Override + public SignalRResourceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create a new SignalR service and update an exiting SignalR service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param resourceName The name of the SignalR resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String resourceName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (resourceName == null) { + throw new IllegalArgumentException("Parameter resourceName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final SignalRCreateParameters parameters = null; + Observable> observable = service.createOrUpdate(this.client.subscriptionId(), resourceGroupName, resourceName, parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + /** + * Create a new SignalR service and update an exiting SignalR service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param resourceName The name of the SignalR resource. + * @param parameters Parameters for the create or update 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 SignalRResourceInner object if successful. + */ + public SignalRResourceInner createOrUpdate(String resourceGroupName, String resourceName, SignalRCreateParameters parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, resourceName, parameters).toBlocking().last().body(); + } + + /** + * Create a new SignalR service and update an exiting SignalR service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param resourceName The name of the SignalR resource. + * @param parameters Parameters for the create or update 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 createOrUpdateAsync(String resourceGroupName, String resourceName, SignalRCreateParameters parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, resourceName, parameters), serviceCallback); + } + + /** + * Create a new SignalR service and update an exiting SignalR service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param resourceName The name of the SignalR resource. + * @param parameters Parameters for the create or update operation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createOrUpdateAsync(String resourceGroupName, String resourceName, SignalRCreateParameters parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, resourceName, parameters).map(new Func1, SignalRResourceInner>() { + @Override + public SignalRResourceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create a new SignalR service and update an exiting SignalR service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param resourceName The name of the SignalR resource. + * @param parameters Parameters for the create or update operation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String resourceName, SignalRCreateParameters 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 (resourceName == null) { + throw new IllegalArgumentException("Parameter resourceName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(parameters); + Observable> observable = service.createOrUpdate(this.client.subscriptionId(), resourceGroupName, resourceName, parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Create a new SignalR service and update an exiting SignalR service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param resourceName The name of the SignalR 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 SignalRResourceInner object if successful. + */ + public SignalRResourceInner beginCreateOrUpdate(String resourceGroupName, String resourceName) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, resourceName).toBlocking().single().body(); + } + + /** + * Create a new SignalR service and update an exiting SignalR service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param resourceName The name of the SignalR 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 beginCreateOrUpdateAsync(String resourceGroupName, String resourceName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, resourceName), serviceCallback); + } + + /** + * Create a new SignalR service and update an exiting SignalR service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param resourceName The name of the SignalR resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SignalRResourceInner object + */ + public Observable beginCreateOrUpdateAsync(String resourceGroupName, String resourceName) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, resourceName).map(new Func1, SignalRResourceInner>() { + @Override + public SignalRResourceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create a new SignalR service and update an exiting SignalR service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param resourceName The name of the SignalR resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SignalRResourceInner object + */ + public Observable> beginCreateOrUpdateWithServiceResponseAsync(String resourceGroupName, String resourceName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (resourceName == null) { + throw new IllegalArgumentException("Parameter resourceName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final SignalRCreateParameters parameters = null; + return service.beginCreateOrUpdate(this.client.subscriptionId(), resourceGroupName, resourceName, parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Create a new SignalR service and update an exiting SignalR service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param resourceName The name of the SignalR resource. + * @param parameters Parameters for the create or update 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 SignalRResourceInner object if successful. + */ + public SignalRResourceInner beginCreateOrUpdate(String resourceGroupName, String resourceName, SignalRCreateParameters parameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, resourceName, parameters).toBlocking().single().body(); + } + + /** + * Create a new SignalR service and update an exiting SignalR service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param resourceName The name of the SignalR resource. + * @param parameters Parameters for the create or update 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 beginCreateOrUpdateAsync(String resourceGroupName, String resourceName, SignalRCreateParameters parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, resourceName, parameters), serviceCallback); + } + + /** + * Create a new SignalR service and update an exiting SignalR service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param resourceName The name of the SignalR resource. + * @param parameters Parameters for the create or update operation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SignalRResourceInner object + */ + public Observable beginCreateOrUpdateAsync(String resourceGroupName, String resourceName, SignalRCreateParameters parameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, resourceName, parameters).map(new Func1, SignalRResourceInner>() { + @Override + public SignalRResourceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create a new SignalR service and update an exiting SignalR service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param resourceName The name of the SignalR resource. + * @param parameters Parameters for the create or update operation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SignalRResourceInner object + */ + public Observable> beginCreateOrUpdateWithServiceResponseAsync(String resourceGroupName, String resourceName, SignalRCreateParameters 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 (resourceName == null) { + throw new IllegalArgumentException("Parameter resourceName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(parameters); + return service.beginCreateOrUpdate(this.client.subscriptionId(), resourceGroupName, resourceName, parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateOrUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(201, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Operation to delete a SignalR service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param resourceName The name of the SignalR 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 + */ + public void delete(String resourceGroupName, String resourceName) { + deleteWithServiceResponseAsync(resourceGroupName, resourceName).toBlocking().last().body(); + } + + /** + * Operation to delete a SignalR service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param resourceName The name of the SignalR resource. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String resourceName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, resourceName), serviceCallback); + } + + /** + * Operation to delete a SignalR service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param resourceName The name of the SignalR resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String resourceName) { + return deleteWithServiceResponseAsync(resourceGroupName, resourceName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Operation to delete a SignalR service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param resourceName The name of the SignalR resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String resourceName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (resourceName == null) { + throw new IllegalArgumentException("Parameter resourceName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Observable> observable = service.delete(this.client.subscriptionId(), resourceGroupName, resourceName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Operation to delete a SignalR service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param resourceName The name of the SignalR 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 + */ + public void beginDelete(String resourceGroupName, String resourceName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, resourceName).toBlocking().single().body(); + } + + /** + * Operation to delete a SignalR service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param resourceName The name of the SignalR resource. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteAsync(String resourceGroupName, String resourceName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, resourceName), serviceCallback); + } + + /** + * Operation to delete a SignalR service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param resourceName The name of the SignalR resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String resourceName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, resourceName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Operation to delete a SignalR service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param resourceName The name of the SignalR resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String resourceName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (resourceName == null) { + throw new IllegalArgumentException("Parameter resourceName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.beginDelete(this.client.subscriptionId(), resourceGroupName, resourceName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Operation to update an exiting SignalR service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param resourceName The name of the SignalR 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 SignalRResourceInner object if successful. + */ + public SignalRResourceInner update(String resourceGroupName, String resourceName) { + return updateWithServiceResponseAsync(resourceGroupName, resourceName).toBlocking().last().body(); + } + + /** + * Operation to update an exiting SignalR service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param resourceName The name of the SignalR 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 updateAsync(String resourceGroupName, String resourceName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, resourceName), serviceCallback); + } + + /** + * Operation to update an exiting SignalR service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param resourceName The name of the SignalR resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable updateAsync(String resourceGroupName, String resourceName) { + return updateWithServiceResponseAsync(resourceGroupName, resourceName).map(new Func1, SignalRResourceInner>() { + @Override + public SignalRResourceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Operation to update an exiting SignalR service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param resourceName The name of the SignalR resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> updateWithServiceResponseAsync(String resourceGroupName, String resourceName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (resourceName == null) { + throw new IllegalArgumentException("Parameter resourceName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final SignalRUpdateParameters parameters = null; + Observable> observable = service.update(this.client.subscriptionId(), resourceGroupName, resourceName, parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + /** + * Operation to update an exiting SignalR service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param resourceName The name of the SignalR resource. + * @param parameters Parameters for the update 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 SignalRResourceInner object if successful. + */ + public SignalRResourceInner update(String resourceGroupName, String resourceName, SignalRUpdateParameters parameters) { + return updateWithServiceResponseAsync(resourceGroupName, resourceName, parameters).toBlocking().last().body(); + } + + /** + * Operation to update an exiting SignalR service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param resourceName The name of the SignalR resource. + * @param parameters Parameters for the update 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 updateAsync(String resourceGroupName, String resourceName, SignalRUpdateParameters parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, resourceName, parameters), serviceCallback); + } + + /** + * Operation to update an exiting SignalR service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param resourceName The name of the SignalR resource. + * @param parameters Parameters for the update operation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable updateAsync(String resourceGroupName, String resourceName, SignalRUpdateParameters parameters) { + return updateWithServiceResponseAsync(resourceGroupName, resourceName, parameters).map(new Func1, SignalRResourceInner>() { + @Override + public SignalRResourceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Operation to update an exiting SignalR service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param resourceName The name of the SignalR resource. + * @param parameters Parameters for the update operation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> updateWithServiceResponseAsync(String resourceGroupName, String resourceName, SignalRUpdateParameters 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 (resourceName == null) { + throw new IllegalArgumentException("Parameter resourceName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(parameters); + Observable> observable = service.update(this.client.subscriptionId(), resourceGroupName, resourceName, parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Operation to update an exiting SignalR service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param resourceName The name of the SignalR 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 SignalRResourceInner object if successful. + */ + public SignalRResourceInner beginUpdate(String resourceGroupName, String resourceName) { + return beginUpdateWithServiceResponseAsync(resourceGroupName, resourceName).toBlocking().single().body(); + } + + /** + * Operation to update an exiting SignalR service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param resourceName The name of the SignalR 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 beginUpdateAsync(String resourceGroupName, String resourceName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateWithServiceResponseAsync(resourceGroupName, resourceName), serviceCallback); + } + + /** + * Operation to update an exiting SignalR service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param resourceName The name of the SignalR resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SignalRResourceInner object + */ + public Observable beginUpdateAsync(String resourceGroupName, String resourceName) { + return beginUpdateWithServiceResponseAsync(resourceGroupName, resourceName).map(new Func1, SignalRResourceInner>() { + @Override + public SignalRResourceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Operation to update an exiting SignalR service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param resourceName The name of the SignalR resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SignalRResourceInner object + */ + public Observable> beginUpdateWithServiceResponseAsync(String resourceGroupName, String resourceName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (resourceName == null) { + throw new IllegalArgumentException("Parameter resourceName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final SignalRUpdateParameters parameters = null; + return service.beginUpdate(this.client.subscriptionId(), resourceGroupName, resourceName, parameters, this.client.apiVersion(), 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); + } + } + }); + } + + /** + * Operation to update an exiting SignalR service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param resourceName The name of the SignalR resource. + * @param parameters Parameters for the update 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 SignalRResourceInner object if successful. + */ + public SignalRResourceInner beginUpdate(String resourceGroupName, String resourceName, SignalRUpdateParameters parameters) { + return beginUpdateWithServiceResponseAsync(resourceGroupName, resourceName, parameters).toBlocking().single().body(); + } + + /** + * Operation to update an exiting SignalR service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param resourceName The name of the SignalR resource. + * @param parameters Parameters for the update 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 beginUpdateAsync(String resourceGroupName, String resourceName, SignalRUpdateParameters parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateWithServiceResponseAsync(resourceGroupName, resourceName, parameters), serviceCallback); + } + + /** + * Operation to update an exiting SignalR service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param resourceName The name of the SignalR resource. + * @param parameters Parameters for the update operation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SignalRResourceInner object + */ + public Observable beginUpdateAsync(String resourceGroupName, String resourceName, SignalRUpdateParameters parameters) { + return beginUpdateWithServiceResponseAsync(resourceGroupName, resourceName, parameters).map(new Func1, SignalRResourceInner>() { + @Override + public SignalRResourceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Operation to update an exiting SignalR service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param resourceName The name of the SignalR resource. + * @param parameters Parameters for the update operation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SignalRResourceInner object + */ + public Observable> beginUpdateWithServiceResponseAsync(String resourceGroupName, String resourceName, SignalRUpdateParameters 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 (resourceName == null) { + throw new IllegalArgumentException("Parameter resourceName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(parameters); + return service.beginUpdate(this.client.subscriptionId(), resourceGroupName, resourceName, parameters, this.client.apiVersion(), 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 CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Handles requests to list all resources in a subscription. + * + * @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<SignalRResourceInner> 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(); + } + }; + } + + /** + * Handles requests to list all resources in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Handles requests to list all resources in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<SignalRResourceInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Handles requests to list all resources in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<SignalRResourceInner> 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)); + } + }); + } + + /** + * Handles requests to list all resources in a subscription. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<SignalRResourceInner> 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); + } + + /** + * Handles requests to list all resources 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 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<SignalRResourceInner> 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(); + } + }; + } + + /** + * Handles requests to list all resources 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); + } + + /** + * Handles requests to list all resources 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<SignalRResourceInner> object + */ + public Observable> listByResourceGroupNextAsync(final String nextPageLink) { + return listByResourceGroupNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Handles requests to list all resources 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<SignalRResourceInner> 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)); + } + }); + } + + /** + * Handles requests to list all resources 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<SignalRResourceInner> 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); + } + +} diff --git a/signalr/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/signalr/v2018_10_01/implementation/UsagesImpl.java b/signalr/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/signalr/v2018_10_01/implementation/UsagesImpl.java new file mode 100644 index 000000000000..1c971f5b65a8 --- /dev/null +++ b/signalr/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/signalr/v2018_10_01/implementation/UsagesImpl.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.signalr.v2018_10_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.signalr.v2018_10_01.Usages; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.signalr.v2018_10_01.SignalRUsage; + +class UsagesImpl extends WrapperImpl implements Usages { + private final SignalRServiceManager manager; + + UsagesImpl(SignalRServiceManager manager) { + super(manager.inner().usages()); + this.manager = manager; + } + + public SignalRServiceManager manager() { + return this.manager; + } + + private SignalRUsageImpl wrapModel(SignalRUsageInner inner) { + return new SignalRUsageImpl(inner, manager()); + } + + @Override + public Observable listAsync(final String location) { + UsagesInner client = this.inner(); + return client.listAsync(location) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public SignalRUsage call(SignalRUsageInner inner) { + return wrapModel(inner); + } + }); + } + +} diff --git a/signalr/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/signalr/v2018_10_01/implementation/UsagesInner.java b/signalr/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/signalr/v2018_10_01/implementation/UsagesInner.java new file mode 100644 index 000000000000..475fc7a3ae8a --- /dev/null +++ b/signalr/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/signalr/v2018_10_01/implementation/UsagesInner.java @@ -0,0 +1,295 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.signalr.v2018_10_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.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.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 Usages. + */ +public class UsagesInner { + /** The Retrofit service to perform REST calls. */ + private UsagesService service; + /** The service client containing this operation class. */ + private SignalRManagementClientImpl client; + + /** + * Initializes an instance of UsagesInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public UsagesInner(Retrofit retrofit, SignalRManagementClientImpl client) { + this.service = retrofit.create(UsagesService.class); + this.client = client; + } + + /** + * The interface defining all the services for Usages to be + * used by Retrofit to perform actually REST calls. + */ + interface UsagesService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.signalr.v2018_10_01.Usages list" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.SignalRService/locations/{location}/usages") + Observable> list(@Path("location") String location, @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.signalr.v2018_10_01.Usages listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * List usage quotas for Azure SignalR service by location. + * + * @param location the location like "eastus" + * @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<SignalRUsageInner> object if successful. + */ + public PagedList list(final String location) { + ServiceResponse> response = listSinglePageAsync(location).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List usage quotas for Azure SignalR service by location. + * + * @param location the location like "eastus" + * @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 location, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(location), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List usage quotas for Azure SignalR service by location. + * + * @param location the location like "eastus" + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<SignalRUsageInner> object + */ + public Observable> listAsync(final String location) { + return listWithServiceResponseAsync(location) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List usage quotas for Azure SignalR service by location. + * + * @param location the location like "eastus" + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<SignalRUsageInner> object + */ + public Observable>> listWithServiceResponseAsync(final String location) { + return listSinglePageAsync(location) + .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)); + } + }); + } + + /** + * List usage quotas for Azure SignalR service by location. + * + ServiceResponse> * @param location the location like "eastus" + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<SignalRUsageInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync(final String location) { + if (location == null) { + throw new IllegalArgumentException("Parameter location 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(location, 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); + } + + /** + * List usage quotas for Azure SignalR service by location. + * + * @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<SignalRUsageInner> 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(); + } + }; + } + + /** + * List usage quotas for Azure SignalR service by location. + * + * @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); + } + + /** + * List usage quotas for Azure SignalR service by location. + * + * @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<SignalRUsageInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List usage quotas for Azure SignalR service by location. + * + * @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<SignalRUsageInner> 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)); + } + }); + } + + /** + * List usage quotas for Azure SignalR service by location. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<SignalRUsageInner> 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); + } + +} diff --git a/signalr/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/signalr/v2018_10_01/implementation/package-info.java b/signalr/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/signalr/v2018_10_01/implementation/package-info.java new file mode 100644 index 000000000000..9c1cd75831a0 --- /dev/null +++ b/signalr/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/signalr/v2018_10_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 SignalRManagementClient. + * REST API for Azure SignalR Service. + */ +package com.microsoft.azure.management.signalr.v2018_10_01.implementation; diff --git a/signalr/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/signalr/v2018_10_01/package-info.java b/signalr/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/signalr/v2018_10_01/package-info.java new file mode 100644 index 000000000000..ec8875797b25 --- /dev/null +++ b/signalr/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/signalr/v2018_10_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 SignalRManagementClient. + * REST API for Azure SignalR Service. + */ +package com.microsoft.azure.management.signalr.v2018_10_01;