diff --git a/sdk/mixedreality/mgmt-v2020_05_01/pom.xml b/sdk/mixedreality/mgmt-v2020_05_01/pom.xml new file mode 100644 index 000000000000..8c4b03b894a2 --- /dev/null +++ b/sdk/mixedreality/mgmt-v2020_05_01/pom.xml @@ -0,0 +1,135 @@ + + + 4.0.0 + com.microsoft.azure.mixedreality.v2020_05_01 + + com.microsoft.azure + azure-arm-parent + 1.1.0 + ../../../pom.management.xml + + azure-mgmt-mixedreality + 1.0.0-beta + jar + Microsoft Azure SDK for MixedReality Management + This package contains Microsoft MixedReality Management SDK. + https://github.com/Azure/azure-sdk-for-java + + + The MIT License (MIT) + http://opensource.org/licenses/MIT + repo + + + + scm:git:https://github.com/Azure/azure-sdk-for-java + scm:git:git@github.com:Azure/azure-sdk-for-java.git + HEAD + + + UTF-8 + + + + + microsoft + Microsoft + + + + + com.microsoft.azure + azure-client-runtime + + + com.microsoft.azure + azure-arm-client-runtime + + + junit + junit + test + + + com.microsoft.azure + azure-client-authentication + test + + + com.microsoft.azure + azure-mgmt-resources + test + + + com.microsoft.azure + azure-arm-client-runtime + test-jar + test + + 1.6.5 + + + + + + org.apache.maven.plugins + maven-jar-plugin + + + + true + true + + + + + + org.codehaus.mojo + build-helper-maven-plugin + + + org.apache.maven.plugins + maven-compiler-plugin + 3.1 + + 1.7 + 1.7 + + + com.microsoft.azure.management.apigeneration.LangDefinitionProcessor + + + true + true + + true + true + + + + + org.apache.maven.plugins + maven-javadoc-plugin + 2.8 + + *.implementation.*;*.utils.*;com.microsoft.schemas._2003._10.serialization;*.blob.core.search + + + /** +
* Copyright (c) Microsoft Corporation. All rights reserved. +
* Licensed under the MIT License. See License.txt in the project root for +
* license information. +
*/ + ]]> +
+
+
+
+
+
diff --git a/sdk/mixedreality/mgmt-v2020_05_01/src/main/java/com/microsoft/azure/management/mixedreality/v2020_05_01/AccountKeyRegenerateRequest.java b/sdk/mixedreality/mgmt-v2020_05_01/src/main/java/com/microsoft/azure/management/mixedreality/v2020_05_01/AccountKeyRegenerateRequest.java new file mode 100644 index 000000000000..70d339d73c12 --- /dev/null +++ b/sdk/mixedreality/mgmt-v2020_05_01/src/main/java/com/microsoft/azure/management/mixedreality/v2020_05_01/AccountKeyRegenerateRequest.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.mixedreality.v2020_05_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Request for account key regeneration. + */ +public class AccountKeyRegenerateRequest { + /** + * serial of key to be regenerated. + */ + @JsonProperty(value = "serial") + private Integer serial; + + /** + * Get serial of key to be regenerated. + * + * @return the serial value + */ + public Integer serial() { + return this.serial; + } + + /** + * Set serial of key to be regenerated. + * + * @param serial the serial value to set + * @return the AccountKeyRegenerateRequest object itself. + */ + public AccountKeyRegenerateRequest withSerial(Integer serial) { + this.serial = serial; + return this; + } + +} diff --git a/sdk/mixedreality/mgmt-v2020_05_01/src/main/java/com/microsoft/azure/management/mixedreality/v2020_05_01/AccountKeys.java b/sdk/mixedreality/mgmt-v2020_05_01/src/main/java/com/microsoft/azure/management/mixedreality/v2020_05_01/AccountKeys.java new file mode 100644 index 000000000000..44d191abc2b9 --- /dev/null +++ b/sdk/mixedreality/mgmt-v2020_05_01/src/main/java/com/microsoft/azure/management/mixedreality/v2020_05_01/AccountKeys.java @@ -0,0 +1,30 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mixedreality.v2020_05_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.mixedreality.v2020_05_01.implementation.MixedRealityManager; +import com.microsoft.azure.management.mixedreality.v2020_05_01.implementation.AccountKeysInner; + +/** + * Type representing AccountKeys. + */ +public interface AccountKeys extends HasInner, HasManager { + /** + * @return the primaryKey value. + */ + String primaryKey(); + + /** + * @return the secondaryKey value. + */ + String secondaryKey(); + +} diff --git a/sdk/mixedreality/mgmt-v2020_05_01/src/main/java/com/microsoft/azure/management/mixedreality/v2020_05_01/AzureEntityResource.java b/sdk/mixedreality/mgmt-v2020_05_01/src/main/java/com/microsoft/azure/management/mixedreality/v2020_05_01/AzureEntityResource.java new file mode 100644 index 000000000000..0d843a1ce4e7 --- /dev/null +++ b/sdk/mixedreality/mgmt-v2020_05_01/src/main/java/com/microsoft/azure/management/mixedreality/v2020_05_01/AzureEntityResource.java @@ -0,0 +1,34 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mixedreality.v2020_05_01; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.azure.ProxyResource; + +/** + * The resource model definition for a Azure Resource Manager resource with an + * etag. + */ +public class AzureEntityResource extends ProxyResource { + /** + * Resource Etag. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /** + * Get resource Etag. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + +} diff --git a/sdk/mixedreality/mgmt-v2020_05_01/src/main/java/com/microsoft/azure/management/mixedreality/v2020_05_01/CheckNameAvailabilityRequest.java b/sdk/mixedreality/mgmt-v2020_05_01/src/main/java/com/microsoft/azure/management/mixedreality/v2020_05_01/CheckNameAvailabilityRequest.java new file mode 100644 index 000000000000..4e07fe95bb46 --- /dev/null +++ b/sdk/mixedreality/mgmt-v2020_05_01/src/main/java/com/microsoft/azure/management/mixedreality/v2020_05_01/CheckNameAvailabilityRequest.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.mixedreality.v2020_05_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Check Name Availability Request. + */ +public class CheckNameAvailabilityRequest { + /** + * Resource Name To Verify. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /** + * Fully qualified resource type which includes provider namespace. + */ + @JsonProperty(value = "type", required = true) + private String type; + + /** + * Get resource Name To Verify. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set resource Name To Verify. + * + * @param name the name value to set + * @return the CheckNameAvailabilityRequest object itself. + */ + public CheckNameAvailabilityRequest withName(String name) { + this.name = name; + return this; + } + + /** + * Get fully qualified resource type which includes provider namespace. + * + * @return the type value + */ + public String type() { + return this.type; + } + + /** + * Set fully qualified resource type which includes provider namespace. + * + * @param type the type value to set + * @return the CheckNameAvailabilityRequest object itself. + */ + public CheckNameAvailabilityRequest withType(String type) { + this.type = type; + return this; + } + +} diff --git a/sdk/mixedreality/mgmt-v2020_05_01/src/main/java/com/microsoft/azure/management/mixedreality/v2020_05_01/Identity.java b/sdk/mixedreality/mgmt-v2020_05_01/src/main/java/com/microsoft/azure/management/mixedreality/v2020_05_01/Identity.java new file mode 100644 index 000000000000..bff6637b5859 --- /dev/null +++ b/sdk/mixedreality/mgmt-v2020_05_01/src/main/java/com/microsoft/azure/management/mixedreality/v2020_05_01/Identity.java @@ -0,0 +1,73 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mixedreality.v2020_05_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Identity for the resource. + */ +public class Identity { + /** + * The principal ID of resource identity. + */ + @JsonProperty(value = "principalId", access = JsonProperty.Access.WRITE_ONLY) + private String principalId; + + /** + * The tenant ID of resource. + */ + @JsonProperty(value = "tenantId", access = JsonProperty.Access.WRITE_ONLY) + private String tenantId; + + /** + * The identity type. Possible values include: 'SystemAssigned'. + */ + @JsonProperty(value = "type") + private ResourceIdentityType type; + + /** + * Get the principal ID of resource identity. + * + * @return the principalId value + */ + public String principalId() { + return this.principalId; + } + + /** + * Get the tenant ID of resource. + * + * @return the tenantId value + */ + public String tenantId() { + return this.tenantId; + } + + /** + * Get the identity type. Possible values include: 'SystemAssigned'. + * + * @return the type value + */ + public ResourceIdentityType type() { + return this.type; + } + + /** + * Set the identity type. Possible values include: 'SystemAssigned'. + * + * @param type the type value to set + * @return the Identity object itself. + */ + public Identity withType(ResourceIdentityType type) { + this.type = type; + return this; + } + +} diff --git a/sdk/mixedreality/mgmt-v2020_05_01/src/main/java/com/microsoft/azure/management/mixedreality/v2020_05_01/NameAvailability.java b/sdk/mixedreality/mgmt-v2020_05_01/src/main/java/com/microsoft/azure/management/mixedreality/v2020_05_01/NameAvailability.java new file mode 100644 index 000000000000..05aa92146dd2 --- /dev/null +++ b/sdk/mixedreality/mgmt-v2020_05_01/src/main/java/com/microsoft/azure/management/mixedreality/v2020_05_01/NameAvailability.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.mixedreality.v2020_05_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for NameAvailability. + */ +public final class NameAvailability extends ExpandableStringEnum { + /** Static value true for NameAvailability. */ + public static final NameAvailability TRUE = fromString("true"); + + /** Static value false for NameAvailability. */ + public static final NameAvailability FALSE = fromString("false"); + + /** + * Creates or finds a NameAvailability from its string representation. + * @param name a name to look for + * @return the corresponding NameAvailability + */ + @JsonCreator + public static NameAvailability fromString(String name) { + return fromString(name, NameAvailability.class); + } + + /** + * @return known NameAvailability values + */ + public static Collection values() { + return values(NameAvailability.class); + } +} diff --git a/sdk/mixedreality/mgmt-v2020_05_01/src/main/java/com/microsoft/azure/management/mixedreality/v2020_05_01/NameUnavailableReason.java b/sdk/mixedreality/mgmt-v2020_05_01/src/main/java/com/microsoft/azure/management/mixedreality/v2020_05_01/NameUnavailableReason.java new file mode 100644 index 000000000000..01cab8b317c0 --- /dev/null +++ b/sdk/mixedreality/mgmt-v2020_05_01/src/main/java/com/microsoft/azure/management/mixedreality/v2020_05_01/NameUnavailableReason.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.mixedreality.v2020_05_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for NameUnavailableReason. + */ +public final class NameUnavailableReason extends ExpandableStringEnum { + /** Static value Invalid for NameUnavailableReason. */ + public static final NameUnavailableReason INVALID = fromString("Invalid"); + + /** Static value AlreadyExists for NameUnavailableReason. */ + public static final NameUnavailableReason ALREADY_EXISTS = fromString("AlreadyExists"); + + /** + * Creates or finds a NameUnavailableReason from its string representation. + * @param name a name to look for + * @return the corresponding NameUnavailableReason + */ + @JsonCreator + public static NameUnavailableReason fromString(String name) { + return fromString(name, NameUnavailableReason.class); + } + + /** + * @return known NameUnavailableReason values + */ + public static Collection values() { + return values(NameUnavailableReason.class); + } +} diff --git a/sdk/mixedreality/mgmt-v2020_05_01/src/main/java/com/microsoft/azure/management/mixedreality/v2020_05_01/Operation.java b/sdk/mixedreality/mgmt-v2020_05_01/src/main/java/com/microsoft/azure/management/mixedreality/v2020_05_01/Operation.java new file mode 100644 index 000000000000..7ccd2d542798 --- /dev/null +++ b/sdk/mixedreality/mgmt-v2020_05_01/src/main/java/com/microsoft/azure/management/mixedreality/v2020_05_01/Operation.java @@ -0,0 +1,30 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mixedreality.v2020_05_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.mixedreality.v2020_05_01.implementation.MixedRealityManager; +import com.microsoft.azure.management.mixedreality.v2020_05_01.implementation.OperationInner; + +/** + * Type representing Operation. + */ +public interface Operation extends HasInner, HasManager { + /** + * @return the display value. + */ + OperationDisplay display(); + + /** + * @return the name value. + */ + String name(); + +} diff --git a/sdk/mixedreality/mgmt-v2020_05_01/src/main/java/com/microsoft/azure/management/mixedreality/v2020_05_01/OperationDisplay.java b/sdk/mixedreality/mgmt-v2020_05_01/src/main/java/com/microsoft/azure/management/mixedreality/v2020_05_01/OperationDisplay.java new file mode 100644 index 000000000000..439f253b2806 --- /dev/null +++ b/sdk/mixedreality/mgmt-v2020_05_01/src/main/java/com/microsoft/azure/management/mixedreality/v2020_05_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.mixedreality.v2020_05_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The object that represents the operation. + */ +public class OperationDisplay { + /** + * Service provider: Microsoft.ResourceProvider. + */ + @JsonProperty(value = "provider", required = true) + private String provider; + + /** + * Resource on which the operation is performed: Profile, endpoint, etc. + */ + @JsonProperty(value = "resource", required = true) + private String resource; + + /** + * Operation type: Read, write, delete, etc. + */ + @JsonProperty(value = "operation", required = true) + private String operation; + + /** + * Description of operation. + */ + @JsonProperty(value = "description", required = true) + private String description; + + /** + * Get service provider: Microsoft.ResourceProvider. + * + * @return the provider value + */ + public String provider() { + return this.provider; + } + + /** + * Set service provider: Microsoft.ResourceProvider. + * + * @param provider the provider value to set + * @return the OperationDisplay object itself. + */ + public OperationDisplay withProvider(String provider) { + this.provider = provider; + return this; + } + + /** + * Get resource on which the operation is performed: Profile, endpoint, etc. + * + * @return the resource value + */ + public String resource() { + return this.resource; + } + + /** + * Set resource on which the operation is performed: Profile, endpoint, etc. + * + * @param resource the resource value to set + * @return the OperationDisplay object itself. + */ + public OperationDisplay withResource(String resource) { + this.resource = resource; + return this; + } + + /** + * Get operation type: Read, write, delete, etc. + * + * @return the operation value + */ + public String operation() { + return this.operation; + } + + /** + * Set operation type: Read, write, delete, etc. + * + * @param operation the operation value to set + * @return the OperationDisplay object itself. + */ + public OperationDisplay withOperation(String operation) { + this.operation = operation; + return this; + } + + /** + * Get description of operation. + * + * @return the description value + */ + public String description() { + return this.description; + } + + /** + * Set description of 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/sdk/mixedreality/mgmt-v2020_05_01/src/main/java/com/microsoft/azure/management/mixedreality/v2020_05_01/Operations.java b/sdk/mixedreality/mgmt-v2020_05_01/src/main/java/com/microsoft/azure/management/mixedreality/v2020_05_01/Operations.java new file mode 100644 index 000000000000..462d2183822e --- /dev/null +++ b/sdk/mixedreality/mgmt-v2020_05_01/src/main/java/com/microsoft/azure/management/mixedreality/v2020_05_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.mixedreality.v2020_05_01; + +import rx.Observable; +import com.microsoft.azure.management.mixedreality.v2020_05_01.implementation.OperationsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing Operations. + */ +public interface Operations extends HasInner { + /** + * Exposing Available Operations. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(); + +} diff --git a/sdk/mixedreality/mgmt-v2020_05_01/src/main/java/com/microsoft/azure/management/mixedreality/v2020_05_01/Plan.java b/sdk/mixedreality/mgmt-v2020_05_01/src/main/java/com/microsoft/azure/management/mixedreality/v2020_05_01/Plan.java new file mode 100644 index 000000000000..8482cfa6df20 --- /dev/null +++ b/sdk/mixedreality/mgmt-v2020_05_01/src/main/java/com/microsoft/azure/management/mixedreality/v2020_05_01/Plan.java @@ -0,0 +1,151 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mixedreality.v2020_05_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Plan for the resource. + */ +public class Plan { + /** + * A user defined name of the 3rd Party Artifact that is being procured. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /** + * The publisher of the 3rd Party Artifact that is being bought. E.g. + * NewRelic. + */ + @JsonProperty(value = "publisher", required = true) + private String publisher; + + /** + * The 3rd Party artifact that is being procured. E.g. NewRelic. Product + * maps to the OfferID specified for the artifact at the time of Data + * Market onboarding. + */ + @JsonProperty(value = "product", required = true) + private String product; + + /** + * A publisher provided promotion code as provisioned in Data Market for + * the said product/artifact. + */ + @JsonProperty(value = "promotionCode") + private String promotionCode; + + /** + * The version of the desired product/artifact. + */ + @JsonProperty(value = "version") + private String version; + + /** + * Get a user defined name of the 3rd Party Artifact that is being procured. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set a user defined name of the 3rd Party Artifact that is being procured. + * + * @param name the name value to set + * @return the Plan object itself. + */ + public Plan withName(String name) { + this.name = name; + return this; + } + + /** + * Get the publisher of the 3rd Party Artifact that is being bought. E.g. NewRelic. + * + * @return the publisher value + */ + public String publisher() { + return this.publisher; + } + + /** + * Set the publisher of the 3rd Party Artifact that is being bought. E.g. NewRelic. + * + * @param publisher the publisher value to set + * @return the Plan object itself. + */ + public Plan withPublisher(String publisher) { + this.publisher = publisher; + return this; + } + + /** + * Get the 3rd Party artifact that is being procured. E.g. NewRelic. Product maps to the OfferID specified for the artifact at the time of Data Market onboarding. + * + * @return the product value + */ + public String product() { + return this.product; + } + + /** + * Set the 3rd Party artifact that is being procured. E.g. NewRelic. Product maps to the OfferID specified for the artifact at the time of Data Market onboarding. + * + * @param product the product value to set + * @return the Plan object itself. + */ + public Plan withProduct(String product) { + this.product = product; + return this; + } + + /** + * Get a publisher provided promotion code as provisioned in Data Market for the said product/artifact. + * + * @return the promotionCode value + */ + public String promotionCode() { + return this.promotionCode; + } + + /** + * Set a publisher provided promotion code as provisioned in Data Market for the said product/artifact. + * + * @param promotionCode the promotionCode value to set + * @return the Plan object itself. + */ + public Plan withPromotionCode(String promotionCode) { + this.promotionCode = promotionCode; + return this; + } + + /** + * Get the version of the desired product/artifact. + * + * @return the version value + */ + public String version() { + return this.version; + } + + /** + * Set the version of the desired product/artifact. + * + * @param version the version value to set + * @return the Plan object itself. + */ + public Plan withVersion(String version) { + this.version = version; + return this; + } + +} diff --git a/sdk/mixedreality/mgmt-v2020_05_01/src/main/java/com/microsoft/azure/management/mixedreality/v2020_05_01/RemoteRenderingAccount.java b/sdk/mixedreality/mgmt-v2020_05_01/src/main/java/com/microsoft/azure/management/mixedreality/v2020_05_01/RemoteRenderingAccount.java new file mode 100644 index 000000000000..ce85b508735f --- /dev/null +++ b/sdk/mixedreality/mgmt-v2020_05_01/src/main/java/com/microsoft/azure/management/mixedreality/v2020_05_01/RemoteRenderingAccount.java @@ -0,0 +1,107 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mixedreality.v2020_05_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.Resource; +import com.microsoft.azure.arm.resources.models.GroupableResourceCore; +import com.microsoft.azure.arm.resources.models.HasResourceGroup; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.mixedreality.v2020_05_01.implementation.MixedRealityManager; +import com.microsoft.azure.management.mixedreality.v2020_05_01.implementation.RemoteRenderingAccountInner; + +/** + * Type representing RemoteRenderingAccount. + */ +public interface RemoteRenderingAccount extends HasInner, Resource, GroupableResourceCore, HasResourceGroup, Refreshable, Updatable, HasManager { + /** + * @return the accountDomain value. + */ + String accountDomain(); + + /** + * @return the accountId value. + */ + String accountId(); + + /** + * @return the identity value. + */ + RemoteRenderingAccountIdentity identity(); + + /** + * The entirety of the RemoteRenderingAccount definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithGroup, DefinitionStages.WithCreate { + } + + /** + * Grouping of RemoteRenderingAccount definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a RemoteRenderingAccount definition. + */ + interface Blank extends GroupableResourceCore.DefinitionWithRegion { + } + + /** + * The stage of the RemoteRenderingAccount definition allowing to specify the resource group. + */ + interface WithGroup extends GroupableResourceCore.DefinitionStages.WithGroup { + } + + /** + * The stage of the remoterenderingaccount definition allowing to specify Identity. + */ + interface WithIdentity { + /** + * Specifies identity. + * @param identity the identity parameter value + * @return the next definition stage + */ + WithCreate withIdentity(RemoteRenderingAccountIdentity identity); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, Resource.DefinitionWithTags, DefinitionStages.WithIdentity { + } + } + /** + * The template for a RemoteRenderingAccount update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, Resource.UpdateWithTags, UpdateStages.WithIdentity { + } + + /** + * Grouping of RemoteRenderingAccount update stages. + */ + interface UpdateStages { + /** + * The stage of the remoterenderingaccount update allowing to specify Identity. + */ + interface WithIdentity { + /** + * Specifies identity. + * @param identity the identity parameter value + * @return the next update stage + */ + Update withIdentity(RemoteRenderingAccountIdentity identity); + } + + } +} diff --git a/sdk/mixedreality/mgmt-v2020_05_01/src/main/java/com/microsoft/azure/management/mixedreality/v2020_05_01/RemoteRenderingAccountIdentity.java b/sdk/mixedreality/mgmt-v2020_05_01/src/main/java/com/microsoft/azure/management/mixedreality/v2020_05_01/RemoteRenderingAccountIdentity.java new file mode 100644 index 000000000000..79f7d144a5d7 --- /dev/null +++ b/sdk/mixedreality/mgmt-v2020_05_01/src/main/java/com/microsoft/azure/management/mixedreality/v2020_05_01/RemoteRenderingAccountIdentity.java @@ -0,0 +1,16 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mixedreality.v2020_05_01; + + +/** + * The RemoteRenderingAccountIdentity model. + */ +public class RemoteRenderingAccountIdentity extends Identity { +} diff --git a/sdk/mixedreality/mgmt-v2020_05_01/src/main/java/com/microsoft/azure/management/mixedreality/v2020_05_01/RemoteRenderingAccounts.java b/sdk/mixedreality/mgmt-v2020_05_01/src/main/java/com/microsoft/azure/management/mixedreality/v2020_05_01/RemoteRenderingAccounts.java new file mode 100644 index 000000000000..f741d1b5dd7d --- /dev/null +++ b/sdk/mixedreality/mgmt-v2020_05_01/src/main/java/com/microsoft/azure/management/mixedreality/v2020_05_01/RemoteRenderingAccounts.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.mixedreality.v2020_05_01; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import com.microsoft.azure.arm.resources.collection.SupportsDeletingByResourceGroup; +import com.microsoft.azure.arm.resources.collection.SupportsBatchDeletion; +import com.microsoft.azure.arm.resources.collection.SupportsGettingByResourceGroup; +import rx.Observable; +import com.microsoft.azure.arm.resources.collection.SupportsListingByResourceGroup; +import com.microsoft.azure.arm.collection.SupportsListing; +import com.microsoft.azure.management.mixedreality.v2020_05_01.implementation.RemoteRenderingAccountsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing RemoteRenderingAccounts. + */ +public interface RemoteRenderingAccounts extends SupportsCreating, SupportsDeletingByResourceGroup, SupportsBatchDeletion, SupportsGettingByResourceGroup, SupportsListingByResourceGroup, SupportsListing, HasInner { + /** + * List Both of the 2 Keys of a Remote Rendering Account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Name of an Mixed Reality Account. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listKeysAsync(String resourceGroupName, String accountName); + + /** + * Regenerate specified Key of a Remote Rendering Account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Name of an Mixed Reality Account. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable regenerateKeysAsync(String resourceGroupName, String accountName); + +} diff --git a/sdk/mixedreality/mgmt-v2020_05_01/src/main/java/com/microsoft/azure/management/mixedreality/v2020_05_01/ResourceIdentityType.java b/sdk/mixedreality/mgmt-v2020_05_01/src/main/java/com/microsoft/azure/management/mixedreality/v2020_05_01/ResourceIdentityType.java new file mode 100644 index 000000000000..bb7ce82d3b7e --- /dev/null +++ b/sdk/mixedreality/mgmt-v2020_05_01/src/main/java/com/microsoft/azure/management/mixedreality/v2020_05_01/ResourceIdentityType.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.mixedreality.v2020_05_01; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for ResourceIdentityType. + */ +public enum ResourceIdentityType { + /** Enum value SystemAssigned. */ + SYSTEM_ASSIGNED("SystemAssigned"); + + /** The actual serialized value for a ResourceIdentityType instance. */ + private String value; + + ResourceIdentityType(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a ResourceIdentityType instance. + * + * @param value the serialized value to parse. + * @return the parsed ResourceIdentityType object, or null if unable to parse. + */ + @JsonCreator + public static ResourceIdentityType fromString(String value) { + ResourceIdentityType[] items = ResourceIdentityType.values(); + for (ResourceIdentityType item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/mixedreality/mgmt-v2020_05_01/src/main/java/com/microsoft/azure/management/mixedreality/v2020_05_01/ResourceModelWithAllowedPropertySet.java b/sdk/mixedreality/mgmt-v2020_05_01/src/main/java/com/microsoft/azure/management/mixedreality/v2020_05_01/ResourceModelWithAllowedPropertySet.java new file mode 100644 index 000000000000..47993acffebd --- /dev/null +++ b/sdk/mixedreality/mgmt-v2020_05_01/src/main/java/com/microsoft/azure/management/mixedreality/v2020_05_01/ResourceModelWithAllowedPropertySet.java @@ -0,0 +1,177 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mixedreality.v2020_05_01; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.azure.Resource; + +/** + * The resource model definition containing the full set of allowed properties + * for a resource. Except properties bag, there cannot be a top level property + * outside of this set. + */ +public class ResourceModelWithAllowedPropertySet extends Resource { + /** + * The fully qualified resource ID of the resource that manages this + * resource. Indicates if this resource is managed by another azure + * resource. If this is present, complete mode deployment will not delete + * the resource if it is removed from the template since it is managed by + * another resource. + */ + @JsonProperty(value = "managedBy") + private String managedBy; + + /** + * Metadata used by portal/tooling/etc to render different UX experiences + * for resources of the same type; e.g. ApiApps are a kind of + * Microsoft.Web/sites type. If supported, the resource provider must + * validate and persist this value. + */ + @JsonProperty(value = "kind") + private String kind; + + /** + * The etag field is *not* required. If it is provided in the response + * body, it must also be provided as a header per the normal etag + * convention. Entity tags are used for comparing two or more entities + * from the same requested resource. HTTP/1.1 uses entity tags in the etag + * (section 14.19), If-Match (section 14.24), If-None-Match (section + * 14.26), and If-Range (section 14.27) header fields. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /** + * The identity property. + */ + @JsonProperty(value = "identity") + private ResourceModelWithAllowedPropertySetIdentity identity; + + /** + * The sku property. + */ + @JsonProperty(value = "sku") + private ResourceModelWithAllowedPropertySetSku sku; + + /** + * The plan property. + */ + @JsonProperty(value = "plan") + private ResourceModelWithAllowedPropertySetPlan plan; + + /** + * Get the fully qualified resource ID of the resource that manages this resource. Indicates if this resource is managed by another azure resource. If this is present, complete mode deployment will not delete the resource if it is removed from the template since it is managed by another resource. + * + * @return the managedBy value + */ + public String managedBy() { + return this.managedBy; + } + + /** + * Set the fully qualified resource ID of the resource that manages this resource. Indicates if this resource is managed by another azure resource. If this is present, complete mode deployment will not delete the resource if it is removed from the template since it is managed by another resource. + * + * @param managedBy the managedBy value to set + * @return the ResourceModelWithAllowedPropertySet object itself. + */ + public ResourceModelWithAllowedPropertySet withManagedBy(String managedBy) { + this.managedBy = managedBy; + return this; + } + + /** + * Get metadata used by portal/tooling/etc to render different UX experiences for resources of the same type; e.g. ApiApps are a kind of Microsoft.Web/sites type. If supported, the resource provider must validate and persist this value. + * + * @return the kind value + */ + public String kind() { + return this.kind; + } + + /** + * Set metadata used by portal/tooling/etc to render different UX experiences for resources of the same type; e.g. ApiApps are a kind of Microsoft.Web/sites type. If supported, the resource provider must validate and persist this value. + * + * @param kind the kind value to set + * @return the ResourceModelWithAllowedPropertySet object itself. + */ + public ResourceModelWithAllowedPropertySet withKind(String kind) { + this.kind = kind; + return this; + } + + /** + * Get the etag field is *not* required. If it is provided in the response body, it must also be provided as a header per the normal etag convention. Entity tags are used for comparing two or more entities from the same requested resource. HTTP/1.1 uses entity tags in the etag (section 14.19), If-Match (section 14.24), If-None-Match (section 14.26), and If-Range (section 14.27) header fields. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + + /** + * Get the identity value. + * + * @return the identity value + */ + public ResourceModelWithAllowedPropertySetIdentity identity() { + return this.identity; + } + + /** + * Set the identity value. + * + * @param identity the identity value to set + * @return the ResourceModelWithAllowedPropertySet object itself. + */ + public ResourceModelWithAllowedPropertySet withIdentity(ResourceModelWithAllowedPropertySetIdentity identity) { + this.identity = identity; + return this; + } + + /** + * Get the sku value. + * + * @return the sku value + */ + public ResourceModelWithAllowedPropertySetSku sku() { + return this.sku; + } + + /** + * Set the sku value. + * + * @param sku the sku value to set + * @return the ResourceModelWithAllowedPropertySet object itself. + */ + public ResourceModelWithAllowedPropertySet withSku(ResourceModelWithAllowedPropertySetSku sku) { + this.sku = sku; + return this; + } + + /** + * Get the plan value. + * + * @return the plan value + */ + public ResourceModelWithAllowedPropertySetPlan plan() { + return this.plan; + } + + /** + * Set the plan value. + * + * @param plan the plan value to set + * @return the ResourceModelWithAllowedPropertySet object itself. + */ + public ResourceModelWithAllowedPropertySet withPlan(ResourceModelWithAllowedPropertySetPlan plan) { + this.plan = plan; + return this; + } + +} diff --git a/sdk/mixedreality/mgmt-v2020_05_01/src/main/java/com/microsoft/azure/management/mixedreality/v2020_05_01/ResourceModelWithAllowedPropertySetIdentity.java b/sdk/mixedreality/mgmt-v2020_05_01/src/main/java/com/microsoft/azure/management/mixedreality/v2020_05_01/ResourceModelWithAllowedPropertySetIdentity.java new file mode 100644 index 000000000000..52553889bb8c --- /dev/null +++ b/sdk/mixedreality/mgmt-v2020_05_01/src/main/java/com/microsoft/azure/management/mixedreality/v2020_05_01/ResourceModelWithAllowedPropertySetIdentity.java @@ -0,0 +1,16 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mixedreality.v2020_05_01; + + +/** + * The ResourceModelWithAllowedPropertySetIdentity model. + */ +public class ResourceModelWithAllowedPropertySetIdentity extends Identity { +} diff --git a/sdk/mixedreality/mgmt-v2020_05_01/src/main/java/com/microsoft/azure/management/mixedreality/v2020_05_01/ResourceModelWithAllowedPropertySetPlan.java b/sdk/mixedreality/mgmt-v2020_05_01/src/main/java/com/microsoft/azure/management/mixedreality/v2020_05_01/ResourceModelWithAllowedPropertySetPlan.java new file mode 100644 index 000000000000..d5fa030bb3dc --- /dev/null +++ b/sdk/mixedreality/mgmt-v2020_05_01/src/main/java/com/microsoft/azure/management/mixedreality/v2020_05_01/ResourceModelWithAllowedPropertySetPlan.java @@ -0,0 +1,16 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mixedreality.v2020_05_01; + + +/** + * The ResourceModelWithAllowedPropertySetPlan model. + */ +public class ResourceModelWithAllowedPropertySetPlan extends Plan { +} diff --git a/sdk/mixedreality/mgmt-v2020_05_01/src/main/java/com/microsoft/azure/management/mixedreality/v2020_05_01/ResourceModelWithAllowedPropertySetSku.java b/sdk/mixedreality/mgmt-v2020_05_01/src/main/java/com/microsoft/azure/management/mixedreality/v2020_05_01/ResourceModelWithAllowedPropertySetSku.java new file mode 100644 index 000000000000..0e71778ab22a --- /dev/null +++ b/sdk/mixedreality/mgmt-v2020_05_01/src/main/java/com/microsoft/azure/management/mixedreality/v2020_05_01/ResourceModelWithAllowedPropertySetSku.java @@ -0,0 +1,16 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mixedreality.v2020_05_01; + + +/** + * The ResourceModelWithAllowedPropertySetSku model. + */ +public class ResourceModelWithAllowedPropertySetSku extends Sku { +} diff --git a/sdk/mixedreality/mgmt-v2020_05_01/src/main/java/com/microsoft/azure/management/mixedreality/v2020_05_01/Sku.java b/sdk/mixedreality/mgmt-v2020_05_01/src/main/java/com/microsoft/azure/management/mixedreality/v2020_05_01/Sku.java new file mode 100644 index 000000000000..c6419045755c --- /dev/null +++ b/sdk/mixedreality/mgmt-v2020_05_01/src/main/java/com/microsoft/azure/management/mixedreality/v2020_05_01/Sku.java @@ -0,0 +1,153 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mixedreality.v2020_05_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The resource model definition representing SKU. + */ +public class Sku { + /** + * The name of the SKU. Ex - P3. It is typically a letter+number code. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /** + * This field is required to be implemented by the Resource Provider if the + * service has more than one tier, but is not required on a PUT. Possible + * values include: 'Free', 'Basic', 'Standard', 'Premium'. + */ + @JsonProperty(value = "tier") + private SkuTier tier; + + /** + * The SKU size. 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; + + /** + * If the service has different generations of hardware, for the same SKU, + * then that can be captured here. + */ + @JsonProperty(value = "family") + private String family; + + /** + * 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. Ex - P3. It is typically a letter+number code. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name of the SKU. Ex - P3. It is typically a letter+number code. + * + * @param name the name value to set + * @return the Sku object itself. + */ + public Sku withName(String name) { + this.name = name; + return this; + } + + /** + * Get this field is required to be implemented by the Resource Provider if the service has more than one tier, but is not required on a PUT. Possible values include: 'Free', 'Basic', 'Standard', 'Premium'. + * + * @return the tier value + */ + public SkuTier tier() { + return this.tier; + } + + /** + * Set this field is required to be implemented by the Resource Provider if the service has more than one tier, but is not required on a PUT. Possible values include: 'Free', 'Basic', 'Standard', 'Premium'. + * + * @param tier the tier value to set + * @return the Sku object itself. + */ + public Sku withTier(SkuTier tier) { + this.tier = tier; + return this; + } + + /** + * Get the SKU size. 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 the SKU size. 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 Sku object itself. + */ + public Sku withSize(String size) { + this.size = size; + return this; + } + + /** + * Get 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 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 Sku object itself. + */ + public Sku withFamily(String family) { + this.family = family; + return this; + } + + /** + * Get 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 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 Sku object itself. + */ + public Sku withCapacity(Integer capacity) { + this.capacity = capacity; + return this; + } + +} diff --git a/sdk/mixedreality/mgmt-v2020_05_01/src/main/java/com/microsoft/azure/management/mixedreality/v2020_05_01/SkuTier.java b/sdk/mixedreality/mgmt-v2020_05_01/src/main/java/com/microsoft/azure/management/mixedreality/v2020_05_01/SkuTier.java new file mode 100644 index 000000000000..3f24db5ed290 --- /dev/null +++ b/sdk/mixedreality/mgmt-v2020_05_01/src/main/java/com/microsoft/azure/management/mixedreality/v2020_05_01/SkuTier.java @@ -0,0 +1,59 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mixedreality.v2020_05_01; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for SkuTier. + */ +public enum SkuTier { + /** Enum value Free. */ + FREE("Free"), + + /** Enum value Basic. */ + BASIC("Basic"), + + /** Enum value Standard. */ + STANDARD("Standard"), + + /** Enum value Premium. */ + PREMIUM("Premium"); + + /** The actual serialized value for a SkuTier instance. */ + private String value; + + SkuTier(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a SkuTier instance. + * + * @param value the serialized value to parse. + * @return the parsed SkuTier object, or null if unable to parse. + */ + @JsonCreator + public static SkuTier fromString(String value) { + SkuTier[] items = SkuTier.values(); + for (SkuTier item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/mixedreality/mgmt-v2020_05_01/src/main/java/com/microsoft/azure/management/mixedreality/v2020_05_01/SpatialAnchorsAccount.java b/sdk/mixedreality/mgmt-v2020_05_01/src/main/java/com/microsoft/azure/management/mixedreality/v2020_05_01/SpatialAnchorsAccount.java new file mode 100644 index 000000000000..bc3a246b80df --- /dev/null +++ b/sdk/mixedreality/mgmt-v2020_05_01/src/main/java/com/microsoft/azure/management/mixedreality/v2020_05_01/SpatialAnchorsAccount.java @@ -0,0 +1,78 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mixedreality.v2020_05_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.Resource; +import com.microsoft.azure.arm.resources.models.GroupableResourceCore; +import com.microsoft.azure.arm.resources.models.HasResourceGroup; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.mixedreality.v2020_05_01.implementation.MixedRealityManager; +import com.microsoft.azure.management.mixedreality.v2020_05_01.implementation.SpatialAnchorsAccountInner; + +/** + * Type representing SpatialAnchorsAccount. + */ +public interface SpatialAnchorsAccount extends HasInner, Resource, GroupableResourceCore, HasResourceGroup, Refreshable, Updatable, HasManager { + /** + * @return the accountDomain value. + */ + String accountDomain(); + + /** + * @return the accountId value. + */ + String accountId(); + + /** + * The entirety of the SpatialAnchorsAccount definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithGroup, DefinitionStages.WithCreate { + } + + /** + * Grouping of SpatialAnchorsAccount definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a SpatialAnchorsAccount definition. + */ + interface Blank extends GroupableResourceCore.DefinitionWithRegion { + } + + /** + * The stage of the SpatialAnchorsAccount definition allowing to specify the resource group. + */ + interface WithGroup extends GroupableResourceCore.DefinitionStages.WithGroup { + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, Resource.DefinitionWithTags { + } + } + /** + * The template for a SpatialAnchorsAccount update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, Resource.UpdateWithTags { + } + + /** + * Grouping of SpatialAnchorsAccount update stages. + */ + interface UpdateStages { + } +} diff --git a/sdk/mixedreality/mgmt-v2020_05_01/src/main/java/com/microsoft/azure/management/mixedreality/v2020_05_01/SpatialAnchorsAccounts.java b/sdk/mixedreality/mgmt-v2020_05_01/src/main/java/com/microsoft/azure/management/mixedreality/v2020_05_01/SpatialAnchorsAccounts.java new file mode 100644 index 000000000000..0ec09087ae65 --- /dev/null +++ b/sdk/mixedreality/mgmt-v2020_05_01/src/main/java/com/microsoft/azure/management/mixedreality/v2020_05_01/SpatialAnchorsAccounts.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.mixedreality.v2020_05_01; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import com.microsoft.azure.arm.resources.collection.SupportsDeletingByResourceGroup; +import com.microsoft.azure.arm.resources.collection.SupportsBatchDeletion; +import com.microsoft.azure.arm.resources.collection.SupportsGettingByResourceGroup; +import rx.Observable; +import com.microsoft.azure.arm.resources.collection.SupportsListingByResourceGroup; +import com.microsoft.azure.arm.collection.SupportsListing; +import com.microsoft.azure.management.mixedreality.v2020_05_01.implementation.SpatialAnchorsAccountsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing SpatialAnchorsAccounts. + */ +public interface SpatialAnchorsAccounts extends SupportsCreating, SupportsDeletingByResourceGroup, SupportsBatchDeletion, SupportsGettingByResourceGroup, SupportsListingByResourceGroup, SupportsListing, HasInner { + /** + * List Both of the 2 Keys of a Spatial Anchors Account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Name of an Mixed Reality Account. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listKeysAsync(String resourceGroupName, String accountName); + + /** + * Regenerate specified Key of a Spatial Anchors Account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Name of an Mixed Reality Account. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable regenerateKeysAsync(String resourceGroupName, String accountName); + +} diff --git a/sdk/mixedreality/mgmt-v2020_05_01/src/main/java/com/microsoft/azure/management/mixedreality/v2020_05_01/implementation/AccountKeysImpl.java b/sdk/mixedreality/mgmt-v2020_05_01/src/main/java/com/microsoft/azure/management/mixedreality/v2020_05_01/implementation/AccountKeysImpl.java new file mode 100644 index 000000000000..b30785a6dd64 --- /dev/null +++ b/sdk/mixedreality/mgmt-v2020_05_01/src/main/java/com/microsoft/azure/management/mixedreality/v2020_05_01/implementation/AccountKeysImpl.java @@ -0,0 +1,36 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mixedreality.v2020_05_01.implementation; + +import com.microsoft.azure.management.mixedreality.v2020_05_01.AccountKeys; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; + +class AccountKeysImpl extends WrapperImpl implements AccountKeys { + private final MixedRealityManager manager; + AccountKeysImpl(AccountKeysInner inner, MixedRealityManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public MixedRealityManager manager() { + return this.manager; + } + + @Override + public String primaryKey() { + return this.inner().primaryKey(); + } + + @Override + public String secondaryKey() { + return this.inner().secondaryKey(); + } + +} diff --git a/sdk/mixedreality/mgmt-v2020_05_01/src/main/java/com/microsoft/azure/management/mixedreality/v2020_05_01/implementation/AccountKeysInner.java b/sdk/mixedreality/mgmt-v2020_05_01/src/main/java/com/microsoft/azure/management/mixedreality/v2020_05_01/implementation/AccountKeysInner.java new file mode 100644 index 000000000000..7b9bce76fc94 --- /dev/null +++ b/sdk/mixedreality/mgmt-v2020_05_01/src/main/java/com/microsoft/azure/management/mixedreality/v2020_05_01/implementation/AccountKeysInner.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.mixedreality.v2020_05_01.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Developer Keys of account. + */ +public class AccountKeysInner { + /** + * value of primary key. + */ + @JsonProperty(value = "primaryKey", access = JsonProperty.Access.WRITE_ONLY) + private String primaryKey; + + /** + * value of secondary key. + */ + @JsonProperty(value = "secondaryKey", access = JsonProperty.Access.WRITE_ONLY) + private String secondaryKey; + + /** + * Get value of primary key. + * + * @return the primaryKey value + */ + public String primaryKey() { + return this.primaryKey; + } + + /** + * Get value of secondary key. + * + * @return the secondaryKey value + */ + public String secondaryKey() { + return this.secondaryKey; + } + +} diff --git a/sdk/mixedreality/mgmt-v2020_05_01/src/main/java/com/microsoft/azure/management/mixedreality/v2020_05_01/implementation/CheckNameAvailabilityResponseInner.java b/sdk/mixedreality/mgmt-v2020_05_01/src/main/java/com/microsoft/azure/management/mixedreality/v2020_05_01/implementation/CheckNameAvailabilityResponseInner.java new file mode 100644 index 000000000000..f9e9103603fa --- /dev/null +++ b/sdk/mixedreality/mgmt-v2020_05_01/src/main/java/com/microsoft/azure/management/mixedreality/v2020_05_01/implementation/CheckNameAvailabilityResponseInner.java @@ -0,0 +1,98 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mixedreality.v2020_05_01.implementation; + +import com.microsoft.azure.management.mixedreality.v2020_05_01.NameAvailability; +import com.microsoft.azure.management.mixedreality.v2020_05_01.NameUnavailableReason; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Check Name Availability Response. + */ +public class CheckNameAvailabilityResponseInner { + /** + * if name Available. Possible values include: 'true', 'false'. + */ + @JsonProperty(value = "nameAvailable", required = true) + private NameAvailability nameAvailable; + + /** + * Resource Name To Verify. Possible values include: 'Invalid', + * 'AlreadyExists'. + */ + @JsonProperty(value = "reason") + private NameUnavailableReason reason; + + /** + * detail message. + */ + @JsonProperty(value = "message") + private String message; + + /** + * Get if name Available. Possible values include: 'true', 'false'. + * + * @return the nameAvailable value + */ + public NameAvailability nameAvailable() { + return this.nameAvailable; + } + + /** + * Set if name Available. Possible values include: 'true', 'false'. + * + * @param nameAvailable the nameAvailable value to set + * @return the CheckNameAvailabilityResponseInner object itself. + */ + public CheckNameAvailabilityResponseInner withNameAvailable(NameAvailability nameAvailable) { + this.nameAvailable = nameAvailable; + return this; + } + + /** + * Get resource Name To Verify. Possible values include: 'Invalid', 'AlreadyExists'. + * + * @return the reason value + */ + public NameUnavailableReason reason() { + return this.reason; + } + + /** + * Set resource Name To Verify. Possible values include: 'Invalid', 'AlreadyExists'. + * + * @param reason the reason value to set + * @return the CheckNameAvailabilityResponseInner object itself. + */ + public CheckNameAvailabilityResponseInner withReason(NameUnavailableReason reason) { + this.reason = reason; + return this; + } + + /** + * Get detail message. + * + * @return the message value + */ + public String message() { + return this.message; + } + + /** + * Set detail message. + * + * @param message the message value to set + * @return the CheckNameAvailabilityResponseInner object itself. + */ + public CheckNameAvailabilityResponseInner withMessage(String message) { + this.message = message; + return this; + } + +} diff --git a/sdk/mixedreality/mgmt-v2020_05_01/src/main/java/com/microsoft/azure/management/mixedreality/v2020_05_01/implementation/IdParsingUtils.java b/sdk/mixedreality/mgmt-v2020_05_01/src/main/java/com/microsoft/azure/management/mixedreality/v2020_05_01/implementation/IdParsingUtils.java new file mode 100644 index 000000000000..1399bbf1697f --- /dev/null +++ b/sdk/mixedreality/mgmt-v2020_05_01/src/main/java/com/microsoft/azure/management/mixedreality/v2020_05_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.mixedreality.v2020_05_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/sdk/mixedreality/mgmt-v2020_05_01/src/main/java/com/microsoft/azure/management/mixedreality/v2020_05_01/implementation/MixedRealityClientImpl.java b/sdk/mixedreality/mgmt-v2020_05_01/src/main/java/com/microsoft/azure/management/mixedreality/v2020_05_01/implementation/MixedRealityClientImpl.java new file mode 100644 index 000000000000..e440ae1b030b --- /dev/null +++ b/sdk/mixedreality/mgmt-v2020_05_01/src/main/java/com/microsoft/azure/management/mixedreality/v2020_05_01/implementation/MixedRealityClientImpl.java @@ -0,0 +1,333 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mixedreality.v2020_05_01.implementation; + +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureClient; +import com.microsoft.azure.AzureServiceClient; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.management.mixedreality.v2020_05_01.CheckNameAvailabilityRequest; +import com.microsoft.rest.credentials.ServiceClientCredentials; +import com.microsoft.rest.RestClient; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Path; +import retrofit2.http.POST; +import retrofit2.http.Query; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * Initializes a new instance of the MixedRealityClientImpl class. + */ +public class MixedRealityClientImpl extends AzureServiceClient { + /** The Retrofit service to perform REST calls. */ + private MixedRealityClientService service; + /** the {@link AzureClient} used for long running operations. */ + private AzureClient azureClient; + + /** + * Gets the {@link AzureClient} used for long running operations. + * @return the azure client; + */ + public AzureClient getAzureClient() { + return this.azureClient; + } + + /** The Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000). */ + private String subscriptionId; + + /** + * Gets The Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000). + * + * @return the subscriptionId value. + */ + public String subscriptionId() { + return this.subscriptionId; + } + + /** + * Sets The Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000). + * + * @param subscriptionId the subscriptionId value. + * @return the service client itself + */ + public MixedRealityClientImpl withSubscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; + return this; + } + + /** The preferred language for the response. */ + private String acceptLanguage; + + /** + * Gets The preferred language for the response. + * + * @return the acceptLanguage value. + */ + public String acceptLanguage() { + return this.acceptLanguage; + } + + /** + * Sets The preferred language for the response. + * + * @param acceptLanguage the acceptLanguage value. + * @return the service client itself + */ + public MixedRealityClientImpl withAcceptLanguage(String acceptLanguage) { + this.acceptLanguage = acceptLanguage; + return this; + } + + /** The retry timeout in seconds for Long Running Operations. Default value is 30. */ + private int longRunningOperationRetryTimeout; + + /** + * Gets The retry timeout in seconds for Long Running Operations. Default value is 30. + * + * @return the longRunningOperationRetryTimeout value. + */ + public int longRunningOperationRetryTimeout() { + return this.longRunningOperationRetryTimeout; + } + + /** + * Sets The retry timeout in seconds for Long Running Operations. Default value is 30. + * + * @param longRunningOperationRetryTimeout the longRunningOperationRetryTimeout value. + * @return the service client itself + */ + public MixedRealityClientImpl withLongRunningOperationRetryTimeout(int longRunningOperationRetryTimeout) { + this.longRunningOperationRetryTimeout = longRunningOperationRetryTimeout; + return this; + } + + /** Whether a unique x-ms-client-request-id should be generated. When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. */ + private boolean generateClientRequestId; + + /** + * Gets Whether a unique x-ms-client-request-id should be generated. When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. + * + * @return the generateClientRequestId value. + */ + public boolean generateClientRequestId() { + return this.generateClientRequestId; + } + + /** + * Sets Whether a unique x-ms-client-request-id should be generated. When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. + * + * @param generateClientRequestId the generateClientRequestId value. + * @return the service client itself + */ + public MixedRealityClientImpl 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 SpatialAnchorsAccountsInner object to access its operations. + */ + private SpatialAnchorsAccountsInner spatialAnchorsAccounts; + + /** + * Gets the SpatialAnchorsAccountsInner object to access its operations. + * @return the SpatialAnchorsAccountsInner object. + */ + public SpatialAnchorsAccountsInner spatialAnchorsAccounts() { + return this.spatialAnchorsAccounts; + } + + /** + * The RemoteRenderingAccountsInner object to access its operations. + */ + private RemoteRenderingAccountsInner remoteRenderingAccounts; + + /** + * Gets the RemoteRenderingAccountsInner object to access its operations. + * @return the RemoteRenderingAccountsInner object. + */ + public RemoteRenderingAccountsInner remoteRenderingAccounts() { + return this.remoteRenderingAccounts; + } + + /** + * Initializes an instance of MixedRealityClient client. + * + * @param credentials the management credentials for Azure + */ + public MixedRealityClientImpl(ServiceClientCredentials credentials) { + this("https://management.azure.com", credentials); + } + + /** + * Initializes an instance of MixedRealityClient client. + * + * @param baseUrl the base URL of the host + * @param credentials the management credentials for Azure + */ + public MixedRealityClientImpl(String baseUrl, ServiceClientCredentials credentials) { + super(baseUrl, credentials); + initialize(); + } + + /** + * Initializes an instance of MixedRealityClient client. + * + * @param restClient the REST client to connect to Azure. + */ + public MixedRealityClientImpl(RestClient restClient) { + super(restClient); + initialize(); + } + + protected void initialize() { + this.acceptLanguage = "en-US"; + this.longRunningOperationRetryTimeout = 30; + this.generateClientRequestId = true; + this.operations = new OperationsInner(restClient().retrofit(), this); + this.spatialAnchorsAccounts = new SpatialAnchorsAccountsInner(restClient().retrofit(), this); + this.remoteRenderingAccounts = new RemoteRenderingAccountsInner(restClient().retrofit(), this); + this.azureClient = new AzureClient(this); + initializeService(); + } + + /** + * Gets the User-Agent header for the client. + * + * @return the user agent string. + */ + @Override + public String userAgent() { + return String.format("%s (%s, %s, auto-generated)", super.userAgent(), "MixedRealityClient", "2020-05-01"); + } + + private void initializeService() { + service = restClient().retrofit().create(MixedRealityClientService.class); + } + + /** + * The interface defining all the services for MixedRealityClient to be + * used by Retrofit to perform actually REST calls. + */ + interface MixedRealityClientService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mixedreality.v2020_05_01.MixedRealityClient checkNameAvailabilityLocal" }) + @POST("subscriptions/{subscriptionId}/providers/Microsoft.MixedReality/locations/{location}/checkNameAvailability") + Observable> checkNameAvailabilityLocal(@Path("subscriptionId") String subscriptionId, @Path("location") String location, @Body CheckNameAvailabilityRequest checkNameAvailability, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Check Name Availability for local uniqueness. + * + * @param location The location in which uniqueness will be verified. + * @param checkNameAvailability Check Name Availability Request. + * @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 CheckNameAvailabilityResponseInner object if successful. + */ + public CheckNameAvailabilityResponseInner checkNameAvailabilityLocal(String location, CheckNameAvailabilityRequest checkNameAvailability) { + return checkNameAvailabilityLocalWithServiceResponseAsync(location, checkNameAvailability).toBlocking().single().body(); + } + + /** + * Check Name Availability for local uniqueness. + * + * @param location The location in which uniqueness will be verified. + * @param checkNameAvailability Check Name Availability Request. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture checkNameAvailabilityLocalAsync(String location, CheckNameAvailabilityRequest checkNameAvailability, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(checkNameAvailabilityLocalWithServiceResponseAsync(location, checkNameAvailability), serviceCallback); + } + + /** + * Check Name Availability for local uniqueness. + * + * @param location The location in which uniqueness will be verified. + * @param checkNameAvailability Check Name Availability Request. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the CheckNameAvailabilityResponseInner object + */ + public Observable checkNameAvailabilityLocalAsync(String location, CheckNameAvailabilityRequest checkNameAvailability) { + return checkNameAvailabilityLocalWithServiceResponseAsync(location, checkNameAvailability).map(new Func1, CheckNameAvailabilityResponseInner>() { + @Override + public CheckNameAvailabilityResponseInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Check Name Availability for local uniqueness. + * + * @param location The location in which uniqueness will be verified. + * @param checkNameAvailability Check Name Availability Request. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the CheckNameAvailabilityResponseInner object + */ + public Observable> checkNameAvailabilityLocalWithServiceResponseAsync(String location, CheckNameAvailabilityRequest checkNameAvailability) { + if (this.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.subscriptionId() is required and cannot be null."); + } + if (location == null) { + throw new IllegalArgumentException("Parameter location is required and cannot be null."); + } + if (checkNameAvailability == null) { + throw new IllegalArgumentException("Parameter checkNameAvailability is required and cannot be null."); + } + Validator.validate(checkNameAvailability); + final String apiVersion = "2020-05-01"; + return service.checkNameAvailabilityLocal(this.subscriptionId(), location, checkNameAvailability, apiVersion, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = checkNameAvailabilityLocalDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse checkNameAvailabilityLocalDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/sdk/mixedreality/mgmt-v2020_05_01/src/main/java/com/microsoft/azure/management/mixedreality/v2020_05_01/implementation/MixedRealityManager.java b/sdk/mixedreality/mgmt-v2020_05_01/src/main/java/com/microsoft/azure/management/mixedreality/v2020_05_01/implementation/MixedRealityManager.java new file mode 100644 index 000000000000..eed53d76a7c1 --- /dev/null +++ b/sdk/mixedreality/mgmt-v2020_05_01/src/main/java/com/microsoft/azure/management/mixedreality/v2020_05_01/implementation/MixedRealityManager.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.mixedreality.v2020_05_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.mixedreality.v2020_05_01.Operations; +import com.microsoft.azure.management.mixedreality.v2020_05_01.SpatialAnchorsAccounts; +import com.microsoft.azure.management.mixedreality.v2020_05_01.RemoteRenderingAccounts; +import com.microsoft.azure.arm.resources.implementation.AzureConfigurableCoreImpl; +import com.microsoft.azure.arm.resources.implementation.ManagerCore; + +/** + * Entry point to Azure MixedReality resource management. + */ +public final class MixedRealityManager extends ManagerCore { + private Operations operations; + private SpatialAnchorsAccounts spatialAnchorsAccounts; + private RemoteRenderingAccounts remoteRenderingAccounts; + /** + * Get a Configurable instance that can be used to create MixedRealityManager with optional configuration. + * + * @return the instance allowing configurations + */ + public static Configurable configure() { + return new MixedRealityManager.ConfigurableImpl(); + } + /** + * Creates an instance of MixedRealityManager that exposes MixedReality resource management API entry points. + * + * @param credentials the credentials to use + * @param subscriptionId the subscription UUID + * @return the MixedRealityManager + */ + public static MixedRealityManager authenticate(AzureTokenCredentials credentials, String subscriptionId) { + return new MixedRealityManager(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 MixedRealityManager that exposes MixedReality resource management API entry points. + * + * @param restClient the RestClient to be used for API calls. + * @param subscriptionId the subscription UUID + * @return the MixedRealityManager + */ + public static MixedRealityManager authenticate(RestClient restClient, String subscriptionId) { + return new MixedRealityManager(restClient, subscriptionId); + } + /** + * The interface allowing configurations to be set. + */ + public interface Configurable extends AzureConfigurable { + /** + * Creates an instance of MixedRealityManager that exposes MixedReality management API entry points. + * + * @param credentials the credentials to use + * @param subscriptionId the subscription UUID + * @return the interface exposing MixedReality management API entry points that work across subscriptions + */ + MixedRealityManager 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 SpatialAnchorsAccounts. + */ + public SpatialAnchorsAccounts spatialAnchorsAccounts() { + if (this.spatialAnchorsAccounts == null) { + this.spatialAnchorsAccounts = new SpatialAnchorsAccountsImpl(this); + } + return this.spatialAnchorsAccounts; + } + + /** + * @return Entry point to manage RemoteRenderingAccounts. + */ + public RemoteRenderingAccounts remoteRenderingAccounts() { + if (this.remoteRenderingAccounts == null) { + this.remoteRenderingAccounts = new RemoteRenderingAccountsImpl(this); + } + return this.remoteRenderingAccounts; + } + + /** + * The implementation for Configurable interface. + */ + private static final class ConfigurableImpl extends AzureConfigurableCoreImpl implements Configurable { + public MixedRealityManager authenticate(AzureTokenCredentials credentials, String subscriptionId) { + return MixedRealityManager.authenticate(buildRestClient(credentials), subscriptionId); + } + } + private MixedRealityManager(RestClient restClient, String subscriptionId) { + super( + restClient, + subscriptionId, + new MixedRealityClientImpl(restClient).withSubscriptionId(subscriptionId)); + } +} diff --git a/sdk/mixedreality/mgmt-v2020_05_01/src/main/java/com/microsoft/azure/management/mixedreality/v2020_05_01/implementation/OperationImpl.java b/sdk/mixedreality/mgmt-v2020_05_01/src/main/java/com/microsoft/azure/management/mixedreality/v2020_05_01/implementation/OperationImpl.java new file mode 100644 index 000000000000..5e371b12fc66 --- /dev/null +++ b/sdk/mixedreality/mgmt-v2020_05_01/src/main/java/com/microsoft/azure/management/mixedreality/v2020_05_01/implementation/OperationImpl.java @@ -0,0 +1,37 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mixedreality.v2020_05_01.implementation; + +import com.microsoft.azure.management.mixedreality.v2020_05_01.Operation; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.mixedreality.v2020_05_01.OperationDisplay; + +class OperationImpl extends WrapperImpl implements Operation { + private final MixedRealityManager manager; + OperationImpl(OperationInner inner, MixedRealityManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public MixedRealityManager manager() { + return this.manager; + } + + @Override + public OperationDisplay display() { + return this.inner().display(); + } + + @Override + public String name() { + return this.inner().name(); + } + +} diff --git a/sdk/mixedreality/mgmt-v2020_05_01/src/main/java/com/microsoft/azure/management/mixedreality/v2020_05_01/implementation/OperationInner.java b/sdk/mixedreality/mgmt-v2020_05_01/src/main/java/com/microsoft/azure/management/mixedreality/v2020_05_01/implementation/OperationInner.java new file mode 100644 index 000000000000..caae93da5231 --- /dev/null +++ b/sdk/mixedreality/mgmt-v2020_05_01/src/main/java/com/microsoft/azure/management/mixedreality/v2020_05_01/implementation/OperationInner.java @@ -0,0 +1,70 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mixedreality.v2020_05_01.implementation; + +import com.microsoft.azure.management.mixedreality.v2020_05_01.OperationDisplay; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * REST API operation. + */ +public class OperationInner { + /** + * Operation name: {provider}/{resource}/{operation}. + */ + @JsonProperty(value = "name") + private String name; + + /** + * The object that represents the operation. + */ + @JsonProperty(value = "display") + private OperationDisplay display; + + /** + * Get operation name: {provider}/{resource}/{operation}. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set operation name: {provider}/{resource}/{operation}. + * + * @param name the name value to set + * @return the OperationInner object itself. + */ + public OperationInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get the object that represents the operation. + * + * @return the display value + */ + public OperationDisplay display() { + return this.display; + } + + /** + * Set the object that represents the operation. + * + * @param display the display value to set + * @return the OperationInner object itself. + */ + public OperationInner withDisplay(OperationDisplay display) { + this.display = display; + return this; + } + +} diff --git a/sdk/mixedreality/mgmt-v2020_05_01/src/main/java/com/microsoft/azure/management/mixedreality/v2020_05_01/implementation/OperationsImpl.java b/sdk/mixedreality/mgmt-v2020_05_01/src/main/java/com/microsoft/azure/management/mixedreality/v2020_05_01/implementation/OperationsImpl.java new file mode 100644 index 000000000000..5aeb732aee15 --- /dev/null +++ b/sdk/mixedreality/mgmt-v2020_05_01/src/main/java/com/microsoft/azure/management/mixedreality/v2020_05_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.mixedreality.v2020_05_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.mixedreality.v2020_05_01.Operations; +import rx.functions.Func1; +import rx.Observable; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.mixedreality.v2020_05_01.Operation; + +class OperationsImpl extends WrapperImpl implements Operations { + private final MixedRealityManager manager; + + OperationsImpl(MixedRealityManager manager) { + super(manager.inner().operations()); + this.manager = manager; + } + + public MixedRealityManager manager() { + return this.manager; + } + + @Override + public Observable listAsync() { + OperationsInner client = this.inner(); + return client.listAsync() + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public Operation call(OperationInner inner) { + return new OperationImpl(inner, manager()); + } + }); + } + +} diff --git a/sdk/mixedreality/mgmt-v2020_05_01/src/main/java/com/microsoft/azure/management/mixedreality/v2020_05_01/implementation/OperationsInner.java b/sdk/mixedreality/mgmt-v2020_05_01/src/main/java/com/microsoft/azure/management/mixedreality/v2020_05_01/implementation/OperationsInner.java new file mode 100644 index 000000000000..d7aa6be1f6a2 --- /dev/null +++ b/sdk/mixedreality/mgmt-v2020_05_01/src/main/java/com/microsoft/azure/management/mixedreality/v2020_05_01/implementation/OperationsInner.java @@ -0,0 +1,281 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mixedreality.v2020_05_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 MixedRealityClientImpl 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, MixedRealityClientImpl 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.mixedreality.v2020_05_01.Operations list" }) + @GET("providers/Microsoft.MixedReality/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.mixedreality.v2020_05_01.Operations listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Exposing Available Operations. + * + * @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(); + } + }; + } + + /** + * Exposing Available Operations. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Exposing Available Operations. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<OperationInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Exposing Available Operations. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<OperationInner> object + */ + public Observable>> listWithServiceResponseAsync() { + return listSinglePageAsync() + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Exposing Available Operations. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<OperationInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync() { + final String apiVersion = "2020-05-01"; + return service.list(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 { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Exposing Available Operations. + * + * @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(); + } + }; + } + + /** + * Exposing Available Operations. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Exposing Available Operations. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<OperationInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Exposing Available Operations. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<OperationInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Exposing Available Operations. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<OperationInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws 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/sdk/mixedreality/mgmt-v2020_05_01/src/main/java/com/microsoft/azure/management/mixedreality/v2020_05_01/implementation/PageImpl.java b/sdk/mixedreality/mgmt-v2020_05_01/src/main/java/com/microsoft/azure/management/mixedreality/v2020_05_01/implementation/PageImpl.java new file mode 100644 index 000000000000..c2b41703af4f --- /dev/null +++ b/sdk/mixedreality/mgmt-v2020_05_01/src/main/java/com/microsoft/azure/management/mixedreality/v2020_05_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.mixedreality.v2020_05_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/sdk/mixedreality/mgmt-v2020_05_01/src/main/java/com/microsoft/azure/management/mixedreality/v2020_05_01/implementation/RemoteRenderingAccountImpl.java b/sdk/mixedreality/mgmt-v2020_05_01/src/main/java/com/microsoft/azure/management/mixedreality/v2020_05_01/implementation/RemoteRenderingAccountImpl.java new file mode 100644 index 000000000000..9754594564c2 --- /dev/null +++ b/sdk/mixedreality/mgmt-v2020_05_01/src/main/java/com/microsoft/azure/management/mixedreality/v2020_05_01/implementation/RemoteRenderingAccountImpl.java @@ -0,0 +1,68 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mixedreality.v2020_05_01.implementation; + +import com.microsoft.azure.arm.resources.models.implementation.GroupableResourceCoreImpl; +import com.microsoft.azure.management.mixedreality.v2020_05_01.RemoteRenderingAccount; +import rx.Observable; +import com.microsoft.azure.management.mixedreality.v2020_05_01.RemoteRenderingAccountIdentity; + +class RemoteRenderingAccountImpl extends GroupableResourceCoreImpl implements RemoteRenderingAccount, RemoteRenderingAccount.Definition, RemoteRenderingAccount.Update { + RemoteRenderingAccountImpl(String name, RemoteRenderingAccountInner inner, MixedRealityManager manager) { + super(name, inner, manager); + } + + @Override + public Observable createResourceAsync() { + RemoteRenderingAccountsInner client = this.manager().inner().remoteRenderingAccounts(); + return client.createAsync(this.resourceGroupName(), this.name(), this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + RemoteRenderingAccountsInner client = this.manager().inner().remoteRenderingAccounts(); + return client.updateAsync(this.resourceGroupName(), this.name(), this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + RemoteRenderingAccountsInner client = this.manager().inner().remoteRenderingAccounts(); + return client.getByResourceGroupAsync(this.resourceGroupName(), this.name()); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public String accountDomain() { + return this.inner().accountDomain(); + } + + @Override + public String accountId() { + return this.inner().accountId(); + } + + @Override + public RemoteRenderingAccountIdentity identity() { + return this.inner().identity(); + } + + @Override + public RemoteRenderingAccountImpl withIdentity(RemoteRenderingAccountIdentity identity) { + this.inner().withIdentity(identity); + return this; + } + +} diff --git a/sdk/mixedreality/mgmt-v2020_05_01/src/main/java/com/microsoft/azure/management/mixedreality/v2020_05_01/implementation/RemoteRenderingAccountInner.java b/sdk/mixedreality/mgmt-v2020_05_01/src/main/java/com/microsoft/azure/management/mixedreality/v2020_05_01/implementation/RemoteRenderingAccountInner.java new file mode 100644 index 000000000000..67901fe3a790 --- /dev/null +++ b/sdk/mixedreality/mgmt-v2020_05_01/src/main/java/com/microsoft/azure/management/mixedreality/v2020_05_01/implementation/RemoteRenderingAccountInner.java @@ -0,0 +1,77 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mixedreality.v2020_05_01.implementation; + +import com.microsoft.azure.management.mixedreality.v2020_05_01.RemoteRenderingAccountIdentity; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.Resource; + +/** + * RemoteRenderingAccount Response. + */ +@JsonFlatten +public class RemoteRenderingAccountInner extends Resource { + /** + * The identity property. + */ + @JsonProperty(value = "identity") + private RemoteRenderingAccountIdentity identity; + + /** + * unique id of certain account. + */ + @JsonProperty(value = "properties.accountId", access = JsonProperty.Access.WRITE_ONLY) + private String accountId; + + /** + * Correspond domain name of certain Spatial Anchors Account. + */ + @JsonProperty(value = "properties.accountDomain", access = JsonProperty.Access.WRITE_ONLY) + private String accountDomain; + + /** + * Get the identity value. + * + * @return the identity value + */ + public RemoteRenderingAccountIdentity identity() { + return this.identity; + } + + /** + * Set the identity value. + * + * @param identity the identity value to set + * @return the RemoteRenderingAccountInner object itself. + */ + public RemoteRenderingAccountInner withIdentity(RemoteRenderingAccountIdentity identity) { + this.identity = identity; + return this; + } + + /** + * Get unique id of certain account. + * + * @return the accountId value + */ + public String accountId() { + return this.accountId; + } + + /** + * Get correspond domain name of certain Spatial Anchors Account. + * + * @return the accountDomain value + */ + public String accountDomain() { + return this.accountDomain; + } + +} diff --git a/sdk/mixedreality/mgmt-v2020_05_01/src/main/java/com/microsoft/azure/management/mixedreality/v2020_05_01/implementation/RemoteRenderingAccountsImpl.java b/sdk/mixedreality/mgmt-v2020_05_01/src/main/java/com/microsoft/azure/management/mixedreality/v2020_05_01/implementation/RemoteRenderingAccountsImpl.java new file mode 100644 index 000000000000..07b7a3ed9817 --- /dev/null +++ b/sdk/mixedreality/mgmt-v2020_05_01/src/main/java/com/microsoft/azure/management/mixedreality/v2020_05_01/implementation/RemoteRenderingAccountsImpl.java @@ -0,0 +1,163 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * def + */ + +package com.microsoft.azure.management.mixedreality.v2020_05_01.implementation; + +import com.microsoft.azure.arm.resources.collection.implementation.GroupableResourcesCoreImpl; +import com.microsoft.azure.management.mixedreality.v2020_05_01.RemoteRenderingAccounts; +import com.microsoft.azure.management.mixedreality.v2020_05_01.RemoteRenderingAccount; +import rx.Observable; +import rx.Completable; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import com.microsoft.azure.arm.resources.ResourceUtilsCore; +import com.microsoft.azure.arm.utils.RXMapper; +import rx.functions.Func1; +import com.microsoft.azure.PagedList; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.mixedreality.v2020_05_01.AccountKeys; + +class RemoteRenderingAccountsImpl extends GroupableResourcesCoreImpl implements RemoteRenderingAccounts { + protected RemoteRenderingAccountsImpl(MixedRealityManager manager) { + super(manager.inner().remoteRenderingAccounts(), manager); + } + + @Override + protected Observable getInnerAsync(String resourceGroupName, String name) { + RemoteRenderingAccountsInner client = this.inner(); + return client.getByResourceGroupAsync(resourceGroupName, name); + } + + @Override + protected Completable deleteInnerAsync(String resourceGroupName, String name) { + RemoteRenderingAccountsInner client = this.inner(); + return client.deleteAsync(resourceGroupName, name).toCompletable(); + } + + @Override + public Observable deleteByIdsAsync(Collection ids) { + if (ids == null || ids.isEmpty()) { + return Observable.empty(); + } + Collection> observables = new ArrayList<>(); + for (String id : ids) { + final String resourceGroupName = ResourceUtilsCore.groupFromResourceId(id); + final String name = ResourceUtilsCore.nameFromResourceId(id); + Observable o = RXMapper.map(this.inner().deleteAsync(resourceGroupName, name), id); + observables.add(o); + } + return Observable.mergeDelayError(observables); + } + + @Override + public Observable deleteByIdsAsync(String...ids) { + return this.deleteByIdsAsync(new ArrayList(Arrays.asList(ids))); + } + + @Override + public void deleteByIds(Collection ids) { + if (ids != null && !ids.isEmpty()) { + this.deleteByIdsAsync(ids).toBlocking().last(); + } + } + + @Override + public void deleteByIds(String...ids) { + this.deleteByIds(new ArrayList(Arrays.asList(ids))); + } + + @Override + public PagedList listByResourceGroup(String resourceGroupName) { + RemoteRenderingAccountsInner client = this.inner(); + return this.wrapList(client.listByResourceGroup(resourceGroupName)); + } + + @Override + public Observable listByResourceGroupAsync(String resourceGroupName) { + RemoteRenderingAccountsInner 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 RemoteRenderingAccount call(RemoteRenderingAccountInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public PagedList list() { + RemoteRenderingAccountsInner client = this.inner(); + return this.wrapList(client.list()); + } + + @Override + public Observable listAsync() { + RemoteRenderingAccountsInner client = this.inner(); + return client.listAsync() + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public RemoteRenderingAccount call(RemoteRenderingAccountInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public RemoteRenderingAccountImpl define(String name) { + return wrapModel(name); + } + + @Override + public Observable listKeysAsync(String resourceGroupName, String accountName) { + RemoteRenderingAccountsInner client = this.inner(); + return client.listKeysAsync(resourceGroupName, accountName) + .map(new Func1() { + @Override + public AccountKeys call(AccountKeysInner inner) { + return new AccountKeysImpl(inner, manager()); + } + }); + } + + @Override + public Observable regenerateKeysAsync(String resourceGroupName, String accountName) { + RemoteRenderingAccountsInner client = this.inner(); + return client.regenerateKeysAsync(resourceGroupName, accountName) + .map(new Func1() { + @Override + public AccountKeys call(AccountKeysInner inner) { + return new AccountKeysImpl(inner, manager()); + } + }); + } + + @Override + protected RemoteRenderingAccountImpl wrapModel(RemoteRenderingAccountInner inner) { + return new RemoteRenderingAccountImpl(inner.name(), inner, manager()); + } + + @Override + protected RemoteRenderingAccountImpl wrapModel(String name) { + return new RemoteRenderingAccountImpl(name, new RemoteRenderingAccountInner(), this.manager()); + } + +} diff --git a/sdk/mixedreality/mgmt-v2020_05_01/src/main/java/com/microsoft/azure/management/mixedreality/v2020_05_01/implementation/RemoteRenderingAccountsInner.java b/sdk/mixedreality/mgmt-v2020_05_01/src/main/java/com/microsoft/azure/management/mixedreality/v2020_05_01/implementation/RemoteRenderingAccountsInner.java new file mode 100644 index 000000000000..74e04a62bd3c --- /dev/null +++ b/sdk/mixedreality/mgmt-v2020_05_01/src/main/java/com/microsoft/azure/management/mixedreality/v2020_05_01/implementation/RemoteRenderingAccountsInner.java @@ -0,0 +1,1159 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mixedreality.v2020_05_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.mixedreality.v2020_05_01.AccountKeyRegenerateRequest; +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 RemoteRenderingAccounts. + */ +public class RemoteRenderingAccountsInner implements InnerSupportsGet, InnerSupportsDelete, InnerSupportsListing { + /** The Retrofit service to perform REST calls. */ + private RemoteRenderingAccountsService service; + /** The service client containing this operation class. */ + private MixedRealityClientImpl client; + + /** + * Initializes an instance of RemoteRenderingAccountsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public RemoteRenderingAccountsInner(Retrofit retrofit, MixedRealityClientImpl client) { + this.service = retrofit.create(RemoteRenderingAccountsService.class); + this.client = client; + } + + /** + * The interface defining all the services for RemoteRenderingAccounts to be + * used by Retrofit to perform actually REST calls. + */ + interface RemoteRenderingAccountsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mixedreality.v2020_05_01.RemoteRenderingAccounts list" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.MixedReality/remoteRenderingAccounts") + 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.mixedreality.v2020_05_01.RemoteRenderingAccounts listByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MixedReality/remoteRenderingAccounts") + 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.mixedreality.v2020_05_01.RemoteRenderingAccounts delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MixedReality/remoteRenderingAccounts/{accountName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @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.mixedreality.v2020_05_01.RemoteRenderingAccounts getByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MixedReality/remoteRenderingAccounts/{accountName}") + Observable> getByResourceGroup(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @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.mixedreality.v2020_05_01.RemoteRenderingAccounts update" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MixedReality/remoteRenderingAccounts/{accountName}") + Observable> update(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Body RemoteRenderingAccountInner remoteRenderingAccount, @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.mixedreality.v2020_05_01.RemoteRenderingAccounts create" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MixedReality/remoteRenderingAccounts/{accountName}") + Observable> create(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Body RemoteRenderingAccountInner remoteRenderingAccount, @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.mixedreality.v2020_05_01.RemoteRenderingAccounts listKeys" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MixedReality/remoteRenderingAccounts/{accountName}/listKeys") + Observable> listKeys(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @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.mixedreality.v2020_05_01.RemoteRenderingAccounts regenerateKeys" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MixedReality/remoteRenderingAccounts/{accountName}/regenerateKeys") + Observable> regenerateKeys(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body AccountKeyRegenerateRequest regenerate, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mixedreality.v2020_05_01.RemoteRenderingAccounts 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.mixedreality.v2020_05_01.RemoteRenderingAccounts listByResourceGroupNext" }) + @GET + Observable> listByResourceGroupNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * List Remote Rendering Accounts by 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<RemoteRenderingAccountInner> 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(); + } + }; + } + + /** + * List Remote Rendering Accounts by 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); + } + + /** + * List Remote Rendering Accounts by Subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<RemoteRenderingAccountInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List Remote Rendering Accounts by Subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<RemoteRenderingAccountInner> 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)); + } + }); + } + + /** + * List Remote Rendering Accounts by Subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<RemoteRenderingAccountInner> 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."); + } + final String apiVersion = "2020-04-06-preview"; + return service.list(this.client.subscriptionId(), 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 Resources by Resource Group. + * + * @param resourceGroupName Name of an Azure resource group. + * @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<RemoteRenderingAccountInner> 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(); + } + }; + } + + /** + * List Resources by Resource Group. + * + * @param resourceGroupName Name of an Azure resource group. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupAsync(final String resourceGroupName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupSinglePageAsync(resourceGroupName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List Resources by Resource Group. + * + * @param resourceGroupName Name of an Azure resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<RemoteRenderingAccountInner> object + */ + public Observable> listByResourceGroupAsync(final String resourceGroupName) { + return listByResourceGroupWithServiceResponseAsync(resourceGroupName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List Resources by Resource Group. + * + * @param resourceGroupName Name of an Azure resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<RemoteRenderingAccountInner> 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)); + } + }); + } + + /** + * List Resources by Resource Group. + * + ServiceResponse> * @param resourceGroupName Name of an Azure resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<RemoteRenderingAccountInner> 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."); + } + final String apiVersion = "2020-04-06-preview"; + return service.listByResourceGroup(this.client.subscriptionId(), resourceGroupName, 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); + } + + /** + * Delete a Remote Rendering Account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Name of an Mixed Reality Account. + * @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 accountName) { + deleteWithServiceResponseAsync(resourceGroupName, accountName).toBlocking().single().body(); + } + + /** + * Delete a Remote Rendering Account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Name of an Mixed Reality Account. + * @param serviceCallback 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 accountName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, accountName), serviceCallback); + } + + /** + * Delete a Remote Rendering Account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Name of an Mixed Reality Account. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable deleteAsync(String resourceGroupName, String accountName) { + return deleteWithServiceResponseAsync(resourceGroupName, accountName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Delete a Remote Rendering Account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Name of an Mixed Reality Account. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String accountName) { + 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 (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + final String apiVersion = "2020-04-06-preview"; + return service.delete(this.client.subscriptionId(), resourceGroupName, accountName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = deleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse deleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Retrieve a Remote Rendering Account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Name of an Mixed Reality Account. + * @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 RemoteRenderingAccountInner object if successful. + */ + public RemoteRenderingAccountInner getByResourceGroup(String resourceGroupName, String accountName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, accountName).toBlocking().single().body(); + } + + /** + * Retrieve a Remote Rendering Account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Name of an Mixed Reality Account. + * @param serviceCallback 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 accountName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getByResourceGroupWithServiceResponseAsync(resourceGroupName, accountName), serviceCallback); + } + + /** + * Retrieve a Remote Rendering Account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Name of an Mixed Reality Account. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the RemoteRenderingAccountInner object + */ + public Observable getByResourceGroupAsync(String resourceGroupName, String accountName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, accountName).map(new Func1, RemoteRenderingAccountInner>() { + @Override + public RemoteRenderingAccountInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Retrieve a Remote Rendering Account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Name of an Mixed Reality Account. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the RemoteRenderingAccountInner object + */ + public Observable> getByResourceGroupWithServiceResponseAsync(String resourceGroupName, String accountName) { + 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 (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + final String apiVersion = "2020-04-06-preview"; + return service.getByResourceGroup(this.client.subscriptionId(), resourceGroupName, accountName, 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); + } + + /** + * Updating a Remote Rendering Account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Name of an Mixed Reality Account. + * @param remoteRenderingAccount Remote Rendering Account parameter. + * @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 RemoteRenderingAccountInner object if successful. + */ + public RemoteRenderingAccountInner update(String resourceGroupName, String accountName, RemoteRenderingAccountInner remoteRenderingAccount) { + return updateWithServiceResponseAsync(resourceGroupName, accountName, remoteRenderingAccount).toBlocking().single().body(); + } + + /** + * Updating a Remote Rendering Account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Name of an Mixed Reality Account. + * @param remoteRenderingAccount Remote Rendering Account parameter. + * @param serviceCallback 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 accountName, RemoteRenderingAccountInner remoteRenderingAccount, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, accountName, remoteRenderingAccount), serviceCallback); + } + + /** + * Updating a Remote Rendering Account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Name of an Mixed Reality Account. + * @param remoteRenderingAccount Remote Rendering Account parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the RemoteRenderingAccountInner object + */ + public Observable updateAsync(String resourceGroupName, String accountName, RemoteRenderingAccountInner remoteRenderingAccount) { + return updateWithServiceResponseAsync(resourceGroupName, accountName, remoteRenderingAccount).map(new Func1, RemoteRenderingAccountInner>() { + @Override + public RemoteRenderingAccountInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updating a Remote Rendering Account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Name of an Mixed Reality Account. + * @param remoteRenderingAccount Remote Rendering Account parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the RemoteRenderingAccountInner object + */ + public Observable> updateWithServiceResponseAsync(String resourceGroupName, String accountName, RemoteRenderingAccountInner remoteRenderingAccount) { + 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 (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (remoteRenderingAccount == null) { + throw new IllegalArgumentException("Parameter remoteRenderingAccount is required and cannot be null."); + } + Validator.validate(remoteRenderingAccount); + final String apiVersion = "2020-04-06-preview"; + return service.update(this.client.subscriptionId(), resourceGroupName, accountName, remoteRenderingAccount, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = updateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse updateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Creating or Updating a Remote Rendering Account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Name of an Mixed Reality Account. + * @param remoteRenderingAccount Remote Rendering Account parameter. + * @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 RemoteRenderingAccountInner object if successful. + */ + public RemoteRenderingAccountInner create(String resourceGroupName, String accountName, RemoteRenderingAccountInner remoteRenderingAccount) { + return createWithServiceResponseAsync(resourceGroupName, accountName, remoteRenderingAccount).toBlocking().single().body(); + } + + /** + * Creating or Updating a Remote Rendering Account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Name of an Mixed Reality Account. + * @param remoteRenderingAccount Remote Rendering Account parameter. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createAsync(String resourceGroupName, String accountName, RemoteRenderingAccountInner remoteRenderingAccount, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createWithServiceResponseAsync(resourceGroupName, accountName, remoteRenderingAccount), serviceCallback); + } + + /** + * Creating or Updating a Remote Rendering Account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Name of an Mixed Reality Account. + * @param remoteRenderingAccount Remote Rendering Account parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the RemoteRenderingAccountInner object + */ + public Observable createAsync(String resourceGroupName, String accountName, RemoteRenderingAccountInner remoteRenderingAccount) { + return createWithServiceResponseAsync(resourceGroupName, accountName, remoteRenderingAccount).map(new Func1, RemoteRenderingAccountInner>() { + @Override + public RemoteRenderingAccountInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creating or Updating a Remote Rendering Account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Name of an Mixed Reality Account. + * @param remoteRenderingAccount Remote Rendering Account parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the RemoteRenderingAccountInner object + */ + public Observable> createWithServiceResponseAsync(String resourceGroupName, String accountName, RemoteRenderingAccountInner remoteRenderingAccount) { + 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 (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (remoteRenderingAccount == null) { + throw new IllegalArgumentException("Parameter remoteRenderingAccount is required and cannot be null."); + } + Validator.validate(remoteRenderingAccount); + final String apiVersion = "2020-04-06-preview"; + return service.create(this.client.subscriptionId(), resourceGroupName, accountName, remoteRenderingAccount, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = createDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse createDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * List Both of the 2 Keys of a Remote Rendering Account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Name of an Mixed Reality Account. + * @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 AccountKeysInner object if successful. + */ + public AccountKeysInner listKeys(String resourceGroupName, String accountName) { + return listKeysWithServiceResponseAsync(resourceGroupName, accountName).toBlocking().single().body(); + } + + /** + * List Both of the 2 Keys of a Remote Rendering Account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Name of an Mixed Reality Account. + * @param serviceCallback 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 accountName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(listKeysWithServiceResponseAsync(resourceGroupName, accountName), serviceCallback); + } + + /** + * List Both of the 2 Keys of a Remote Rendering Account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Name of an Mixed Reality Account. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the AccountKeysInner object + */ + public Observable listKeysAsync(String resourceGroupName, String accountName) { + return listKeysWithServiceResponseAsync(resourceGroupName, accountName).map(new Func1, AccountKeysInner>() { + @Override + public AccountKeysInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * List Both of the 2 Keys of a Remote Rendering Account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Name of an Mixed Reality Account. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the AccountKeysInner object + */ + public Observable> listKeysWithServiceResponseAsync(String resourceGroupName, String accountName) { + 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 (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + final String apiVersion = "2020-04-06-preview"; + return service.listKeys(this.client.subscriptionId(), resourceGroupName, accountName, 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 specified Key of a Remote Rendering Account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Name of an Mixed Reality Account. + * @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 AccountKeysInner object if successful. + */ + public AccountKeysInner regenerateKeys(String resourceGroupName, String accountName) { + return regenerateKeysWithServiceResponseAsync(resourceGroupName, accountName).toBlocking().single().body(); + } + + /** + * Regenerate specified Key of a Remote Rendering Account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Name of an Mixed Reality Account. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture regenerateKeysAsync(String resourceGroupName, String accountName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(regenerateKeysWithServiceResponseAsync(resourceGroupName, accountName), serviceCallback); + } + + /** + * Regenerate specified Key of a Remote Rendering Account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Name of an Mixed Reality Account. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the AccountKeysInner object + */ + public Observable regenerateKeysAsync(String resourceGroupName, String accountName) { + return regenerateKeysWithServiceResponseAsync(resourceGroupName, accountName).map(new Func1, AccountKeysInner>() { + @Override + public AccountKeysInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Regenerate specified Key of a Remote Rendering Account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Name of an Mixed Reality Account. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the AccountKeysInner object + */ + public Observable> regenerateKeysWithServiceResponseAsync(String resourceGroupName, String accountName) { + 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 (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + final String apiVersion = "2020-04-06-preview"; + final Integer serial = null; + AccountKeyRegenerateRequest regenerate = new AccountKeyRegenerateRequest(); + regenerate.withSerial(null); + return service.regenerateKeys(this.client.subscriptionId(), resourceGroupName, accountName, apiVersion, this.client.acceptLanguage(), regenerate, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = regenerateKeysDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Regenerate specified Key of a Remote Rendering Account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Name of an Mixed Reality Account. + * @param serial serial of key to be regenerated + * @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 AccountKeysInner object if successful. + */ + public AccountKeysInner regenerateKeys(String resourceGroupName, String accountName, Integer serial) { + return regenerateKeysWithServiceResponseAsync(resourceGroupName, accountName, serial).toBlocking().single().body(); + } + + /** + * Regenerate specified Key of a Remote Rendering Account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Name of an Mixed Reality Account. + * @param serial serial of key to be regenerated + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture regenerateKeysAsync(String resourceGroupName, String accountName, Integer serial, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(regenerateKeysWithServiceResponseAsync(resourceGroupName, accountName, serial), serviceCallback); + } + + /** + * Regenerate specified Key of a Remote Rendering Account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Name of an Mixed Reality Account. + * @param serial serial of key to be regenerated + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the AccountKeysInner object + */ + public Observable regenerateKeysAsync(String resourceGroupName, String accountName, Integer serial) { + return regenerateKeysWithServiceResponseAsync(resourceGroupName, accountName, serial).map(new Func1, AccountKeysInner>() { + @Override + public AccountKeysInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Regenerate specified Key of a Remote Rendering Account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Name of an Mixed Reality Account. + * @param serial serial of key to be regenerated + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the AccountKeysInner object + */ + public Observable> regenerateKeysWithServiceResponseAsync(String resourceGroupName, String accountName, Integer serial) { + 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 (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + final String apiVersion = "2020-04-06-preview"; + AccountKeyRegenerateRequest regenerate = new AccountKeyRegenerateRequest(); + regenerate.withSerial(serial); + return service.regenerateKeys(this.client.subscriptionId(), resourceGroupName, accountName, apiVersion, this.client.acceptLanguage(), regenerate, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = regenerateKeysDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse regenerateKeysDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * List Remote Rendering Accounts by 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<RemoteRenderingAccountInner> 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 Remote Rendering Accounts by 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); + } + + /** + * List Remote Rendering Accounts by 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<RemoteRenderingAccountInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List Remote Rendering Accounts by 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<RemoteRenderingAccountInner> 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 Remote Rendering Accounts by 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<RemoteRenderingAccountInner> 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); + } + + /** + * List Resources by 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<RemoteRenderingAccountInner> 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(); + } + }; + } + + /** + * List Resources by 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); + } + + /** + * List Resources by 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<RemoteRenderingAccountInner> object + */ + public Observable> listByResourceGroupNextAsync(final String nextPageLink) { + return listByResourceGroupNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List Resources by 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<RemoteRenderingAccountInner> 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)); + } + }); + } + + /** + * List Resources by 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<RemoteRenderingAccountInner> 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/sdk/mixedreality/mgmt-v2020_05_01/src/main/java/com/microsoft/azure/management/mixedreality/v2020_05_01/implementation/SpatialAnchorsAccountImpl.java b/sdk/mixedreality/mgmt-v2020_05_01/src/main/java/com/microsoft/azure/management/mixedreality/v2020_05_01/implementation/SpatialAnchorsAccountImpl.java new file mode 100644 index 000000000000..f802023034f6 --- /dev/null +++ b/sdk/mixedreality/mgmt-v2020_05_01/src/main/java/com/microsoft/azure/management/mixedreality/v2020_05_01/implementation/SpatialAnchorsAccountImpl.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.mixedreality.v2020_05_01.implementation; + +import com.microsoft.azure.arm.resources.models.implementation.GroupableResourceCoreImpl; +import com.microsoft.azure.management.mixedreality.v2020_05_01.SpatialAnchorsAccount; +import rx.Observable; + +class SpatialAnchorsAccountImpl extends GroupableResourceCoreImpl implements SpatialAnchorsAccount, SpatialAnchorsAccount.Definition, SpatialAnchorsAccount.Update { + SpatialAnchorsAccountImpl(String name, SpatialAnchorsAccountInner inner, MixedRealityManager manager) { + super(name, inner, manager); + } + + @Override + public Observable createResourceAsync() { + SpatialAnchorsAccountsInner client = this.manager().inner().spatialAnchorsAccounts(); + return client.createAsync(this.resourceGroupName(), this.name(), this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + SpatialAnchorsAccountsInner client = this.manager().inner().spatialAnchorsAccounts(); + return client.updateAsync(this.resourceGroupName(), this.name(), this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + SpatialAnchorsAccountsInner client = this.manager().inner().spatialAnchorsAccounts(); + return client.getByResourceGroupAsync(this.resourceGroupName(), this.name()); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public String accountDomain() { + return this.inner().accountDomain(); + } + + @Override + public String accountId() { + return this.inner().accountId(); + } + +} diff --git a/sdk/mixedreality/mgmt-v2020_05_01/src/main/java/com/microsoft/azure/management/mixedreality/v2020_05_01/implementation/SpatialAnchorsAccountInner.java b/sdk/mixedreality/mgmt-v2020_05_01/src/main/java/com/microsoft/azure/management/mixedreality/v2020_05_01/implementation/SpatialAnchorsAccountInner.java new file mode 100644 index 000000000000..84d60d761276 --- /dev/null +++ b/sdk/mixedreality/mgmt-v2020_05_01/src/main/java/com/microsoft/azure/management/mixedreality/v2020_05_01/implementation/SpatialAnchorsAccountInner.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.mixedreality.v2020_05_01.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.Resource; + +/** + * SpatialAnchorsAccount Response. + */ +@JsonFlatten +public class SpatialAnchorsAccountInner extends Resource { + /** + * unique id of certain account. + */ + @JsonProperty(value = "properties.accountId", access = JsonProperty.Access.WRITE_ONLY) + private String accountId; + + /** + * Correspond domain name of certain Spatial Anchors Account. + */ + @JsonProperty(value = "properties.accountDomain", access = JsonProperty.Access.WRITE_ONLY) + private String accountDomain; + + /** + * Get unique id of certain account. + * + * @return the accountId value + */ + public String accountId() { + return this.accountId; + } + + /** + * Get correspond domain name of certain Spatial Anchors Account. + * + * @return the accountDomain value + */ + public String accountDomain() { + return this.accountDomain; + } + +} diff --git a/sdk/mixedreality/mgmt-v2020_05_01/src/main/java/com/microsoft/azure/management/mixedreality/v2020_05_01/implementation/SpatialAnchorsAccountsImpl.java b/sdk/mixedreality/mgmt-v2020_05_01/src/main/java/com/microsoft/azure/management/mixedreality/v2020_05_01/implementation/SpatialAnchorsAccountsImpl.java new file mode 100644 index 000000000000..20a8b253c3c2 --- /dev/null +++ b/sdk/mixedreality/mgmt-v2020_05_01/src/main/java/com/microsoft/azure/management/mixedreality/v2020_05_01/implementation/SpatialAnchorsAccountsImpl.java @@ -0,0 +1,163 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * def + */ + +package com.microsoft.azure.management.mixedreality.v2020_05_01.implementation; + +import com.microsoft.azure.arm.resources.collection.implementation.GroupableResourcesCoreImpl; +import com.microsoft.azure.management.mixedreality.v2020_05_01.SpatialAnchorsAccounts; +import com.microsoft.azure.management.mixedreality.v2020_05_01.SpatialAnchorsAccount; +import rx.Observable; +import rx.Completable; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import com.microsoft.azure.arm.resources.ResourceUtilsCore; +import com.microsoft.azure.arm.utils.RXMapper; +import rx.functions.Func1; +import com.microsoft.azure.PagedList; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.mixedreality.v2020_05_01.AccountKeys; + +class SpatialAnchorsAccountsImpl extends GroupableResourcesCoreImpl implements SpatialAnchorsAccounts { + protected SpatialAnchorsAccountsImpl(MixedRealityManager manager) { + super(manager.inner().spatialAnchorsAccounts(), manager); + } + + @Override + protected Observable getInnerAsync(String resourceGroupName, String name) { + SpatialAnchorsAccountsInner client = this.inner(); + return client.getByResourceGroupAsync(resourceGroupName, name); + } + + @Override + protected Completable deleteInnerAsync(String resourceGroupName, String name) { + SpatialAnchorsAccountsInner client = this.inner(); + return client.deleteAsync(resourceGroupName, name).toCompletable(); + } + + @Override + public Observable deleteByIdsAsync(Collection ids) { + if (ids == null || ids.isEmpty()) { + return Observable.empty(); + } + Collection> observables = new ArrayList<>(); + for (String id : ids) { + final String resourceGroupName = ResourceUtilsCore.groupFromResourceId(id); + final String name = ResourceUtilsCore.nameFromResourceId(id); + Observable o = RXMapper.map(this.inner().deleteAsync(resourceGroupName, name), id); + observables.add(o); + } + return Observable.mergeDelayError(observables); + } + + @Override + public Observable deleteByIdsAsync(String...ids) { + return this.deleteByIdsAsync(new ArrayList(Arrays.asList(ids))); + } + + @Override + public void deleteByIds(Collection ids) { + if (ids != null && !ids.isEmpty()) { + this.deleteByIdsAsync(ids).toBlocking().last(); + } + } + + @Override + public void deleteByIds(String...ids) { + this.deleteByIds(new ArrayList(Arrays.asList(ids))); + } + + @Override + public PagedList listByResourceGroup(String resourceGroupName) { + SpatialAnchorsAccountsInner client = this.inner(); + return this.wrapList(client.listByResourceGroup(resourceGroupName)); + } + + @Override + public Observable listByResourceGroupAsync(String resourceGroupName) { + SpatialAnchorsAccountsInner 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 SpatialAnchorsAccount call(SpatialAnchorsAccountInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public PagedList list() { + SpatialAnchorsAccountsInner client = this.inner(); + return this.wrapList(client.list()); + } + + @Override + public Observable listAsync() { + SpatialAnchorsAccountsInner client = this.inner(); + return client.listAsync() + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public SpatialAnchorsAccount call(SpatialAnchorsAccountInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public SpatialAnchorsAccountImpl define(String name) { + return wrapModel(name); + } + + @Override + public Observable listKeysAsync(String resourceGroupName, String accountName) { + SpatialAnchorsAccountsInner client = this.inner(); + return client.listKeysAsync(resourceGroupName, accountName) + .map(new Func1() { + @Override + public AccountKeys call(AccountKeysInner inner) { + return new AccountKeysImpl(inner, manager()); + } + }); + } + + @Override + public Observable regenerateKeysAsync(String resourceGroupName, String accountName) { + SpatialAnchorsAccountsInner client = this.inner(); + return client.regenerateKeysAsync(resourceGroupName, accountName) + .map(new Func1() { + @Override + public AccountKeys call(AccountKeysInner inner) { + return new AccountKeysImpl(inner, manager()); + } + }); + } + + @Override + protected SpatialAnchorsAccountImpl wrapModel(SpatialAnchorsAccountInner inner) { + return new SpatialAnchorsAccountImpl(inner.name(), inner, manager()); + } + + @Override + protected SpatialAnchorsAccountImpl wrapModel(String name) { + return new SpatialAnchorsAccountImpl(name, new SpatialAnchorsAccountInner(), this.manager()); + } + +} diff --git a/sdk/mixedreality/mgmt-v2020_05_01/src/main/java/com/microsoft/azure/management/mixedreality/v2020_05_01/implementation/SpatialAnchorsAccountsInner.java b/sdk/mixedreality/mgmt-v2020_05_01/src/main/java/com/microsoft/azure/management/mixedreality/v2020_05_01/implementation/SpatialAnchorsAccountsInner.java new file mode 100644 index 000000000000..4bf0845e5374 --- /dev/null +++ b/sdk/mixedreality/mgmt-v2020_05_01/src/main/java/com/microsoft/azure/management/mixedreality/v2020_05_01/implementation/SpatialAnchorsAccountsInner.java @@ -0,0 +1,1159 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mixedreality.v2020_05_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.mixedreality.v2020_05_01.AccountKeyRegenerateRequest; +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 SpatialAnchorsAccounts. + */ +public class SpatialAnchorsAccountsInner implements InnerSupportsGet, InnerSupportsDelete, InnerSupportsListing { + /** The Retrofit service to perform REST calls. */ + private SpatialAnchorsAccountsService service; + /** The service client containing this operation class. */ + private MixedRealityClientImpl client; + + /** + * Initializes an instance of SpatialAnchorsAccountsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public SpatialAnchorsAccountsInner(Retrofit retrofit, MixedRealityClientImpl client) { + this.service = retrofit.create(SpatialAnchorsAccountsService.class); + this.client = client; + } + + /** + * The interface defining all the services for SpatialAnchorsAccounts to be + * used by Retrofit to perform actually REST calls. + */ + interface SpatialAnchorsAccountsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mixedreality.v2020_05_01.SpatialAnchorsAccounts list" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.MixedReality/spatialAnchorsAccounts") + 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.mixedreality.v2020_05_01.SpatialAnchorsAccounts listByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MixedReality/spatialAnchorsAccounts") + 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.mixedreality.v2020_05_01.SpatialAnchorsAccounts delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MixedReality/spatialAnchorsAccounts/{accountName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @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.mixedreality.v2020_05_01.SpatialAnchorsAccounts getByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MixedReality/spatialAnchorsAccounts/{accountName}") + Observable> getByResourceGroup(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @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.mixedreality.v2020_05_01.SpatialAnchorsAccounts update" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MixedReality/spatialAnchorsAccounts/{accountName}") + Observable> update(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Body SpatialAnchorsAccountInner spatialAnchorsAccount, @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.mixedreality.v2020_05_01.SpatialAnchorsAccounts create" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MixedReality/spatialAnchorsAccounts/{accountName}") + Observable> create(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Body SpatialAnchorsAccountInner spatialAnchorsAccount, @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.mixedreality.v2020_05_01.SpatialAnchorsAccounts listKeys" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MixedReality/spatialAnchorsAccounts/{accountName}/listKeys") + Observable> listKeys(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @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.mixedreality.v2020_05_01.SpatialAnchorsAccounts regenerateKeys" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MixedReality/spatialAnchorsAccounts/{accountName}/regenerateKeys") + Observable> regenerateKeys(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body AccountKeyRegenerateRequest regenerate, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mixedreality.v2020_05_01.SpatialAnchorsAccounts 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.mixedreality.v2020_05_01.SpatialAnchorsAccounts listByResourceGroupNext" }) + @GET + Observable> listByResourceGroupNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * List Spatial Anchors Accounts by 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<SpatialAnchorsAccountInner> 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(); + } + }; + } + + /** + * List Spatial Anchors Accounts by 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); + } + + /** + * List Spatial Anchors Accounts by Subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<SpatialAnchorsAccountInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List Spatial Anchors Accounts by Subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<SpatialAnchorsAccountInner> 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)); + } + }); + } + + /** + * List Spatial Anchors Accounts by Subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<SpatialAnchorsAccountInner> 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."); + } + final String apiVersion = "2020-05-01"; + return service.list(this.client.subscriptionId(), 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 Resources by Resource Group. + * + * @param resourceGroupName Name of an Azure resource group. + * @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<SpatialAnchorsAccountInner> 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(); + } + }; + } + + /** + * List Resources by Resource Group. + * + * @param resourceGroupName Name of an Azure resource group. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupAsync(final String resourceGroupName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupSinglePageAsync(resourceGroupName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List Resources by Resource Group. + * + * @param resourceGroupName Name of an Azure resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<SpatialAnchorsAccountInner> object + */ + public Observable> listByResourceGroupAsync(final String resourceGroupName) { + return listByResourceGroupWithServiceResponseAsync(resourceGroupName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List Resources by Resource Group. + * + * @param resourceGroupName Name of an Azure resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<SpatialAnchorsAccountInner> 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)); + } + }); + } + + /** + * List Resources by Resource Group. + * + ServiceResponse> * @param resourceGroupName Name of an Azure resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<SpatialAnchorsAccountInner> 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."); + } + final String apiVersion = "2020-05-01"; + return service.listByResourceGroup(this.client.subscriptionId(), resourceGroupName, 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); + } + + /** + * Delete a Spatial Anchors Account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Name of an Mixed Reality Account. + * @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 accountName) { + deleteWithServiceResponseAsync(resourceGroupName, accountName).toBlocking().single().body(); + } + + /** + * Delete a Spatial Anchors Account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Name of an Mixed Reality Account. + * @param serviceCallback 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 accountName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, accountName), serviceCallback); + } + + /** + * Delete a Spatial Anchors Account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Name of an Mixed Reality Account. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable deleteAsync(String resourceGroupName, String accountName) { + return deleteWithServiceResponseAsync(resourceGroupName, accountName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Delete a Spatial Anchors Account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Name of an Mixed Reality Account. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String accountName) { + 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 (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + final String apiVersion = "2020-05-01"; + return service.delete(this.client.subscriptionId(), resourceGroupName, accountName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = deleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse deleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Retrieve a Spatial Anchors Account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Name of an Mixed Reality Account. + * @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 SpatialAnchorsAccountInner object if successful. + */ + public SpatialAnchorsAccountInner getByResourceGroup(String resourceGroupName, String accountName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, accountName).toBlocking().single().body(); + } + + /** + * Retrieve a Spatial Anchors Account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Name of an Mixed Reality Account. + * @param serviceCallback 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 accountName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getByResourceGroupWithServiceResponseAsync(resourceGroupName, accountName), serviceCallback); + } + + /** + * Retrieve a Spatial Anchors Account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Name of an Mixed Reality Account. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SpatialAnchorsAccountInner object + */ + public Observable getByResourceGroupAsync(String resourceGroupName, String accountName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, accountName).map(new Func1, SpatialAnchorsAccountInner>() { + @Override + public SpatialAnchorsAccountInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Retrieve a Spatial Anchors Account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Name of an Mixed Reality Account. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SpatialAnchorsAccountInner object + */ + public Observable> getByResourceGroupWithServiceResponseAsync(String resourceGroupName, String accountName) { + 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 (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + final String apiVersion = "2020-05-01"; + return service.getByResourceGroup(this.client.subscriptionId(), resourceGroupName, accountName, 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); + } + + /** + * Updating a Spatial Anchors Account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Name of an Mixed Reality Account. + * @param spatialAnchorsAccount Spatial Anchors Account parameter. + * @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 SpatialAnchorsAccountInner object if successful. + */ + public SpatialAnchorsAccountInner update(String resourceGroupName, String accountName, SpatialAnchorsAccountInner spatialAnchorsAccount) { + return updateWithServiceResponseAsync(resourceGroupName, accountName, spatialAnchorsAccount).toBlocking().single().body(); + } + + /** + * Updating a Spatial Anchors Account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Name of an Mixed Reality Account. + * @param spatialAnchorsAccount Spatial Anchors Account parameter. + * @param serviceCallback 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 accountName, SpatialAnchorsAccountInner spatialAnchorsAccount, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, accountName, spatialAnchorsAccount), serviceCallback); + } + + /** + * Updating a Spatial Anchors Account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Name of an Mixed Reality Account. + * @param spatialAnchorsAccount Spatial Anchors Account parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SpatialAnchorsAccountInner object + */ + public Observable updateAsync(String resourceGroupName, String accountName, SpatialAnchorsAccountInner spatialAnchorsAccount) { + return updateWithServiceResponseAsync(resourceGroupName, accountName, spatialAnchorsAccount).map(new Func1, SpatialAnchorsAccountInner>() { + @Override + public SpatialAnchorsAccountInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updating a Spatial Anchors Account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Name of an Mixed Reality Account. + * @param spatialAnchorsAccount Spatial Anchors Account parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SpatialAnchorsAccountInner object + */ + public Observable> updateWithServiceResponseAsync(String resourceGroupName, String accountName, SpatialAnchorsAccountInner spatialAnchorsAccount) { + 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 (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (spatialAnchorsAccount == null) { + throw new IllegalArgumentException("Parameter spatialAnchorsAccount is required and cannot be null."); + } + Validator.validate(spatialAnchorsAccount); + final String apiVersion = "2020-05-01"; + return service.update(this.client.subscriptionId(), resourceGroupName, accountName, spatialAnchorsAccount, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = updateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse updateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Creating or Updating a Spatial Anchors Account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Name of an Mixed Reality Account. + * @param spatialAnchorsAccount Spatial Anchors Account parameter. + * @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 SpatialAnchorsAccountInner object if successful. + */ + public SpatialAnchorsAccountInner create(String resourceGroupName, String accountName, SpatialAnchorsAccountInner spatialAnchorsAccount) { + return createWithServiceResponseAsync(resourceGroupName, accountName, spatialAnchorsAccount).toBlocking().single().body(); + } + + /** + * Creating or Updating a Spatial Anchors Account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Name of an Mixed Reality Account. + * @param spatialAnchorsAccount Spatial Anchors Account parameter. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createAsync(String resourceGroupName, String accountName, SpatialAnchorsAccountInner spatialAnchorsAccount, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createWithServiceResponseAsync(resourceGroupName, accountName, spatialAnchorsAccount), serviceCallback); + } + + /** + * Creating or Updating a Spatial Anchors Account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Name of an Mixed Reality Account. + * @param spatialAnchorsAccount Spatial Anchors Account parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SpatialAnchorsAccountInner object + */ + public Observable createAsync(String resourceGroupName, String accountName, SpatialAnchorsAccountInner spatialAnchorsAccount) { + return createWithServiceResponseAsync(resourceGroupName, accountName, spatialAnchorsAccount).map(new Func1, SpatialAnchorsAccountInner>() { + @Override + public SpatialAnchorsAccountInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creating or Updating a Spatial Anchors Account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Name of an Mixed Reality Account. + * @param spatialAnchorsAccount Spatial Anchors Account parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SpatialAnchorsAccountInner object + */ + public Observable> createWithServiceResponseAsync(String resourceGroupName, String accountName, SpatialAnchorsAccountInner spatialAnchorsAccount) { + 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 (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (spatialAnchorsAccount == null) { + throw new IllegalArgumentException("Parameter spatialAnchorsAccount is required and cannot be null."); + } + Validator.validate(spatialAnchorsAccount); + final String apiVersion = "2020-05-01"; + return service.create(this.client.subscriptionId(), resourceGroupName, accountName, spatialAnchorsAccount, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = createDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse createDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * List Both of the 2 Keys of a Spatial Anchors Account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Name of an Mixed Reality Account. + * @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 AccountKeysInner object if successful. + */ + public AccountKeysInner listKeys(String resourceGroupName, String accountName) { + return listKeysWithServiceResponseAsync(resourceGroupName, accountName).toBlocking().single().body(); + } + + /** + * List Both of the 2 Keys of a Spatial Anchors Account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Name of an Mixed Reality Account. + * @param serviceCallback 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 accountName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(listKeysWithServiceResponseAsync(resourceGroupName, accountName), serviceCallback); + } + + /** + * List Both of the 2 Keys of a Spatial Anchors Account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Name of an Mixed Reality Account. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the AccountKeysInner object + */ + public Observable listKeysAsync(String resourceGroupName, String accountName) { + return listKeysWithServiceResponseAsync(resourceGroupName, accountName).map(new Func1, AccountKeysInner>() { + @Override + public AccountKeysInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * List Both of the 2 Keys of a Spatial Anchors Account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Name of an Mixed Reality Account. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the AccountKeysInner object + */ + public Observable> listKeysWithServiceResponseAsync(String resourceGroupName, String accountName) { + 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 (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + final String apiVersion = "2020-05-01"; + return service.listKeys(this.client.subscriptionId(), resourceGroupName, accountName, 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 specified Key of a Spatial Anchors Account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Name of an Mixed Reality Account. + * @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 AccountKeysInner object if successful. + */ + public AccountKeysInner regenerateKeys(String resourceGroupName, String accountName) { + return regenerateKeysWithServiceResponseAsync(resourceGroupName, accountName).toBlocking().single().body(); + } + + /** + * Regenerate specified Key of a Spatial Anchors Account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Name of an Mixed Reality Account. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture regenerateKeysAsync(String resourceGroupName, String accountName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(regenerateKeysWithServiceResponseAsync(resourceGroupName, accountName), serviceCallback); + } + + /** + * Regenerate specified Key of a Spatial Anchors Account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Name of an Mixed Reality Account. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the AccountKeysInner object + */ + public Observable regenerateKeysAsync(String resourceGroupName, String accountName) { + return regenerateKeysWithServiceResponseAsync(resourceGroupName, accountName).map(new Func1, AccountKeysInner>() { + @Override + public AccountKeysInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Regenerate specified Key of a Spatial Anchors Account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Name of an Mixed Reality Account. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the AccountKeysInner object + */ + public Observable> regenerateKeysWithServiceResponseAsync(String resourceGroupName, String accountName) { + 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 (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + final String apiVersion = "2020-05-01"; + final Integer serial = null; + AccountKeyRegenerateRequest regenerate = new AccountKeyRegenerateRequest(); + regenerate.withSerial(null); + return service.regenerateKeys(this.client.subscriptionId(), resourceGroupName, accountName, apiVersion, this.client.acceptLanguage(), regenerate, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = regenerateKeysDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Regenerate specified Key of a Spatial Anchors Account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Name of an Mixed Reality Account. + * @param serial serial of key to be regenerated + * @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 AccountKeysInner object if successful. + */ + public AccountKeysInner regenerateKeys(String resourceGroupName, String accountName, Integer serial) { + return regenerateKeysWithServiceResponseAsync(resourceGroupName, accountName, serial).toBlocking().single().body(); + } + + /** + * Regenerate specified Key of a Spatial Anchors Account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Name of an Mixed Reality Account. + * @param serial serial of key to be regenerated + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture regenerateKeysAsync(String resourceGroupName, String accountName, Integer serial, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(regenerateKeysWithServiceResponseAsync(resourceGroupName, accountName, serial), serviceCallback); + } + + /** + * Regenerate specified Key of a Spatial Anchors Account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Name of an Mixed Reality Account. + * @param serial serial of key to be regenerated + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the AccountKeysInner object + */ + public Observable regenerateKeysAsync(String resourceGroupName, String accountName, Integer serial) { + return regenerateKeysWithServiceResponseAsync(resourceGroupName, accountName, serial).map(new Func1, AccountKeysInner>() { + @Override + public AccountKeysInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Regenerate specified Key of a Spatial Anchors Account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Name of an Mixed Reality Account. + * @param serial serial of key to be regenerated + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the AccountKeysInner object + */ + public Observable> regenerateKeysWithServiceResponseAsync(String resourceGroupName, String accountName, Integer serial) { + 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 (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + final String apiVersion = "2020-05-01"; + AccountKeyRegenerateRequest regenerate = new AccountKeyRegenerateRequest(); + regenerate.withSerial(serial); + return service.regenerateKeys(this.client.subscriptionId(), resourceGroupName, accountName, apiVersion, this.client.acceptLanguage(), regenerate, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = regenerateKeysDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse regenerateKeysDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * List Spatial Anchors Accounts by 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<SpatialAnchorsAccountInner> 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 Spatial Anchors Accounts by 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); + } + + /** + * List Spatial Anchors Accounts by 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<SpatialAnchorsAccountInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List Spatial Anchors Accounts by 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<SpatialAnchorsAccountInner> 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 Spatial Anchors Accounts by 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<SpatialAnchorsAccountInner> 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); + } + + /** + * List Resources by 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<SpatialAnchorsAccountInner> 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(); + } + }; + } + + /** + * List Resources by 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); + } + + /** + * List Resources by 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<SpatialAnchorsAccountInner> object + */ + public Observable> listByResourceGroupNextAsync(final String nextPageLink) { + return listByResourceGroupNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List Resources by 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<SpatialAnchorsAccountInner> 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)); + } + }); + } + + /** + * List Resources by 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<SpatialAnchorsAccountInner> 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/sdk/mixedreality/mgmt-v2020_05_01/src/main/java/com/microsoft/azure/management/mixedreality/v2020_05_01/implementation/package-info.java b/sdk/mixedreality/mgmt-v2020_05_01/src/main/java/com/microsoft/azure/management/mixedreality/v2020_05_01/implementation/package-info.java new file mode 100644 index 000000000000..090293f8b5f3 --- /dev/null +++ b/sdk/mixedreality/mgmt-v2020_05_01/src/main/java/com/microsoft/azure/management/mixedreality/v2020_05_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 MixedRealityClient. + * Mixed Reality Client. + */ +package com.microsoft.azure.management.mixedreality.v2020_05_01.implementation; diff --git a/sdk/mixedreality/mgmt-v2020_05_01/src/main/java/com/microsoft/azure/management/mixedreality/v2020_05_01/package-info.java b/sdk/mixedreality/mgmt-v2020_05_01/src/main/java/com/microsoft/azure/management/mixedreality/v2020_05_01/package-info.java new file mode 100644 index 000000000000..e5beafb07213 --- /dev/null +++ b/sdk/mixedreality/mgmt-v2020_05_01/src/main/java/com/microsoft/azure/management/mixedreality/v2020_05_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 MixedRealityClient. + * Mixed Reality Client. + */ +package com.microsoft.azure.management.mixedreality.v2020_05_01;