diff --git a/sdk/digitaltwins/mgmt-v2020_12_01/pom.xml b/sdk/digitaltwins/mgmt-v2020_12_01/pom.xml new file mode 100644 index 0000000000000..e3a28f5f74567 --- /dev/null +++ b/sdk/digitaltwins/mgmt-v2020_12_01/pom.xml @@ -0,0 +1,135 @@ + + + 4.0.0 + com.microsoft.azure.digitaltwins.v2020_12_01 + + com.microsoft.azure + azure-arm-parent + 1.1.0 + ../../../pom.management.xml + + azure-mgmt-digitaltwins + 1.0.0-beta + jar + Microsoft Azure SDK for DigitalTwins Management + This package contains Microsoft DigitalTwins 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/digitaltwins/mgmt-v2020_12_01/src/main/java/com/microsoft/azure/management/digitaltwins/v2020_12_01/AuthenticationType.java b/sdk/digitaltwins/mgmt-v2020_12_01/src/main/java/com/microsoft/azure/management/digitaltwins/v2020_12_01/AuthenticationType.java new file mode 100644 index 0000000000000..0f1d5ead116a3 --- /dev/null +++ b/sdk/digitaltwins/mgmt-v2020_12_01/src/main/java/com/microsoft/azure/management/digitaltwins/v2020_12_01/AuthenticationType.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.digitaltwins.v2020_12_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for AuthenticationType. + */ +public final class AuthenticationType extends ExpandableStringEnum { + /** Static value KeyBased for AuthenticationType. */ + public static final AuthenticationType KEY_BASED = fromString("KeyBased"); + + /** Static value IdentityBased for AuthenticationType. */ + public static final AuthenticationType IDENTITY_BASED = fromString("IdentityBased"); + + /** + * Creates or finds a AuthenticationType from its string representation. + * @param name a name to look for + * @return the corresponding AuthenticationType + */ + @JsonCreator + public static AuthenticationType fromString(String name) { + return fromString(name, AuthenticationType.class); + } + + /** + * @return known AuthenticationType values + */ + public static Collection values() { + return values(AuthenticationType.class); + } +} diff --git a/sdk/digitaltwins/mgmt-v2020_12_01/src/main/java/com/microsoft/azure/management/digitaltwins/v2020_12_01/CheckNameRequest.java b/sdk/digitaltwins/mgmt-v2020_12_01/src/main/java/com/microsoft/azure/management/digitaltwins/v2020_12_01/CheckNameRequest.java new file mode 100644 index 0000000000000..6aef4c355eedf --- /dev/null +++ b/sdk/digitaltwins/mgmt-v2020_12_01/src/main/java/com/microsoft/azure/management/digitaltwins/v2020_12_01/CheckNameRequest.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.digitaltwins.v2020_12_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The result returned from a database check name availability request. + */ +public class CheckNameRequest { + /** + * Resource name. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /** + * The type of resource, for instance + * Microsoft.DigitalTwins/digitalTwinsInstances. + */ + @JsonProperty(value = "type", required = true) + private String type; + + /** + * Creates an instance of CheckNameRequest class. + * @param name resource name. + */ + public CheckNameRequest() { + type = "Microsoft.DigitalTwins/digitalTwinsInstances"; + } + + /** + * Get resource name. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set resource name. + * + * @param name the name value to set + * @return the CheckNameRequest object itself. + */ + public CheckNameRequest withName(String name) { + this.name = name; + return this; + } + + /** + * Get the type of resource, for instance Microsoft.DigitalTwins/digitalTwinsInstances. + * + * @return the type value + */ + public String type() { + return this.type; + } + + /** + * Set the type of resource, for instance Microsoft.DigitalTwins/digitalTwinsInstances. + * + * @param type the type value to set + * @return the CheckNameRequest object itself. + */ + public CheckNameRequest withType(String type) { + this.type = type; + return this; + } + +} diff --git a/sdk/digitaltwins/mgmt-v2020_12_01/src/main/java/com/microsoft/azure/management/digitaltwins/v2020_12_01/CheckNameResult.java b/sdk/digitaltwins/mgmt-v2020_12_01/src/main/java/com/microsoft/azure/management/digitaltwins/v2020_12_01/CheckNameResult.java new file mode 100644 index 0000000000000..00df6d5466379 --- /dev/null +++ b/sdk/digitaltwins/mgmt-v2020_12_01/src/main/java/com/microsoft/azure/management/digitaltwins/v2020_12_01/CheckNameResult.java @@ -0,0 +1,35 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.digitaltwins.v2020_12_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.digitaltwins.v2020_12_01.implementation.DigitalTwinsManager; +import com.microsoft.azure.management.digitaltwins.v2020_12_01.implementation.CheckNameResultInner; + +/** + * Type representing CheckNameResult. + */ +public interface CheckNameResult extends HasInner, HasManager { + /** + * @return the message value. + */ + String message(); + + /** + * @return the nameAvailable value. + */ + Boolean nameAvailable(); + + /** + * @return the reason value. + */ + Reason reason(); + +} diff --git a/sdk/digitaltwins/mgmt-v2020_12_01/src/main/java/com/microsoft/azure/management/digitaltwins/v2020_12_01/DigitalTwins.java b/sdk/digitaltwins/mgmt-v2020_12_01/src/main/java/com/microsoft/azure/management/digitaltwins/v2020_12_01/DigitalTwins.java new file mode 100644 index 0000000000000..e311face11aa2 --- /dev/null +++ b/sdk/digitaltwins/mgmt-v2020_12_01/src/main/java/com/microsoft/azure/management/digitaltwins/v2020_12_01/DigitalTwins.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.digitaltwins.v2020_12_01; + +import rx.Observable; +import com.microsoft.azure.management.digitaltwins.v2020_12_01.DigitalTwinsDescription; +import rx.Completable; + +/** + * Type representing DigitalTwins. + */ +public interface DigitalTwins { + /** + * Begins definition for a new DigitalTwinsInstance resource. + * @param name resource name. + * @return the first stage of the new DigitalTwinsInstance definition. + */ + DigitalTwinsDescription.DefinitionStages.Blank defineDigitalTwinsInstance(String name); + + /** + * Get DigitalTwinsInstances resource. + * + * @param resourceGroupName resource group name + * @param name resource name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getByResourceGroupAsync(String resourceGroupName, String name); + + /** + * Get all the DigitalTwinsInstances in a resource group. + * + * @param resourceGroupName resource group name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listByResourceGroupAsync(String resourceGroupName); + + /** + * Get all the DigitalTwinsInstances in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(); + + /** + * Delete a DigitalTwinsInstance. + * + * @param resourceGroupName resource group name + * @param name resource name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable deleteAsync(String resourceGroupName, String name); + + /** + * Check if a DigitalTwinsInstance name is available. + * + * @param location Location of DigitalTwinsInstance. + * @param name Resource name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable checkNameAvailabilityAsync(String location, String name); + +} diff --git a/sdk/digitaltwins/mgmt-v2020_12_01/src/main/java/com/microsoft/azure/management/digitaltwins/v2020_12_01/DigitalTwinsDescription.java b/sdk/digitaltwins/mgmt-v2020_12_01/src/main/java/com/microsoft/azure/management/digitaltwins/v2020_12_01/DigitalTwinsDescription.java new file mode 100644 index 0000000000000..0cf74e0e3e5ae --- /dev/null +++ b/sdk/digitaltwins/mgmt-v2020_12_01/src/main/java/com/microsoft/azure/management/digitaltwins/v2020_12_01/DigitalTwinsDescription.java @@ -0,0 +1,137 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.digitaltwins.v2020_12_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.digitaltwins.v2020_12_01.implementation.DigitalTwinsManager; +import org.joda.time.DateTime; +import java.util.List; +import com.microsoft.azure.management.digitaltwins.v2020_12_01.implementation.PrivateEndpointConnectionInner; +import com.microsoft.azure.management.digitaltwins.v2020_12_01.implementation.DigitalTwinsDescriptionInner; + +/** + * Type representing DigitalTwinsDescription. + */ +public interface DigitalTwinsDescription extends HasInner, Resource, GroupableResourceCore, HasResourceGroup, Refreshable, Updatable, HasManager { + /** + * @return the createdTime value. + */ + DateTime createdTime(); + + /** + * @return the hostName value. + */ + String hostName(); + + /** + * @return the identity value. + */ + DigitalTwinsIdentity identity(); + + /** + * @return the lastUpdatedTime value. + */ + DateTime lastUpdatedTime(); + + /** + * @return the privateEndpointConnections value. + */ + List privateEndpointConnections(); + + /** + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * The entirety of the DigitalTwinsDescription definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithGroup, DefinitionStages.WithCreate { + } + + /** + * Grouping of DigitalTwinsDescription definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a DigitalTwinsDescription definition. + */ + interface Blank extends GroupableResourceCore.DefinitionWithRegion { + } + + /** + * The stage of the DigitalTwinsDescription definition allowing to specify the resource group. + */ + interface WithGroup extends GroupableResourceCore.DefinitionStages.WithGroup { + } + + /** + * The stage of the digitaltwinsdescription definition allowing to specify Identity. + */ + interface WithIdentity { + /** + * Specifies identity. + * @param identity The managed identity for the DigitalTwinsInstance + * @return the next definition stage + */ + WithCreate withIdentity(DigitalTwinsIdentity identity); + } + + /** + * The stage of the digitaltwinsdescription definition allowing to specify PrivateEndpointConnections. + */ + interface WithPrivateEndpointConnections { + /** + * Specifies privateEndpointConnections. + * @param privateEndpointConnections the privateEndpointConnections parameter value + * @return the next definition stage + */ + WithCreate withPrivateEndpointConnections(List privateEndpointConnections); + } + + /** + * 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, DefinitionStages.WithPrivateEndpointConnections { + } + } + /** + * The template for a DigitalTwinsDescription update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, Resource.UpdateWithTags, UpdateStages.WithIdentity { + } + + /** + * Grouping of DigitalTwinsDescription update stages. + */ + interface UpdateStages { + /** + * The stage of the digitaltwinsdescription update allowing to specify Identity. + */ + interface WithIdentity { + /** + * Specifies identity. + * @param identity The managed identity for the DigitalTwinsInstance + * @return the next update stage + */ + Update withIdentity(DigitalTwinsIdentity identity); + } + + } +} diff --git a/sdk/digitaltwins/mgmt-v2020_12_01/src/main/java/com/microsoft/azure/management/digitaltwins/v2020_12_01/DigitalTwinsEndpointResource.java b/sdk/digitaltwins/mgmt-v2020_12_01/src/main/java/com/microsoft/azure/management/digitaltwins/v2020_12_01/DigitalTwinsEndpointResource.java new file mode 100644 index 0000000000000..f37a118bb5076 --- /dev/null +++ b/sdk/digitaltwins/mgmt-v2020_12_01/src/main/java/com/microsoft/azure/management/digitaltwins/v2020_12_01/DigitalTwinsEndpointResource.java @@ -0,0 +1,118 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.digitaltwins.v2020_12_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.digitaltwins.v2020_12_01.implementation.DigitalTwinsEndpointResourceInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.digitaltwins.v2020_12_01.implementation.DigitalTwinsManager; +import org.joda.time.DateTime; + +/** + * Type representing DigitalTwinsEndpointResource. + */ +public interface DigitalTwinsEndpointResource extends HasInner, Indexable, Refreshable, Updatable, HasManager { + /** + * @return the id value. + */ + String id(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the properties value. + */ + DigitalTwinsEndpointResourceProperties properties(); + + /** + * @return the type value. + */ + String type(); + + /** + * The entirety of the DigitalTwinsEndpointResource definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithDigitalTwinsInstance, DefinitionStages.WithProperties, DefinitionStages.WithCreate { + } + + /** + * Grouping of DigitalTwinsEndpointResource definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a DigitalTwinsEndpointResource definition. + */ + interface Blank extends WithDigitalTwinsInstance { + } + + /** + * The stage of the digitaltwinsendpointresource definition allowing to specify DigitalTwinsInstance. + */ + interface WithDigitalTwinsInstance { + /** + * Specifies resourceGroupName, resourceName. + * @param resourceGroupName The name of the resource group that contains the DigitalTwinsInstance + * @param resourceName The name of the DigitalTwinsInstance + * @return the next definition stage + */ + WithProperties withExistingDigitalTwinsInstance(String resourceGroupName, String resourceName); + } + + /** + * The stage of the digitaltwinsendpointresource definition allowing to specify Properties. + */ + interface WithProperties { + /** + * Specifies properties. + * @param properties DigitalTwinsInstance endpoint resource properties + * @return the next definition stage + */ + WithCreate withProperties(DigitalTwinsEndpointResourceProperties properties); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable { + } + } + /** + * The template for a DigitalTwinsEndpointResource update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, UpdateStages.WithProperties { + } + + /** + * Grouping of DigitalTwinsEndpointResource update stages. + */ + interface UpdateStages { + /** + * The stage of the digitaltwinsendpointresource update allowing to specify Properties. + */ + interface WithProperties { + /** + * Specifies properties. + * @param properties DigitalTwinsInstance endpoint resource properties + * @return the next update stage + */ + Update withProperties(DigitalTwinsEndpointResourceProperties properties); + } + + } +} diff --git a/sdk/digitaltwins/mgmt-v2020_12_01/src/main/java/com/microsoft/azure/management/digitaltwins/v2020_12_01/DigitalTwinsEndpointResourceProperties.java b/sdk/digitaltwins/mgmt-v2020_12_01/src/main/java/com/microsoft/azure/management/digitaltwins/v2020_12_01/DigitalTwinsEndpointResourceProperties.java new file mode 100644 index 0000000000000..52cd77b783e7e --- /dev/null +++ b/sdk/digitaltwins/mgmt-v2020_12_01/src/main/java/com/microsoft/azure/management/digitaltwins/v2020_12_01/DigitalTwinsEndpointResourceProperties.java @@ -0,0 +1,140 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.digitaltwins.v2020_12_01; + +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonSubTypes; + +/** + * Properties related to Digital Twins Endpoint. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "endpointType", defaultImpl = DigitalTwinsEndpointResourceProperties.class) +@JsonTypeName("DigitalTwinsEndpointResourceProperties") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "ServiceBus", value = ServiceBus.class), + @JsonSubTypes.Type(name = "EventHub", value = EventHub.class), + @JsonSubTypes.Type(name = "EventGrid", value = EventGrid.class) +}) +public class DigitalTwinsEndpointResourceProperties { + /** + * The provisioning state. Possible values include: 'Provisioning', + * 'Deleting', 'Succeeded', 'Failed', 'Canceled', 'Deleted', 'Warning', + * 'Suspending', 'Restoring', 'Moving', 'Disabled'. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private EndpointProvisioningState provisioningState; + + /** + * Time when the Endpoint was added to DigitalTwinsInstance. + */ + @JsonProperty(value = "createdTime", access = JsonProperty.Access.WRITE_ONLY) + private DateTime createdTime; + + /** + * Specifies the authentication type being used for connecting to the + * endpoint. Possible values include: 'KeyBased', 'IdentityBased'. + */ + @JsonProperty(value = "authenticationType") + private AuthenticationType authenticationType; + + /** + * Dead letter storage secret for key-based authentication. Will be + * obfuscated during read. + */ + @JsonProperty(value = "deadLetterSecret") + private String deadLetterSecret; + + /** + * Dead letter storage URL for identity-based authentication. + */ + @JsonProperty(value = "deadLetterUri") + private String deadLetterUri; + + /** + * Get the provisioning state. Possible values include: 'Provisioning', 'Deleting', 'Succeeded', 'Failed', 'Canceled', 'Deleted', 'Warning', 'Suspending', 'Restoring', 'Moving', 'Disabled'. + * + * @return the provisioningState value + */ + public EndpointProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get time when the Endpoint was added to DigitalTwinsInstance. + * + * @return the createdTime value + */ + public DateTime createdTime() { + return this.createdTime; + } + + /** + * Get specifies the authentication type being used for connecting to the endpoint. Possible values include: 'KeyBased', 'IdentityBased'. + * + * @return the authenticationType value + */ + public AuthenticationType authenticationType() { + return this.authenticationType; + } + + /** + * Set specifies the authentication type being used for connecting to the endpoint. Possible values include: 'KeyBased', 'IdentityBased'. + * + * @param authenticationType the authenticationType value to set + * @return the DigitalTwinsEndpointResourceProperties object itself. + */ + public DigitalTwinsEndpointResourceProperties withAuthenticationType(AuthenticationType authenticationType) { + this.authenticationType = authenticationType; + return this; + } + + /** + * Get dead letter storage secret for key-based authentication. Will be obfuscated during read. + * + * @return the deadLetterSecret value + */ + public String deadLetterSecret() { + return this.deadLetterSecret; + } + + /** + * Set dead letter storage secret for key-based authentication. Will be obfuscated during read. + * + * @param deadLetterSecret the deadLetterSecret value to set + * @return the DigitalTwinsEndpointResourceProperties object itself. + */ + public DigitalTwinsEndpointResourceProperties withDeadLetterSecret(String deadLetterSecret) { + this.deadLetterSecret = deadLetterSecret; + return this; + } + + /** + * Get dead letter storage URL for identity-based authentication. + * + * @return the deadLetterUri value + */ + public String deadLetterUri() { + return this.deadLetterUri; + } + + /** + * Set dead letter storage URL for identity-based authentication. + * + * @param deadLetterUri the deadLetterUri value to set + * @return the DigitalTwinsEndpointResourceProperties object itself. + */ + public DigitalTwinsEndpointResourceProperties withDeadLetterUri(String deadLetterUri) { + this.deadLetterUri = deadLetterUri; + return this; + } + +} diff --git a/sdk/digitaltwins/mgmt-v2020_12_01/src/main/java/com/microsoft/azure/management/digitaltwins/v2020_12_01/DigitalTwinsEndpoints.java b/sdk/digitaltwins/mgmt-v2020_12_01/src/main/java/com/microsoft/azure/management/digitaltwins/v2020_12_01/DigitalTwinsEndpoints.java new file mode 100644 index 0000000000000..981c2025b258b --- /dev/null +++ b/sdk/digitaltwins/mgmt-v2020_12_01/src/main/java/com/microsoft/azure/management/digitaltwins/v2020_12_01/DigitalTwinsEndpoints.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.digitaltwins.v2020_12_01; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import rx.Completable; +import rx.Observable; +import com.microsoft.azure.management.digitaltwins.v2020_12_01.implementation.DigitalTwinsEndpointsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing DigitalTwinsEndpoints. + */ +public interface DigitalTwinsEndpoints extends SupportsCreating, HasInner { + /** + * Get DigitalTwinsInstances Endpoint. + * + * @param resourceGroupName The name of the resource group that contains the DigitalTwinsInstance. + * @param resourceName The name of the DigitalTwinsInstance. + * @param endpointName Name of Endpoint Resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String resourceName, String endpointName); + + /** + * Get DigitalTwinsInstance Endpoints. + * + * @param resourceGroupName The name of the resource group that contains the DigitalTwinsInstance. + * @param resourceName The name of the DigitalTwinsInstance. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(final String resourceGroupName, final String resourceName); + + /** + * Delete a DigitalTwinsInstance endpoint. + * + * @param resourceGroupName The name of the resource group that contains the DigitalTwinsInstance. + * @param resourceName The name of the DigitalTwinsInstance. + * @param endpointName Name of Endpoint Resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable deleteAsync(String resourceGroupName, String resourceName, String endpointName); + +} diff --git a/sdk/digitaltwins/mgmt-v2020_12_01/src/main/java/com/microsoft/azure/management/digitaltwins/v2020_12_01/DigitalTwinsIdentity.java b/sdk/digitaltwins/mgmt-v2020_12_01/src/main/java/com/microsoft/azure/management/digitaltwins/v2020_12_01/DigitalTwinsIdentity.java new file mode 100644 index 0000000000000..dae543e5da9be --- /dev/null +++ b/sdk/digitaltwins/mgmt-v2020_12_01/src/main/java/com/microsoft/azure/management/digitaltwins/v2020_12_01/DigitalTwinsIdentity.java @@ -0,0 +1,79 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.digitaltwins.v2020_12_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The managed identity for the DigitalTwinsInstance. + */ +public class DigitalTwinsIdentity { + /** + * The type of Managed Identity used by the DigitalTwinsInstance. Only + * SystemAssigned is supported. Possible values include: 'None', + * 'SystemAssigned'. + */ + @JsonProperty(value = "type") + private DigitalTwinsIdentityType type; + + /** + * The object id of the Managed Identity Resource. This will be sent to the + * RP from ARM via the x-ms-identity-principal-id header in the PUT request + * if the resource has a systemAssigned(implicit) identity. + */ + @JsonProperty(value = "principalId", access = JsonProperty.Access.WRITE_ONLY) + private String principalId; + + /** + * The tenant id of the Managed Identity Resource. This will be sent to the + * RP from ARM via the x-ms-client-tenant-id header in the PUT request if + * the resource has a systemAssigned(implicit) identity. + */ + @JsonProperty(value = "tenantId", access = JsonProperty.Access.WRITE_ONLY) + private String tenantId; + + /** + * Get the type of Managed Identity used by the DigitalTwinsInstance. Only SystemAssigned is supported. Possible values include: 'None', 'SystemAssigned'. + * + * @return the type value + */ + public DigitalTwinsIdentityType type() { + return this.type; + } + + /** + * Set the type of Managed Identity used by the DigitalTwinsInstance. Only SystemAssigned is supported. Possible values include: 'None', 'SystemAssigned'. + * + * @param type the type value to set + * @return the DigitalTwinsIdentity object itself. + */ + public DigitalTwinsIdentity withType(DigitalTwinsIdentityType type) { + this.type = type; + return this; + } + + /** + * Get the object id of the Managed Identity Resource. This will be sent to the RP from ARM via the x-ms-identity-principal-id header in the PUT request if the resource has a systemAssigned(implicit) identity. + * + * @return the principalId value + */ + public String principalId() { + return this.principalId; + } + + /** + * Get the tenant id of the Managed Identity Resource. This will be sent to the RP from ARM via the x-ms-client-tenant-id header in the PUT request if the resource has a systemAssigned(implicit) identity. + * + * @return the tenantId value + */ + public String tenantId() { + return this.tenantId; + } + +} diff --git a/sdk/digitaltwins/mgmt-v2020_12_01/src/main/java/com/microsoft/azure/management/digitaltwins/v2020_12_01/DigitalTwinsIdentityType.java b/sdk/digitaltwins/mgmt-v2020_12_01/src/main/java/com/microsoft/azure/management/digitaltwins/v2020_12_01/DigitalTwinsIdentityType.java new file mode 100644 index 0000000000000..d98e2edfc5c2c --- /dev/null +++ b/sdk/digitaltwins/mgmt-v2020_12_01/src/main/java/com/microsoft/azure/management/digitaltwins/v2020_12_01/DigitalTwinsIdentityType.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.digitaltwins.v2020_12_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for DigitalTwinsIdentityType. + */ +public final class DigitalTwinsIdentityType extends ExpandableStringEnum { + /** Static value None for DigitalTwinsIdentityType. */ + public static final DigitalTwinsIdentityType NONE = fromString("None"); + + /** Static value SystemAssigned for DigitalTwinsIdentityType. */ + public static final DigitalTwinsIdentityType SYSTEM_ASSIGNED = fromString("SystemAssigned"); + + /** + * Creates or finds a DigitalTwinsIdentityType from its string representation. + * @param name a name to look for + * @return the corresponding DigitalTwinsIdentityType + */ + @JsonCreator + public static DigitalTwinsIdentityType fromString(String name) { + return fromString(name, DigitalTwinsIdentityType.class); + } + + /** + * @return known DigitalTwinsIdentityType values + */ + public static Collection values() { + return values(DigitalTwinsIdentityType.class); + } +} diff --git a/sdk/digitaltwins/mgmt-v2020_12_01/src/main/java/com/microsoft/azure/management/digitaltwins/v2020_12_01/DigitalTwinsPatchDescription.java b/sdk/digitaltwins/mgmt-v2020_12_01/src/main/java/com/microsoft/azure/management/digitaltwins/v2020_12_01/DigitalTwinsPatchDescription.java new file mode 100644 index 0000000000000..5a7e941adc8e1 --- /dev/null +++ b/sdk/digitaltwins/mgmt-v2020_12_01/src/main/java/com/microsoft/azure/management/digitaltwins/v2020_12_01/DigitalTwinsPatchDescription.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.digitaltwins.v2020_12_01; + +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The description of the DigitalTwins service. + */ +public class DigitalTwinsPatchDescription { + /** + * Instance patch properties. + */ + @JsonProperty(value = "tags") + private Map tags; + + /** + * The managed identity for the DigitalTwinsInstance. + */ + @JsonProperty(value = "identity") + private DigitalTwinsIdentity identity; + + /** + * Get instance patch properties. + * + * @return the tags value + */ + public Map tags() { + return this.tags; + } + + /** + * Set instance patch properties. + * + * @param tags the tags value to set + * @return the DigitalTwinsPatchDescription object itself. + */ + public DigitalTwinsPatchDescription withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Get the managed identity for the DigitalTwinsInstance. + * + * @return the identity value + */ + public DigitalTwinsIdentity identity() { + return this.identity; + } + + /** + * Set the managed identity for the DigitalTwinsInstance. + * + * @param identity the identity value to set + * @return the DigitalTwinsPatchDescription object itself. + */ + public DigitalTwinsPatchDescription withIdentity(DigitalTwinsIdentity identity) { + this.identity = identity; + return this; + } + +} diff --git a/sdk/digitaltwins/mgmt-v2020_12_01/src/main/java/com/microsoft/azure/management/digitaltwins/v2020_12_01/DigitalTwinsResource.java b/sdk/digitaltwins/mgmt-v2020_12_01/src/main/java/com/microsoft/azure/management/digitaltwins/v2020_12_01/DigitalTwinsResource.java new file mode 100644 index 0000000000000..c67a9c0238baa --- /dev/null +++ b/sdk/digitaltwins/mgmt-v2020_12_01/src/main/java/com/microsoft/azure/management/digitaltwins/v2020_12_01/DigitalTwinsResource.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.digitaltwins.v2020_12_01; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.azure.Resource; + +/** + * The common properties of a DigitalTwinsInstance. + */ +public class DigitalTwinsResource extends Resource { + /** + * The managed identity for the DigitalTwinsInstance. + */ + @JsonProperty(value = "identity") + private DigitalTwinsIdentity identity; + + /** + * Get the managed identity for the DigitalTwinsInstance. + * + * @return the identity value + */ + public DigitalTwinsIdentity identity() { + return this.identity; + } + + /** + * Set the managed identity for the DigitalTwinsInstance. + * + * @param identity the identity value to set + * @return the DigitalTwinsResource object itself. + */ + public DigitalTwinsResource withIdentity(DigitalTwinsIdentity identity) { + this.identity = identity; + return this; + } + +} diff --git a/sdk/digitaltwins/mgmt-v2020_12_01/src/main/java/com/microsoft/azure/management/digitaltwins/v2020_12_01/EndpointProvisioningState.java b/sdk/digitaltwins/mgmt-v2020_12_01/src/main/java/com/microsoft/azure/management/digitaltwins/v2020_12_01/EndpointProvisioningState.java new file mode 100644 index 0000000000000..0a16ac9b7a8a7 --- /dev/null +++ b/sdk/digitaltwins/mgmt-v2020_12_01/src/main/java/com/microsoft/azure/management/digitaltwins/v2020_12_01/EndpointProvisioningState.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.digitaltwins.v2020_12_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for EndpointProvisioningState. + */ +public final class EndpointProvisioningState extends ExpandableStringEnum { + /** Static value Provisioning for EndpointProvisioningState. */ + public static final EndpointProvisioningState PROVISIONING = fromString("Provisioning"); + + /** Static value Deleting for EndpointProvisioningState. */ + public static final EndpointProvisioningState DELETING = fromString("Deleting"); + + /** Static value Succeeded for EndpointProvisioningState. */ + public static final EndpointProvisioningState SUCCEEDED = fromString("Succeeded"); + + /** Static value Failed for EndpointProvisioningState. */ + public static final EndpointProvisioningState FAILED = fromString("Failed"); + + /** Static value Canceled for EndpointProvisioningState. */ + public static final EndpointProvisioningState CANCELED = fromString("Canceled"); + + /** Static value Deleted for EndpointProvisioningState. */ + public static final EndpointProvisioningState DELETED = fromString("Deleted"); + + /** Static value Warning for EndpointProvisioningState. */ + public static final EndpointProvisioningState WARNING = fromString("Warning"); + + /** Static value Suspending for EndpointProvisioningState. */ + public static final EndpointProvisioningState SUSPENDING = fromString("Suspending"); + + /** Static value Restoring for EndpointProvisioningState. */ + public static final EndpointProvisioningState RESTORING = fromString("Restoring"); + + /** Static value Moving for EndpointProvisioningState. */ + public static final EndpointProvisioningState MOVING = fromString("Moving"); + + /** Static value Disabled for EndpointProvisioningState. */ + public static final EndpointProvisioningState DISABLED = fromString("Disabled"); + + /** + * Creates or finds a EndpointProvisioningState from its string representation. + * @param name a name to look for + * @return the corresponding EndpointProvisioningState + */ + @JsonCreator + public static EndpointProvisioningState fromString(String name) { + return fromString(name, EndpointProvisioningState.class); + } + + /** + * @return known EndpointProvisioningState values + */ + public static Collection values() { + return values(EndpointProvisioningState.class); + } +} diff --git a/sdk/digitaltwins/mgmt-v2020_12_01/src/main/java/com/microsoft/azure/management/digitaltwins/v2020_12_01/ErrorDefinition.java b/sdk/digitaltwins/mgmt-v2020_12_01/src/main/java/com/microsoft/azure/management/digitaltwins/v2020_12_01/ErrorDefinition.java new file mode 100644 index 0000000000000..f19c75bcc90ff --- /dev/null +++ b/sdk/digitaltwins/mgmt-v2020_12_01/src/main/java/com/microsoft/azure/management/digitaltwins/v2020_12_01/ErrorDefinition.java @@ -0,0 +1,64 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.digitaltwins.v2020_12_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Error definition. + */ +public class ErrorDefinition { + /** + * Service specific error code which serves as the substatus for the HTTP + * error code. + */ + @JsonProperty(value = "code", access = JsonProperty.Access.WRITE_ONLY) + private String code; + + /** + * Description of the error. + */ + @JsonProperty(value = "message", access = JsonProperty.Access.WRITE_ONLY) + private String message; + + /** + * Internal error details. + */ + @JsonProperty(value = "details", access = JsonProperty.Access.WRITE_ONLY) + private List details; + + /** + * Get service specific error code which serves as the substatus for the HTTP error code. + * + * @return the code value + */ + public String code() { + return this.code; + } + + /** + * Get description of the error. + * + * @return the message value + */ + public String message() { + return this.message; + } + + /** + * Get internal error details. + * + * @return the details value + */ + public List details() { + return this.details; + } + +} diff --git a/sdk/digitaltwins/mgmt-v2020_12_01/src/main/java/com/microsoft/azure/management/digitaltwins/v2020_12_01/ErrorResponse.java b/sdk/digitaltwins/mgmt-v2020_12_01/src/main/java/com/microsoft/azure/management/digitaltwins/v2020_12_01/ErrorResponse.java new file mode 100644 index 0000000000000..a9cb80ecd331f --- /dev/null +++ b/sdk/digitaltwins/mgmt-v2020_12_01/src/main/java/com/microsoft/azure/management/digitaltwins/v2020_12_01/ErrorResponse.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.digitaltwins.v2020_12_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Error response. + */ +public class ErrorResponse { + /** + * Error description. + */ + @JsonProperty(value = "error") + private ErrorDefinition error; + + /** + * Get error description. + * + * @return the error value + */ + public ErrorDefinition error() { + return this.error; + } + + /** + * Set error description. + * + * @param error the error value to set + * @return the ErrorResponse object itself. + */ + public ErrorResponse withError(ErrorDefinition error) { + this.error = error; + return this; + } + +} diff --git a/sdk/digitaltwins/mgmt-v2020_12_01/src/main/java/com/microsoft/azure/management/digitaltwins/v2020_12_01/ErrorResponseException.java b/sdk/digitaltwins/mgmt-v2020_12_01/src/main/java/com/microsoft/azure/management/digitaltwins/v2020_12_01/ErrorResponseException.java new file mode 100644 index 0000000000000..02a83e5447ccc --- /dev/null +++ b/sdk/digitaltwins/mgmt-v2020_12_01/src/main/java/com/microsoft/azure/management/digitaltwins/v2020_12_01/ErrorResponseException.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.digitaltwins.v2020_12_01; + +import com.microsoft.rest.RestException; +import okhttp3.ResponseBody; +import retrofit2.Response; + +/** + * Exception thrown for an invalid response with ErrorResponse information. + */ +public class ErrorResponseException extends RestException { + /** + * Initializes a new instance of the ErrorResponseException class. + * + * @param message the exception message or the response content if a message is not available + * @param response the HTTP response + */ + public ErrorResponseException(final String message, final Response response) { + super(message, response); + } + + /** + * Initializes a new instance of the ErrorResponseException class. + * + * @param message the exception message or the response content if a message is not available + * @param response the HTTP response + * @param body the deserialized response body + */ + public ErrorResponseException(final String message, final Response response, final ErrorResponse body) { + super(message, response, body); + } + + @Override + public ErrorResponse body() { + return (ErrorResponse) super.body(); + } +} diff --git a/sdk/digitaltwins/mgmt-v2020_12_01/src/main/java/com/microsoft/azure/management/digitaltwins/v2020_12_01/EventGrid.java b/sdk/digitaltwins/mgmt-v2020_12_01/src/main/java/com/microsoft/azure/management/digitaltwins/v2020_12_01/EventGrid.java new file mode 100644 index 0000000000000..ac34575fd97b9 --- /dev/null +++ b/sdk/digitaltwins/mgmt-v2020_12_01/src/main/java/com/microsoft/azure/management/digitaltwins/v2020_12_01/EventGrid.java @@ -0,0 +1,99 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.digitaltwins.v2020_12_01; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Properties related to EventGrid. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "endpointType", defaultImpl = EventGrid.class) +@JsonTypeName("EventGrid") +public class EventGrid extends DigitalTwinsEndpointResourceProperties { + /** + * EventGrid Topic Endpoint. + */ + @JsonProperty(value = "TopicEndpoint", required = true) + private String topicEndpoint; + + /** + * EventGrid secondary accesskey. Will be obfuscated during read. + */ + @JsonProperty(value = "accessKey1", required = true) + private String accessKey1; + + /** + * EventGrid secondary accesskey. Will be obfuscated during read. + */ + @JsonProperty(value = "accessKey2") + private String accessKey2; + + /** + * Get eventGrid Topic Endpoint. + * + * @return the topicEndpoint value + */ + public String topicEndpoint() { + return this.topicEndpoint; + } + + /** + * Set eventGrid Topic Endpoint. + * + * @param topicEndpoint the topicEndpoint value to set + * @return the EventGrid object itself. + */ + public EventGrid withTopicEndpoint(String topicEndpoint) { + this.topicEndpoint = topicEndpoint; + return this; + } + + /** + * Get eventGrid secondary accesskey. Will be obfuscated during read. + * + * @return the accessKey1 value + */ + public String accessKey1() { + return this.accessKey1; + } + + /** + * Set eventGrid secondary accesskey. Will be obfuscated during read. + * + * @param accessKey1 the accessKey1 value to set + * @return the EventGrid object itself. + */ + public EventGrid withAccessKey1(String accessKey1) { + this.accessKey1 = accessKey1; + return this; + } + + /** + * Get eventGrid secondary accesskey. Will be obfuscated during read. + * + * @return the accessKey2 value + */ + public String accessKey2() { + return this.accessKey2; + } + + /** + * Set eventGrid secondary accesskey. Will be obfuscated during read. + * + * @param accessKey2 the accessKey2 value to set + * @return the EventGrid object itself. + */ + public EventGrid withAccessKey2(String accessKey2) { + this.accessKey2 = accessKey2; + return this; + } + +} diff --git a/sdk/digitaltwins/mgmt-v2020_12_01/src/main/java/com/microsoft/azure/management/digitaltwins/v2020_12_01/EventHub.java b/sdk/digitaltwins/mgmt-v2020_12_01/src/main/java/com/microsoft/azure/management/digitaltwins/v2020_12_01/EventHub.java new file mode 100644 index 0000000000000..e353e39c77c6d --- /dev/null +++ b/sdk/digitaltwins/mgmt-v2020_12_01/src/main/java/com/microsoft/azure/management/digitaltwins/v2020_12_01/EventHub.java @@ -0,0 +1,129 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.digitaltwins.v2020_12_01; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Properties related to EventHub. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "endpointType", defaultImpl = EventHub.class) +@JsonTypeName("EventHub") +public class EventHub extends DigitalTwinsEndpointResourceProperties { + /** + * PrimaryConnectionString of the endpoint for key-based authentication. + * Will be obfuscated during read. + */ + @JsonProperty(value = "connectionStringPrimaryKey") + private String connectionStringPrimaryKey; + + /** + * SecondaryConnectionString of the endpoint for key-based authentication. + * Will be obfuscated during read. + */ + @JsonProperty(value = "connectionStringSecondaryKey") + private String connectionStringSecondaryKey; + + /** + * The URL of the EventHub namespace for identity-based authentication. It + * must include the protocol sb://. + */ + @JsonProperty(value = "endpointUri") + private String endpointUri; + + /** + * The EventHub name in the EventHub namespace for identity-based + * authentication. + */ + @JsonProperty(value = "entityPath") + private String entityPath; + + /** + * Get primaryConnectionString of the endpoint for key-based authentication. Will be obfuscated during read. + * + * @return the connectionStringPrimaryKey value + */ + public String connectionStringPrimaryKey() { + return this.connectionStringPrimaryKey; + } + + /** + * Set primaryConnectionString of the endpoint for key-based authentication. Will be obfuscated during read. + * + * @param connectionStringPrimaryKey the connectionStringPrimaryKey value to set + * @return the EventHub object itself. + */ + public EventHub withConnectionStringPrimaryKey(String connectionStringPrimaryKey) { + this.connectionStringPrimaryKey = connectionStringPrimaryKey; + return this; + } + + /** + * Get secondaryConnectionString of the endpoint for key-based authentication. Will be obfuscated during read. + * + * @return the connectionStringSecondaryKey value + */ + public String connectionStringSecondaryKey() { + return this.connectionStringSecondaryKey; + } + + /** + * Set secondaryConnectionString of the endpoint for key-based authentication. Will be obfuscated during read. + * + * @param connectionStringSecondaryKey the connectionStringSecondaryKey value to set + * @return the EventHub object itself. + */ + public EventHub withConnectionStringSecondaryKey(String connectionStringSecondaryKey) { + this.connectionStringSecondaryKey = connectionStringSecondaryKey; + return this; + } + + /** + * Get the URL of the EventHub namespace for identity-based authentication. It must include the protocol sb://. + * + * @return the endpointUri value + */ + public String endpointUri() { + return this.endpointUri; + } + + /** + * Set the URL of the EventHub namespace for identity-based authentication. It must include the protocol sb://. + * + * @param endpointUri the endpointUri value to set + * @return the EventHub object itself. + */ + public EventHub withEndpointUri(String endpointUri) { + this.endpointUri = endpointUri; + return this; + } + + /** + * Get the EventHub name in the EventHub namespace for identity-based authentication. + * + * @return the entityPath value + */ + public String entityPath() { + return this.entityPath; + } + + /** + * Set the EventHub name in the EventHub namespace for identity-based authentication. + * + * @param entityPath the entityPath value to set + * @return the EventHub object itself. + */ + public EventHub withEntityPath(String entityPath) { + this.entityPath = entityPath; + return this; + } + +} diff --git a/sdk/digitaltwins/mgmt-v2020_12_01/src/main/java/com/microsoft/azure/management/digitaltwins/v2020_12_01/ExternalResource.java b/sdk/digitaltwins/mgmt-v2020_12_01/src/main/java/com/microsoft/azure/management/digitaltwins/v2020_12_01/ExternalResource.java new file mode 100644 index 0000000000000..50994de59069c --- /dev/null +++ b/sdk/digitaltwins/mgmt-v2020_12_01/src/main/java/com/microsoft/azure/management/digitaltwins/v2020_12_01/ExternalResource.java @@ -0,0 +1,17 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.digitaltwins.v2020_12_01; + +import com.microsoft.azure.ProxyResource; + +/** + * Definition of a resource. + */ +public class ExternalResource extends ProxyResource { +} diff --git a/sdk/digitaltwins/mgmt-v2020_12_01/src/main/java/com/microsoft/azure/management/digitaltwins/v2020_12_01/GroupIdInformationProperties.java b/sdk/digitaltwins/mgmt-v2020_12_01/src/main/java/com/microsoft/azure/management/digitaltwins/v2020_12_01/GroupIdInformationProperties.java new file mode 100644 index 0000000000000..5ca68e7ed59e8 --- /dev/null +++ b/sdk/digitaltwins/mgmt-v2020_12_01/src/main/java/com/microsoft/azure/management/digitaltwins/v2020_12_01/GroupIdInformationProperties.java @@ -0,0 +1,96 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.digitaltwins.v2020_12_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The properties for a group information object. + */ +public class GroupIdInformationProperties { + /** + * The group id. + */ + @JsonProperty(value = "groupId") + private String groupId; + + /** + * The required members for a specific group id. + */ + @JsonProperty(value = "requiredMembers") + private List requiredMembers; + + /** + * The required DNS zones for a specific group id. + */ + @JsonProperty(value = "requiredZoneNames") + private List requiredZoneNames; + + /** + * Get the group id. + * + * @return the groupId value + */ + public String groupId() { + return this.groupId; + } + + /** + * Set the group id. + * + * @param groupId the groupId value to set + * @return the GroupIdInformationProperties object itself. + */ + public GroupIdInformationProperties withGroupId(String groupId) { + this.groupId = groupId; + return this; + } + + /** + * Get the required members for a specific group id. + * + * @return the requiredMembers value + */ + public List requiredMembers() { + return this.requiredMembers; + } + + /** + * Set the required members for a specific group id. + * + * @param requiredMembers the requiredMembers value to set + * @return the GroupIdInformationProperties object itself. + */ + public GroupIdInformationProperties withRequiredMembers(List requiredMembers) { + this.requiredMembers = requiredMembers; + return this; + } + + /** + * Get the required DNS zones for a specific group id. + * + * @return the requiredZoneNames value + */ + public List requiredZoneNames() { + return this.requiredZoneNames; + } + + /** + * Set the required DNS zones for a specific group id. + * + * @param requiredZoneNames the requiredZoneNames value to set + * @return the GroupIdInformationProperties object itself. + */ + public GroupIdInformationProperties withRequiredZoneNames(List requiredZoneNames) { + this.requiredZoneNames = requiredZoneNames; + return this; + } + +} diff --git a/sdk/digitaltwins/mgmt-v2020_12_01/src/main/java/com/microsoft/azure/management/digitaltwins/v2020_12_01/GroupIdInformationPropertiesModel.java b/sdk/digitaltwins/mgmt-v2020_12_01/src/main/java/com/microsoft/azure/management/digitaltwins/v2020_12_01/GroupIdInformationPropertiesModel.java new file mode 100644 index 0000000000000..0ffe1df56db77 --- /dev/null +++ b/sdk/digitaltwins/mgmt-v2020_12_01/src/main/java/com/microsoft/azure/management/digitaltwins/v2020_12_01/GroupIdInformationPropertiesModel.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.digitaltwins.v2020_12_01; + + +/** + * The GroupIdInformationPropertiesModel model. + */ +public class GroupIdInformationPropertiesModel extends GroupIdInformationProperties { +} diff --git a/sdk/digitaltwins/mgmt-v2020_12_01/src/main/java/com/microsoft/azure/management/digitaltwins/v2020_12_01/Operation.java b/sdk/digitaltwins/mgmt-v2020_12_01/src/main/java/com/microsoft/azure/management/digitaltwins/v2020_12_01/Operation.java new file mode 100644 index 0000000000000..6e2a395995877 --- /dev/null +++ b/sdk/digitaltwins/mgmt-v2020_12_01/src/main/java/com/microsoft/azure/management/digitaltwins/v2020_12_01/Operation.java @@ -0,0 +1,40 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.digitaltwins.v2020_12_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.digitaltwins.v2020_12_01.implementation.DigitalTwinsManager; +import com.microsoft.azure.management.digitaltwins.v2020_12_01.implementation.OperationInner; + +/** + * Type representing Operation. + */ +public interface Operation extends HasInner, HasManager { + /** + * @return the display value. + */ + OperationDisplay display(); + + /** + * @return the isDataAction value. + */ + Boolean isDataAction(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the origin value. + */ + String origin(); + +} diff --git a/sdk/digitaltwins/mgmt-v2020_12_01/src/main/java/com/microsoft/azure/management/digitaltwins/v2020_12_01/OperationDisplay.java b/sdk/digitaltwins/mgmt-v2020_12_01/src/main/java/com/microsoft/azure/management/digitaltwins/v2020_12_01/OperationDisplay.java new file mode 100644 index 0000000000000..d7cae49357c1f --- /dev/null +++ b/sdk/digitaltwins/mgmt-v2020_12_01/src/main/java/com/microsoft/azure/management/digitaltwins/v2020_12_01/OperationDisplay.java @@ -0,0 +1,77 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.digitaltwins.v2020_12_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The object that represents the operation. + */ +public class OperationDisplay { + /** + * Service provider: Microsoft DigitalTwins. + */ + @JsonProperty(value = "provider", access = JsonProperty.Access.WRITE_ONLY) + private String provider; + + /** + * Resource Type: DigitalTwinsInstances. + */ + @JsonProperty(value = "resource", access = JsonProperty.Access.WRITE_ONLY) + private String resource; + + /** + * Name of the operation. + */ + @JsonProperty(value = "operation", access = JsonProperty.Access.WRITE_ONLY) + private String operation; + + /** + * Friendly description for the operation,. + */ + @JsonProperty(value = "description", access = JsonProperty.Access.WRITE_ONLY) + private String description; + + /** + * Get service provider: Microsoft DigitalTwins. + * + * @return the provider value + */ + public String provider() { + return this.provider; + } + + /** + * Get resource Type: DigitalTwinsInstances. + * + * @return the resource value + */ + public String resource() { + return this.resource; + } + + /** + * Get name of the operation. + * + * @return the operation value + */ + public String operation() { + return this.operation; + } + + /** + * Get friendly description for the operation,. + * + * @return the description value + */ + public String description() { + return this.description; + } + +} diff --git a/sdk/digitaltwins/mgmt-v2020_12_01/src/main/java/com/microsoft/azure/management/digitaltwins/v2020_12_01/Operations.java b/sdk/digitaltwins/mgmt-v2020_12_01/src/main/java/com/microsoft/azure/management/digitaltwins/v2020_12_01/Operations.java new file mode 100644 index 0000000000000..608a03d545bde --- /dev/null +++ b/sdk/digitaltwins/mgmt-v2020_12_01/src/main/java/com/microsoft/azure/management/digitaltwins/v2020_12_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.digitaltwins.v2020_12_01; + +import rx.Observable; +import com.microsoft.azure.management.digitaltwins.v2020_12_01.implementation.OperationsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing Operations. + */ +public interface Operations extends HasInner { + /** + * Lists all of the available DigitalTwins service REST API operations. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(); + +} diff --git a/sdk/digitaltwins/mgmt-v2020_12_01/src/main/java/com/microsoft/azure/management/digitaltwins/v2020_12_01/PrivateEndpoint.java b/sdk/digitaltwins/mgmt-v2020_12_01/src/main/java/com/microsoft/azure/management/digitaltwins/v2020_12_01/PrivateEndpoint.java new file mode 100644 index 0000000000000..88a0367508267 --- /dev/null +++ b/sdk/digitaltwins/mgmt-v2020_12_01/src/main/java/com/microsoft/azure/management/digitaltwins/v2020_12_01/PrivateEndpoint.java @@ -0,0 +1,32 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.digitaltwins.v2020_12_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The private endpoint property of a private endpoint connection. + */ +public class PrivateEndpoint { + /** + * The resource identifier. + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /** + * Get the resource identifier. + * + * @return the id value + */ + public String id() { + return this.id; + } + +} diff --git a/sdk/digitaltwins/mgmt-v2020_12_01/src/main/java/com/microsoft/azure/management/digitaltwins/v2020_12_01/PrivateEndpointConnectionProperties.java b/sdk/digitaltwins/mgmt-v2020_12_01/src/main/java/com/microsoft/azure/management/digitaltwins/v2020_12_01/PrivateEndpointConnectionProperties.java new file mode 100644 index 0000000000000..864f9ffcb0d66 --- /dev/null +++ b/sdk/digitaltwins/mgmt-v2020_12_01/src/main/java/com/microsoft/azure/management/digitaltwins/v2020_12_01/PrivateEndpointConnectionProperties.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.digitaltwins.v2020_12_01; + + +/** + * The PrivateEndpointConnectionProperties model. + */ +public class PrivateEndpointConnectionProperties extends PrivateEndpointConnectionPropertiesModel { +} diff --git a/sdk/digitaltwins/mgmt-v2020_12_01/src/main/java/com/microsoft/azure/management/digitaltwins/v2020_12_01/PrivateEndpointConnectionPropertiesModel.java b/sdk/digitaltwins/mgmt-v2020_12_01/src/main/java/com/microsoft/azure/management/digitaltwins/v2020_12_01/PrivateEndpointConnectionPropertiesModel.java new file mode 100644 index 0000000000000..5cf74b196b2d4 --- /dev/null +++ b/sdk/digitaltwins/mgmt-v2020_12_01/src/main/java/com/microsoft/azure/management/digitaltwins/v2020_12_01/PrivateEndpointConnectionPropertiesModel.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.digitaltwins.v2020_12_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The properties of a private endpoint connection. + */ +public class PrivateEndpointConnectionPropertiesModel { + /** + * The privateEndpoint property. + */ + @JsonProperty(value = "privateEndpoint") + private PrivateEndpointConnectionPropertiesPrivateEndpoint privateEndpoint; + + /** + * The privateLinkServiceConnectionState property. + */ + @JsonProperty(value = "privateLinkServiceConnectionState") + private PrivateEndpointConnectionPropertiesPrivateLinkServiceConnectionState privateLinkServiceConnectionState; + + /** + * Get the privateEndpoint value. + * + * @return the privateEndpoint value + */ + public PrivateEndpointConnectionPropertiesPrivateEndpoint privateEndpoint() { + return this.privateEndpoint; + } + + /** + * Set the privateEndpoint value. + * + * @param privateEndpoint the privateEndpoint value to set + * @return the PrivateEndpointConnectionPropertiesModel object itself. + */ + public PrivateEndpointConnectionPropertiesModel withPrivateEndpoint(PrivateEndpointConnectionPropertiesPrivateEndpoint privateEndpoint) { + this.privateEndpoint = privateEndpoint; + return this; + } + + /** + * Get the privateLinkServiceConnectionState value. + * + * @return the privateLinkServiceConnectionState value + */ + public PrivateEndpointConnectionPropertiesPrivateLinkServiceConnectionState privateLinkServiceConnectionState() { + return this.privateLinkServiceConnectionState; + } + + /** + * Set the privateLinkServiceConnectionState value. + * + * @param privateLinkServiceConnectionState the privateLinkServiceConnectionState value to set + * @return the PrivateEndpointConnectionPropertiesModel object itself. + */ + public PrivateEndpointConnectionPropertiesModel withPrivateLinkServiceConnectionState(PrivateEndpointConnectionPropertiesPrivateLinkServiceConnectionState privateLinkServiceConnectionState) { + this.privateLinkServiceConnectionState = privateLinkServiceConnectionState; + return this; + } + +} diff --git a/sdk/digitaltwins/mgmt-v2020_12_01/src/main/java/com/microsoft/azure/management/digitaltwins/v2020_12_01/PrivateEndpointConnectionPropertiesPrivateEndpoint.java b/sdk/digitaltwins/mgmt-v2020_12_01/src/main/java/com/microsoft/azure/management/digitaltwins/v2020_12_01/PrivateEndpointConnectionPropertiesPrivateEndpoint.java new file mode 100644 index 0000000000000..fc2b2a61cbcdb --- /dev/null +++ b/sdk/digitaltwins/mgmt-v2020_12_01/src/main/java/com/microsoft/azure/management/digitaltwins/v2020_12_01/PrivateEndpointConnectionPropertiesPrivateEndpoint.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.digitaltwins.v2020_12_01; + + +/** + * The PrivateEndpointConnectionPropertiesPrivateEndpoint model. + */ +public class PrivateEndpointConnectionPropertiesPrivateEndpoint extends PrivateEndpoint { +} diff --git a/sdk/digitaltwins/mgmt-v2020_12_01/src/main/java/com/microsoft/azure/management/digitaltwins/v2020_12_01/PrivateEndpointConnectionPropertiesPrivateLinkServiceConnectionState.java b/sdk/digitaltwins/mgmt-v2020_12_01/src/main/java/com/microsoft/azure/management/digitaltwins/v2020_12_01/PrivateEndpointConnectionPropertiesPrivateLinkServiceConnectionState.java new file mode 100644 index 0000000000000..6077b8e939a8d --- /dev/null +++ b/sdk/digitaltwins/mgmt-v2020_12_01/src/main/java/com/microsoft/azure/management/digitaltwins/v2020_12_01/PrivateEndpointConnectionPropertiesPrivateLinkServiceConnectionState.java @@ -0,0 +1,17 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.digitaltwins.v2020_12_01; + + +/** + * The PrivateEndpointConnectionPropertiesPrivateLinkServiceConnectionState + * model. + */ +public class PrivateEndpointConnectionPropertiesPrivateLinkServiceConnectionState extends PrivateLinkServiceConnectionState { +} diff --git a/sdk/digitaltwins/mgmt-v2020_12_01/src/main/java/com/microsoft/azure/management/digitaltwins/v2020_12_01/PrivateLinkServiceConnectionState.java b/sdk/digitaltwins/mgmt-v2020_12_01/src/main/java/com/microsoft/azure/management/digitaltwins/v2020_12_01/PrivateLinkServiceConnectionState.java new file mode 100644 index 0000000000000..fb5c6b560062f --- /dev/null +++ b/sdk/digitaltwins/mgmt-v2020_12_01/src/main/java/com/microsoft/azure/management/digitaltwins/v2020_12_01/PrivateLinkServiceConnectionState.java @@ -0,0 +1,96 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.digitaltwins.v2020_12_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The current state of a private endpoint connection. + */ +public class PrivateLinkServiceConnectionState { + /** + * The status of a private endpoint connection. Possible values include: + * 'Pending', 'Approved', 'Rejected', 'Disconnected'. + */ + @JsonProperty(value = "status", required = true) + private PrivateLinkServiceConnectionStatus status; + + /** + * The description for the current state of a private endpoint connection. + */ + @JsonProperty(value = "description", required = true) + private String description; + + /** + * Actions required for a private endpoint connection. + */ + @JsonProperty(value = "actionsRequired") + private String actionsRequired; + + /** + * Get the status of a private endpoint connection. Possible values include: 'Pending', 'Approved', 'Rejected', 'Disconnected'. + * + * @return the status value + */ + public PrivateLinkServiceConnectionStatus status() { + return this.status; + } + + /** + * Set the status of a private endpoint connection. Possible values include: 'Pending', 'Approved', 'Rejected', 'Disconnected'. + * + * @param status the status value to set + * @return the PrivateLinkServiceConnectionState object itself. + */ + public PrivateLinkServiceConnectionState withStatus(PrivateLinkServiceConnectionStatus status) { + this.status = status; + return this; + } + + /** + * Get the description for the current state of a private endpoint connection. + * + * @return the description value + */ + public String description() { + return this.description; + } + + /** + * Set the description for the current state of a private endpoint connection. + * + * @param description the description value to set + * @return the PrivateLinkServiceConnectionState object itself. + */ + public PrivateLinkServiceConnectionState withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get actions required for a private endpoint connection. + * + * @return the actionsRequired value + */ + public String actionsRequired() { + return this.actionsRequired; + } + + /** + * Set actions required for a private endpoint connection. + * + * @param actionsRequired the actionsRequired value to set + * @return the PrivateLinkServiceConnectionState object itself. + */ + public PrivateLinkServiceConnectionState withActionsRequired(String actionsRequired) { + this.actionsRequired = actionsRequired; + return this; + } + +} diff --git a/sdk/digitaltwins/mgmt-v2020_12_01/src/main/java/com/microsoft/azure/management/digitaltwins/v2020_12_01/PrivateLinkServiceConnectionStatus.java b/sdk/digitaltwins/mgmt-v2020_12_01/src/main/java/com/microsoft/azure/management/digitaltwins/v2020_12_01/PrivateLinkServiceConnectionStatus.java new file mode 100644 index 0000000000000..24970a435e494 --- /dev/null +++ b/sdk/digitaltwins/mgmt-v2020_12_01/src/main/java/com/microsoft/azure/management/digitaltwins/v2020_12_01/PrivateLinkServiceConnectionStatus.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.digitaltwins.v2020_12_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for PrivateLinkServiceConnectionStatus. + */ +public final class PrivateLinkServiceConnectionStatus extends ExpandableStringEnum { + /** Static value Pending for PrivateLinkServiceConnectionStatus. */ + public static final PrivateLinkServiceConnectionStatus PENDING = fromString("Pending"); + + /** Static value Approved for PrivateLinkServiceConnectionStatus. */ + public static final PrivateLinkServiceConnectionStatus APPROVED = fromString("Approved"); + + /** Static value Rejected for PrivateLinkServiceConnectionStatus. */ + public static final PrivateLinkServiceConnectionStatus REJECTED = fromString("Rejected"); + + /** Static value Disconnected for PrivateLinkServiceConnectionStatus. */ + public static final PrivateLinkServiceConnectionStatus DISCONNECTED = fromString("Disconnected"); + + /** + * Creates or finds a PrivateLinkServiceConnectionStatus from its string representation. + * @param name a name to look for + * @return the corresponding PrivateLinkServiceConnectionStatus + */ + @JsonCreator + public static PrivateLinkServiceConnectionStatus fromString(String name) { + return fromString(name, PrivateLinkServiceConnectionStatus.class); + } + + /** + * @return known PrivateLinkServiceConnectionStatus values + */ + public static Collection values() { + return values(PrivateLinkServiceConnectionStatus.class); + } +} diff --git a/sdk/digitaltwins/mgmt-v2020_12_01/src/main/java/com/microsoft/azure/management/digitaltwins/v2020_12_01/ProvisioningState.java b/sdk/digitaltwins/mgmt-v2020_12_01/src/main/java/com/microsoft/azure/management/digitaltwins/v2020_12_01/ProvisioningState.java new file mode 100644 index 0000000000000..0b8435cf15f55 --- /dev/null +++ b/sdk/digitaltwins/mgmt-v2020_12_01/src/main/java/com/microsoft/azure/management/digitaltwins/v2020_12_01/ProvisioningState.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.digitaltwins.v2020_12_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for ProvisioningState. + */ +public final class ProvisioningState extends ExpandableStringEnum { + /** Static value Provisioning for ProvisioningState. */ + public static final ProvisioningState PROVISIONING = fromString("Provisioning"); + + /** Static value Deleting for ProvisioningState. */ + public static final ProvisioningState DELETING = fromString("Deleting"); + + /** Static value Updating for ProvisioningState. */ + public static final ProvisioningState UPDATING = fromString("Updating"); + + /** Static value Succeeded for ProvisioningState. */ + public static final ProvisioningState SUCCEEDED = fromString("Succeeded"); + + /** Static value Failed for ProvisioningState. */ + public static final ProvisioningState FAILED = fromString("Failed"); + + /** Static value Canceled for ProvisioningState. */ + public static final ProvisioningState CANCELED = fromString("Canceled"); + + /** Static value Deleted for ProvisioningState. */ + public static final ProvisioningState DELETED = fromString("Deleted"); + + /** Static value Warning for ProvisioningState. */ + public static final ProvisioningState WARNING = fromString("Warning"); + + /** Static value Suspending for ProvisioningState. */ + public static final ProvisioningState SUSPENDING = fromString("Suspending"); + + /** Static value Restoring for ProvisioningState. */ + public static final ProvisioningState RESTORING = fromString("Restoring"); + + /** Static value Moving for ProvisioningState. */ + public static final ProvisioningState MOVING = fromString("Moving"); + + /** + * Creates or finds a ProvisioningState from its string representation. + * @param name a name to look for + * @return the corresponding ProvisioningState + */ + @JsonCreator + public static ProvisioningState fromString(String name) { + return fromString(name, ProvisioningState.class); + } + + /** + * @return known ProvisioningState values + */ + public static Collection values() { + return values(ProvisioningState.class); + } +} diff --git a/sdk/digitaltwins/mgmt-v2020_12_01/src/main/java/com/microsoft/azure/management/digitaltwins/v2020_12_01/Reason.java b/sdk/digitaltwins/mgmt-v2020_12_01/src/main/java/com/microsoft/azure/management/digitaltwins/v2020_12_01/Reason.java new file mode 100644 index 0000000000000..024f6039eb8fa --- /dev/null +++ b/sdk/digitaltwins/mgmt-v2020_12_01/src/main/java/com/microsoft/azure/management/digitaltwins/v2020_12_01/Reason.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.digitaltwins.v2020_12_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for Reason. + */ +public final class Reason extends ExpandableStringEnum { + /** Static value Invalid for Reason. */ + public static final Reason INVALID = fromString("Invalid"); + + /** Static value AlreadyExists for Reason. */ + public static final Reason ALREADY_EXISTS = fromString("AlreadyExists"); + + /** + * Creates or finds a Reason from its string representation. + * @param name a name to look for + * @return the corresponding Reason + */ + @JsonCreator + public static Reason fromString(String name) { + return fromString(name, Reason.class); + } + + /** + * @return known Reason values + */ + public static Collection values() { + return values(Reason.class); + } +} diff --git a/sdk/digitaltwins/mgmt-v2020_12_01/src/main/java/com/microsoft/azure/management/digitaltwins/v2020_12_01/ServiceBus.java b/sdk/digitaltwins/mgmt-v2020_12_01/src/main/java/com/microsoft/azure/management/digitaltwins/v2020_12_01/ServiceBus.java new file mode 100644 index 0000000000000..2bee6364cb18b --- /dev/null +++ b/sdk/digitaltwins/mgmt-v2020_12_01/src/main/java/com/microsoft/azure/management/digitaltwins/v2020_12_01/ServiceBus.java @@ -0,0 +1,128 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.digitaltwins.v2020_12_01; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Properties related to ServiceBus. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "endpointType", defaultImpl = ServiceBus.class) +@JsonTypeName("ServiceBus") +public class ServiceBus extends DigitalTwinsEndpointResourceProperties { + /** + * PrimaryConnectionString of the endpoint for key-based authentication. + * Will be obfuscated during read. + */ + @JsonProperty(value = "primaryConnectionString") + private String primaryConnectionString; + + /** + * SecondaryConnectionString of the endpoint for key-based authentication. + * Will be obfuscated during read. + */ + @JsonProperty(value = "secondaryConnectionString") + private String secondaryConnectionString; + + /** + * The URL of the ServiceBus namespace for identity-based authentication. + * It must include the protocol sb://. + */ + @JsonProperty(value = "endpointUri") + private String endpointUri; + + /** + * The ServiceBus Topic name for identity-based authentication. + */ + @JsonProperty(value = "entityPath") + private String entityPath; + + /** + * Get primaryConnectionString of the endpoint for key-based authentication. Will be obfuscated during read. + * + * @return the primaryConnectionString value + */ + public String primaryConnectionString() { + return this.primaryConnectionString; + } + + /** + * Set primaryConnectionString of the endpoint for key-based authentication. Will be obfuscated during read. + * + * @param primaryConnectionString the primaryConnectionString value to set + * @return the ServiceBus object itself. + */ + public ServiceBus withPrimaryConnectionString(String primaryConnectionString) { + this.primaryConnectionString = primaryConnectionString; + return this; + } + + /** + * Get secondaryConnectionString of the endpoint for key-based authentication. Will be obfuscated during read. + * + * @return the secondaryConnectionString value + */ + public String secondaryConnectionString() { + return this.secondaryConnectionString; + } + + /** + * Set secondaryConnectionString of the endpoint for key-based authentication. Will be obfuscated during read. + * + * @param secondaryConnectionString the secondaryConnectionString value to set + * @return the ServiceBus object itself. + */ + public ServiceBus withSecondaryConnectionString(String secondaryConnectionString) { + this.secondaryConnectionString = secondaryConnectionString; + return this; + } + + /** + * Get the URL of the ServiceBus namespace for identity-based authentication. It must include the protocol sb://. + * + * @return the endpointUri value + */ + public String endpointUri() { + return this.endpointUri; + } + + /** + * Set the URL of the ServiceBus namespace for identity-based authentication. It must include the protocol sb://. + * + * @param endpointUri the endpointUri value to set + * @return the ServiceBus object itself. + */ + public ServiceBus withEndpointUri(String endpointUri) { + this.endpointUri = endpointUri; + return this; + } + + /** + * Get the ServiceBus Topic name for identity-based authentication. + * + * @return the entityPath value + */ + public String entityPath() { + return this.entityPath; + } + + /** + * Set the ServiceBus Topic name for identity-based authentication. + * + * @param entityPath the entityPath value to set + * @return the ServiceBus object itself. + */ + public ServiceBus withEntityPath(String entityPath) { + this.entityPath = entityPath; + return this; + } + +} diff --git a/sdk/digitaltwins/mgmt-v2020_12_01/src/main/java/com/microsoft/azure/management/digitaltwins/v2020_12_01/implementation/AzureDigitalTwinsManagementClientImpl.java b/sdk/digitaltwins/mgmt-v2020_12_01/src/main/java/com/microsoft/azure/management/digitaltwins/v2020_12_01/implementation/AzureDigitalTwinsManagementClientImpl.java new file mode 100644 index 0000000000000..262ef7d073f03 --- /dev/null +++ b/sdk/digitaltwins/mgmt-v2020_12_01/src/main/java/com/microsoft/azure/management/digitaltwins/v2020_12_01/implementation/AzureDigitalTwinsManagementClientImpl.java @@ -0,0 +1,984 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.digitaltwins.v2020_12_01.implementation; + +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureClient; +import com.microsoft.azure.AzureServiceClient; +import com.microsoft.azure.management.digitaltwins.v2020_12_01.ErrorResponseException; +import com.microsoft.azure.management.digitaltwins.v2020_12_01.PrivateEndpointConnectionProperties; +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 java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.Path; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * Initializes a new instance of the AzureDigitalTwinsManagementClientImpl class. + */ +public class AzureDigitalTwinsManagementClientImpl extends AzureServiceClient { + /** The Retrofit service to perform REST calls. */ + private AzureDigitalTwinsManagementClientService 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 subscription identifier. */ + private String subscriptionId; + + /** + * Gets The subscription identifier. + * + * @return the subscriptionId value. + */ + public String subscriptionId() { + return this.subscriptionId; + } + + /** + * Sets The subscription identifier. + * + * @param subscriptionId the subscriptionId value. + * @return the service client itself + */ + public AzureDigitalTwinsManagementClientImpl withSubscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; + return this; + } + + /** Version of the DigitalTwinsInstance Management API. */ + private String apiVersion; + + /** + * Gets Version of the DigitalTwinsInstance Management API. + * + * @return the apiVersion value. + */ + public String apiVersion() { + return this.apiVersion; + } + + /** The preferred language for the response. */ + private String acceptLanguage; + + /** + * Gets The preferred language for the response. + * + * @return the acceptLanguage value. + */ + public String acceptLanguage() { + return this.acceptLanguage; + } + + /** + * Sets The preferred language for the response. + * + * @param acceptLanguage the acceptLanguage value. + * @return the service client itself + */ + public AzureDigitalTwinsManagementClientImpl 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 AzureDigitalTwinsManagementClientImpl 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 AzureDigitalTwinsManagementClientImpl withGenerateClientRequestId(boolean generateClientRequestId) { + this.generateClientRequestId = generateClientRequestId; + return this; + } + + /** + * The DigitalTwinsInner object to access its operations. + */ + private DigitalTwinsInner digitalTwins; + + /** + * Gets the DigitalTwinsInner object to access its operations. + * @return the DigitalTwinsInner object. + */ + public DigitalTwinsInner digitalTwins() { + return this.digitalTwins; + } + + /** + * The DigitalTwinsEndpointsInner object to access its operations. + */ + private DigitalTwinsEndpointsInner digitalTwinsEndpoints; + + /** + * Gets the DigitalTwinsEndpointsInner object to access its operations. + * @return the DigitalTwinsEndpointsInner object. + */ + public DigitalTwinsEndpointsInner digitalTwinsEndpoints() { + return this.digitalTwinsEndpoints; + } + + /** + * The OperationsInner object to access its operations. + */ + private OperationsInner operations; + + /** + * Gets the OperationsInner object to access its operations. + * @return the OperationsInner object. + */ + public OperationsInner operations() { + return this.operations; + } + + /** + * Initializes an instance of AzureDigitalTwinsManagementClient client. + * + * @param credentials the management credentials for Azure + */ + public AzureDigitalTwinsManagementClientImpl(ServiceClientCredentials credentials) { + this("https://management.azure.com", credentials); + } + + /** + * Initializes an instance of AzureDigitalTwinsManagementClient client. + * + * @param baseUrl the base URL of the host + * @param credentials the management credentials for Azure + */ + public AzureDigitalTwinsManagementClientImpl(String baseUrl, ServiceClientCredentials credentials) { + super(baseUrl, credentials); + initialize(); + } + + /** + * Initializes an instance of AzureDigitalTwinsManagementClient client. + * + * @param restClient the REST client to connect to Azure. + */ + public AzureDigitalTwinsManagementClientImpl(RestClient restClient) { + super(restClient); + initialize(); + } + + protected void initialize() { + this.apiVersion = "2020-12-01"; + this.acceptLanguage = "en-US"; + this.longRunningOperationRetryTimeout = 30; + this.generateClientRequestId = true; + this.digitalTwins = new DigitalTwinsInner(restClient().retrofit(), this); + this.digitalTwinsEndpoints = new DigitalTwinsEndpointsInner(restClient().retrofit(), this); + this.operations = new OperationsInner(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(), "AzureDigitalTwinsManagementClient", "2020-12-01"); + } + + private void initializeService() { + service = restClient().retrofit().create(AzureDigitalTwinsManagementClientService.class); + } + + /** + * The interface defining all the services for AzureDigitalTwinsManagementClient to be + * used by Retrofit to perform actually REST calls. + */ + interface AzureDigitalTwinsManagementClientService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.digitaltwins.v2020_12_01.AzureDigitalTwinsManagementClient getPrivateLinkResources" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DigitalTwins/digitalTwinsInstances/{resourceName}/privateLinkResources") + Observable> getPrivateLinkResources(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("resourceName") String resourceName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.digitaltwins.v2020_12_01.AzureDigitalTwinsManagementClient getPrivateLinkResourceByResourceId" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DigitalTwins/digitalTwinsInstances/{resourceName}/privateLinkResources/{resourceId}") + Observable> getPrivateLinkResourceByResourceId(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("resourceName") String resourceName, @Path("resourceId") String resourceId, @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.digitaltwins.v2020_12_01.AzureDigitalTwinsManagementClient getPrivateEndpointConnections" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DigitalTwins/digitalTwinsInstances/{resourceName}/privateEndpointConnections") + Observable> getPrivateEndpointConnections(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("resourceName") String resourceName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.digitaltwins.v2020_12_01.AzureDigitalTwinsManagementClient getPrivateEndpointConnectionByName" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DigitalTwins/digitalTwinsInstances/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}") + Observable> getPrivateEndpointConnectionByName(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("resourceName") String resourceName, @Path("privateEndpointConnectionName") String privateEndpointConnectionName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.digitaltwins.v2020_12_01.AzureDigitalTwinsManagementClient deletePrivateEndpointConnection" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DigitalTwins/digitalTwinsInstances/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}", method = "DELETE", hasBody = true) + Observable> deletePrivateEndpointConnection(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("resourceName") String resourceName, @Path("privateEndpointConnectionName") String privateEndpointConnectionName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.digitaltwins.v2020_12_01.AzureDigitalTwinsManagementClient beginDeletePrivateEndpointConnection" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DigitalTwins/digitalTwinsInstances/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}", method = "DELETE", hasBody = true) + Observable> beginDeletePrivateEndpointConnection(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("resourceName") String resourceName, @Path("privateEndpointConnectionName") String privateEndpointConnectionName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.digitaltwins.v2020_12_01.AzureDigitalTwinsManagementClient putPrivateEndpointConnection" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DigitalTwins/digitalTwinsInstances/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}") + Observable> putPrivateEndpointConnection(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("resourceName") String resourceName, @Path("privateEndpointConnectionName") String privateEndpointConnectionName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body PrivateEndpointConnectionInner privateEndpointConnection, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.digitaltwins.v2020_12_01.AzureDigitalTwinsManagementClient beginPutPrivateEndpointConnection" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DigitalTwins/digitalTwinsInstances/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}") + Observable> beginPutPrivateEndpointConnection(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("resourceName") String resourceName, @Path("privateEndpointConnectionName") String privateEndpointConnectionName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body PrivateEndpointConnectionInner privateEndpointConnection, @Header("User-Agent") String userAgent); + + } + + /** + * List private link resources for given Digital Twin. + * + * @param resourceGroupName The name of the resource group that contains the DigitalTwinsInstance. + * @param resourceName The name of the DigitalTwinsInstance. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the List<GroupIdInformationResponseInner> object if successful. + */ + public List getPrivateLinkResources(String resourceGroupName, String resourceName) { + return getPrivateLinkResourcesWithServiceResponseAsync(resourceGroupName, resourceName).toBlocking().single().body(); + } + + /** + * List private link resources for given Digital Twin. + * + * @param resourceGroupName The name of the resource group that contains the DigitalTwinsInstance. + * @param resourceName The name of the DigitalTwinsInstance. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> getPrivateLinkResourcesAsync(String resourceGroupName, String resourceName, final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(getPrivateLinkResourcesWithServiceResponseAsync(resourceGroupName, resourceName), serviceCallback); + } + + /** + * List private link resources for given Digital Twin. + * + * @param resourceGroupName The name of the resource group that contains the DigitalTwinsInstance. + * @param resourceName The name of the DigitalTwinsInstance. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<GroupIdInformationResponseInner> object + */ + public Observable> getPrivateLinkResourcesAsync(String resourceGroupName, String resourceName) { + return getPrivateLinkResourcesWithServiceResponseAsync(resourceGroupName, resourceName).map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List private link resources for given Digital Twin. + * + * @param resourceGroupName The name of the resource group that contains the DigitalTwinsInstance. + * @param resourceName The name of the DigitalTwinsInstance. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<GroupIdInformationResponseInner> object + */ + public Observable>> getPrivateLinkResourcesWithServiceResponseAsync(String resourceGroupName, String resourceName) { + if (this.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (resourceName == null) { + throw new IllegalArgumentException("Parameter resourceName is required and cannot be null."); + } + return service.getPrivateLinkResources(this.subscriptionId(), resourceGroupName, resourceName, this.apiVersion(), this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> clientResponse = getPrivateLinkResourcesDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> getPrivateLinkResourcesDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Get the specified private link resource for the given Digital Twin. + * + * @param resourceGroupName The name of the resource group that contains the DigitalTwinsInstance. + * @param resourceName The name of the DigitalTwinsInstance. + * @param resourceId The name of the private link resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the GroupIdInformationInner object if successful. + */ + public GroupIdInformationInner getPrivateLinkResourceByResourceId(String resourceGroupName, String resourceName, String resourceId) { + return getPrivateLinkResourceByResourceIdWithServiceResponseAsync(resourceGroupName, resourceName, resourceId).toBlocking().single().body(); + } + + /** + * Get the specified private link resource for the given Digital Twin. + * + * @param resourceGroupName The name of the resource group that contains the DigitalTwinsInstance. + * @param resourceName The name of the DigitalTwinsInstance. + * @param resourceId The name of the private link resource. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getPrivateLinkResourceByResourceIdAsync(String resourceGroupName, String resourceName, String resourceId, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getPrivateLinkResourceByResourceIdWithServiceResponseAsync(resourceGroupName, resourceName, resourceId), serviceCallback); + } + + /** + * Get the specified private link resource for the given Digital Twin. + * + * @param resourceGroupName The name of the resource group that contains the DigitalTwinsInstance. + * @param resourceName The name of the DigitalTwinsInstance. + * @param resourceId The name of the private link resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the GroupIdInformationInner object + */ + public Observable getPrivateLinkResourceByResourceIdAsync(String resourceGroupName, String resourceName, String resourceId) { + return getPrivateLinkResourceByResourceIdWithServiceResponseAsync(resourceGroupName, resourceName, resourceId).map(new Func1, GroupIdInformationInner>() { + @Override + public GroupIdInformationInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get the specified private link resource for the given Digital Twin. + * + * @param resourceGroupName The name of the resource group that contains the DigitalTwinsInstance. + * @param resourceName The name of the DigitalTwinsInstance. + * @param resourceId The name of the private link resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the GroupIdInformationInner object + */ + public Observable> getPrivateLinkResourceByResourceIdWithServiceResponseAsync(String resourceGroupName, String resourceName, String resourceId) { + if (this.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (resourceName == null) { + throw new IllegalArgumentException("Parameter resourceName is required and cannot be null."); + } + if (resourceId == null) { + throw new IllegalArgumentException("Parameter resourceId is required and cannot be null."); + } + return service.getPrivateLinkResourceByResourceId(this.subscriptionId(), resourceGroupName, resourceName, resourceId, this.apiVersion(), this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getPrivateLinkResourceByResourceIdDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getPrivateLinkResourceByResourceIdDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * List private endpoint connection properties. + * + * @param resourceGroupName The name of the resource group that contains the DigitalTwinsInstance. + * @param resourceName The name of the DigitalTwinsInstance. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the List<PrivateEndpointConnectionInner> object if successful. + */ + public List getPrivateEndpointConnections(String resourceGroupName, String resourceName) { + return getPrivateEndpointConnectionsWithServiceResponseAsync(resourceGroupName, resourceName).toBlocking().single().body(); + } + + /** + * List private endpoint connection properties. + * + * @param resourceGroupName The name of the resource group that contains the DigitalTwinsInstance. + * @param resourceName The name of the DigitalTwinsInstance. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> getPrivateEndpointConnectionsAsync(String resourceGroupName, String resourceName, final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(getPrivateEndpointConnectionsWithServiceResponseAsync(resourceGroupName, resourceName), serviceCallback); + } + + /** + * List private endpoint connection properties. + * + * @param resourceGroupName The name of the resource group that contains the DigitalTwinsInstance. + * @param resourceName The name of the DigitalTwinsInstance. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<PrivateEndpointConnectionInner> object + */ + public Observable> getPrivateEndpointConnectionsAsync(String resourceGroupName, String resourceName) { + return getPrivateEndpointConnectionsWithServiceResponseAsync(resourceGroupName, resourceName).map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List private endpoint connection properties. + * + * @param resourceGroupName The name of the resource group that contains the DigitalTwinsInstance. + * @param resourceName The name of the DigitalTwinsInstance. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<PrivateEndpointConnectionInner> object + */ + public Observable>> getPrivateEndpointConnectionsWithServiceResponseAsync(String resourceGroupName, String resourceName) { + if (this.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (resourceName == null) { + throw new IllegalArgumentException("Parameter resourceName is required and cannot be null."); + } + return service.getPrivateEndpointConnections(this.subscriptionId(), resourceGroupName, resourceName, this.apiVersion(), this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> clientResponse = getPrivateEndpointConnectionsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> getPrivateEndpointConnectionsDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Get private endpoint connection properties for the given private endpoint. + * + * @param resourceGroupName The name of the resource group that contains the DigitalTwinsInstance. + * @param resourceName The name of the DigitalTwinsInstance. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PrivateEndpointConnectionInner object if successful. + */ + public PrivateEndpointConnectionInner getPrivateEndpointConnectionByName(String resourceGroupName, String resourceName, String privateEndpointConnectionName) { + return getPrivateEndpointConnectionByNameWithServiceResponseAsync(resourceGroupName, resourceName, privateEndpointConnectionName).toBlocking().single().body(); + } + + /** + * Get private endpoint connection properties for the given private endpoint. + * + * @param resourceGroupName The name of the resource group that contains the DigitalTwinsInstance. + * @param resourceName The name of the DigitalTwinsInstance. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getPrivateEndpointConnectionByNameAsync(String resourceGroupName, String resourceName, String privateEndpointConnectionName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getPrivateEndpointConnectionByNameWithServiceResponseAsync(resourceGroupName, resourceName, privateEndpointConnectionName), serviceCallback); + } + + /** + * Get private endpoint connection properties for the given private endpoint. + * + * @param resourceGroupName The name of the resource group that contains the DigitalTwinsInstance. + * @param resourceName The name of the DigitalTwinsInstance. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PrivateEndpointConnectionInner object + */ + public Observable getPrivateEndpointConnectionByNameAsync(String resourceGroupName, String resourceName, String privateEndpointConnectionName) { + return getPrivateEndpointConnectionByNameWithServiceResponseAsync(resourceGroupName, resourceName, privateEndpointConnectionName).map(new Func1, PrivateEndpointConnectionInner>() { + @Override + public PrivateEndpointConnectionInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get private endpoint connection properties for the given private endpoint. + * + * @param resourceGroupName The name of the resource group that contains the DigitalTwinsInstance. + * @param resourceName The name of the DigitalTwinsInstance. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PrivateEndpointConnectionInner object + */ + public Observable> getPrivateEndpointConnectionByNameWithServiceResponseAsync(String resourceGroupName, String resourceName, String privateEndpointConnectionName) { + if (this.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (resourceName == null) { + throw new IllegalArgumentException("Parameter resourceName is required and cannot be null."); + } + if (privateEndpointConnectionName == null) { + throw new IllegalArgumentException("Parameter privateEndpointConnectionName is required and cannot be null."); + } + return service.getPrivateEndpointConnectionByName(this.subscriptionId(), resourceGroupName, resourceName, privateEndpointConnectionName, this.apiVersion(), this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getPrivateEndpointConnectionByNameDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getPrivateEndpointConnectionByNameDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Delete private endpoint connection with the specified name. + * + * @param resourceGroupName The name of the resource group that contains the DigitalTwinsInstance. + * @param resourceName The name of the DigitalTwinsInstance. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void deletePrivateEndpointConnection(String resourceGroupName, String resourceName, String privateEndpointConnectionName) { + deletePrivateEndpointConnectionWithServiceResponseAsync(resourceGroupName, resourceName, privateEndpointConnectionName).toBlocking().last().body(); + } + + /** + * Delete private endpoint connection with the specified name. + * + * @param resourceGroupName The name of the resource group that contains the DigitalTwinsInstance. + * @param resourceName The name of the DigitalTwinsInstance. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deletePrivateEndpointConnectionAsync(String resourceGroupName, String resourceName, String privateEndpointConnectionName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deletePrivateEndpointConnectionWithServiceResponseAsync(resourceGroupName, resourceName, privateEndpointConnectionName), serviceCallback); + } + + /** + * Delete private endpoint connection with the specified name. + * + * @param resourceGroupName The name of the resource group that contains the DigitalTwinsInstance. + * @param resourceName The name of the DigitalTwinsInstance. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deletePrivateEndpointConnectionAsync(String resourceGroupName, String resourceName, String privateEndpointConnectionName) { + return deletePrivateEndpointConnectionWithServiceResponseAsync(resourceGroupName, resourceName, privateEndpointConnectionName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Delete private endpoint connection with the specified name. + * + * @param resourceGroupName The name of the resource group that contains the DigitalTwinsInstance. + * @param resourceName The name of the DigitalTwinsInstance. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deletePrivateEndpointConnectionWithServiceResponseAsync(String resourceGroupName, String resourceName, String privateEndpointConnectionName) { + if (this.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (resourceName == null) { + throw new IllegalArgumentException("Parameter resourceName is required and cannot be null."); + } + if (privateEndpointConnectionName == null) { + throw new IllegalArgumentException("Parameter privateEndpointConnectionName is required and cannot be null."); + } + Observable> observable = service.deletePrivateEndpointConnection(this.subscriptionId(), resourceGroupName, resourceName, privateEndpointConnectionName, this.apiVersion(), this.acceptLanguage(), this.userAgent()); + return getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Delete private endpoint connection with the specified name. + * + * @param resourceGroupName The name of the resource group that contains the DigitalTwinsInstance. + * @param resourceName The name of the DigitalTwinsInstance. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDeletePrivateEndpointConnection(String resourceGroupName, String resourceName, String privateEndpointConnectionName) { + beginDeletePrivateEndpointConnectionWithServiceResponseAsync(resourceGroupName, resourceName, privateEndpointConnectionName).toBlocking().single().body(); + } + + /** + * Delete private endpoint connection with the specified name. + * + * @param resourceGroupName The name of the resource group that contains the DigitalTwinsInstance. + * @param resourceName The name of the DigitalTwinsInstance. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeletePrivateEndpointConnectionAsync(String resourceGroupName, String resourceName, String privateEndpointConnectionName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeletePrivateEndpointConnectionWithServiceResponseAsync(resourceGroupName, resourceName, privateEndpointConnectionName), serviceCallback); + } + + /** + * Delete private endpoint connection with the specified name. + * + * @param resourceGroupName The name of the resource group that contains the DigitalTwinsInstance. + * @param resourceName The name of the DigitalTwinsInstance. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeletePrivateEndpointConnectionAsync(String resourceGroupName, String resourceName, String privateEndpointConnectionName) { + return beginDeletePrivateEndpointConnectionWithServiceResponseAsync(resourceGroupName, resourceName, privateEndpointConnectionName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Delete private endpoint connection with the specified name. + * + * @param resourceGroupName The name of the resource group that contains the DigitalTwinsInstance. + * @param resourceName The name of the DigitalTwinsInstance. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeletePrivateEndpointConnectionWithServiceResponseAsync(String resourceGroupName, String resourceName, String privateEndpointConnectionName) { + if (this.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (resourceName == null) { + throw new IllegalArgumentException("Parameter resourceName is required and cannot be null."); + } + if (privateEndpointConnectionName == null) { + throw new IllegalArgumentException("Parameter privateEndpointConnectionName is required and cannot be null."); + } + return service.beginDeletePrivateEndpointConnection(this.subscriptionId(), resourceGroupName, resourceName, privateEndpointConnectionName, this.apiVersion(), this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeletePrivateEndpointConnectionDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeletePrivateEndpointConnectionDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Update the status of a private endpoint connection with the given name. + * + * @param resourceGroupName The name of the resource group that contains the DigitalTwinsInstance. + * @param resourceName The name of the DigitalTwinsInstance. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param properties the PrivateEndpointConnectionProperties value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PrivateEndpointConnectionInner object if successful. + */ + public PrivateEndpointConnectionInner putPrivateEndpointConnection(String resourceGroupName, String resourceName, String privateEndpointConnectionName, PrivateEndpointConnectionProperties properties) { + return putPrivateEndpointConnectionWithServiceResponseAsync(resourceGroupName, resourceName, privateEndpointConnectionName, properties).toBlocking().last().body(); + } + + /** + * Update the status of a private endpoint connection with the given name. + * + * @param resourceGroupName The name of the resource group that contains the DigitalTwinsInstance. + * @param resourceName The name of the DigitalTwinsInstance. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param properties the PrivateEndpointConnectionProperties value + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture putPrivateEndpointConnectionAsync(String resourceGroupName, String resourceName, String privateEndpointConnectionName, PrivateEndpointConnectionProperties properties, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(putPrivateEndpointConnectionWithServiceResponseAsync(resourceGroupName, resourceName, privateEndpointConnectionName, properties), serviceCallback); + } + + /** + * Update the status of a private endpoint connection with the given name. + * + * @param resourceGroupName The name of the resource group that contains the DigitalTwinsInstance. + * @param resourceName The name of the DigitalTwinsInstance. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param properties the PrivateEndpointConnectionProperties value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable putPrivateEndpointConnectionAsync(String resourceGroupName, String resourceName, String privateEndpointConnectionName, PrivateEndpointConnectionProperties properties) { + return putPrivateEndpointConnectionWithServiceResponseAsync(resourceGroupName, resourceName, privateEndpointConnectionName, properties).map(new Func1, PrivateEndpointConnectionInner>() { + @Override + public PrivateEndpointConnectionInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Update the status of a private endpoint connection with the given name. + * + * @param resourceGroupName The name of the resource group that contains the DigitalTwinsInstance. + * @param resourceName The name of the DigitalTwinsInstance. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param properties the PrivateEndpointConnectionProperties value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> putPrivateEndpointConnectionWithServiceResponseAsync(String resourceGroupName, String resourceName, String privateEndpointConnectionName, PrivateEndpointConnectionProperties properties) { + if (this.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (resourceName == null) { + throw new IllegalArgumentException("Parameter resourceName is required and cannot be null."); + } + if (privateEndpointConnectionName == null) { + throw new IllegalArgumentException("Parameter privateEndpointConnectionName is required and cannot be null."); + } + if (properties == null) { + throw new IllegalArgumentException("Parameter properties is required and cannot be null."); + } + Validator.validate(properties); + PrivateEndpointConnectionInner privateEndpointConnection = new PrivateEndpointConnectionInner(); + privateEndpointConnection.withProperties(properties); + Observable> observable = service.putPrivateEndpointConnection(this.subscriptionId(), resourceGroupName, resourceName, privateEndpointConnectionName, this.apiVersion(), this.acceptLanguage(), privateEndpointConnection, this.userAgent()); + return getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Update the status of a private endpoint connection with the given name. + * + * @param resourceGroupName The name of the resource group that contains the DigitalTwinsInstance. + * @param resourceName The name of the DigitalTwinsInstance. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param properties the PrivateEndpointConnectionProperties value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PrivateEndpointConnectionInner object if successful. + */ + public PrivateEndpointConnectionInner beginPutPrivateEndpointConnection(String resourceGroupName, String resourceName, String privateEndpointConnectionName, PrivateEndpointConnectionProperties properties) { + return beginPutPrivateEndpointConnectionWithServiceResponseAsync(resourceGroupName, resourceName, privateEndpointConnectionName, properties).toBlocking().single().body(); + } + + /** + * Update the status of a private endpoint connection with the given name. + * + * @param resourceGroupName The name of the resource group that contains the DigitalTwinsInstance. + * @param resourceName The name of the DigitalTwinsInstance. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param properties the PrivateEndpointConnectionProperties value + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginPutPrivateEndpointConnectionAsync(String resourceGroupName, String resourceName, String privateEndpointConnectionName, PrivateEndpointConnectionProperties properties, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginPutPrivateEndpointConnectionWithServiceResponseAsync(resourceGroupName, resourceName, privateEndpointConnectionName, properties), serviceCallback); + } + + /** + * Update the status of a private endpoint connection with the given name. + * + * @param resourceGroupName The name of the resource group that contains the DigitalTwinsInstance. + * @param resourceName The name of the DigitalTwinsInstance. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param properties the PrivateEndpointConnectionProperties value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PrivateEndpointConnectionInner object + */ + public Observable beginPutPrivateEndpointConnectionAsync(String resourceGroupName, String resourceName, String privateEndpointConnectionName, PrivateEndpointConnectionProperties properties) { + return beginPutPrivateEndpointConnectionWithServiceResponseAsync(resourceGroupName, resourceName, privateEndpointConnectionName, properties).map(new Func1, PrivateEndpointConnectionInner>() { + @Override + public PrivateEndpointConnectionInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Update the status of a private endpoint connection with the given name. + * + * @param resourceGroupName The name of the resource group that contains the DigitalTwinsInstance. + * @param resourceName The name of the DigitalTwinsInstance. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param properties the PrivateEndpointConnectionProperties value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PrivateEndpointConnectionInner object + */ + public Observable> beginPutPrivateEndpointConnectionWithServiceResponseAsync(String resourceGroupName, String resourceName, String privateEndpointConnectionName, PrivateEndpointConnectionProperties properties) { + if (this.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (resourceName == null) { + throw new IllegalArgumentException("Parameter resourceName is required and cannot be null."); + } + if (privateEndpointConnectionName == null) { + throw new IllegalArgumentException("Parameter privateEndpointConnectionName is required and cannot be null."); + } + if (properties == null) { + throw new IllegalArgumentException("Parameter properties is required and cannot be null."); + } + Validator.validate(properties); + PrivateEndpointConnectionInner privateEndpointConnection = new PrivateEndpointConnectionInner(); + privateEndpointConnection.withProperties(properties); + return service.beginPutPrivateEndpointConnection(this.subscriptionId(), resourceGroupName, resourceName, privateEndpointConnectionName, this.apiVersion(), this.acceptLanguage(), privateEndpointConnection, this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginPutPrivateEndpointConnectionDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginPutPrivateEndpointConnectionDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + +} diff --git a/sdk/digitaltwins/mgmt-v2020_12_01/src/main/java/com/microsoft/azure/management/digitaltwins/v2020_12_01/implementation/CheckNameResultImpl.java b/sdk/digitaltwins/mgmt-v2020_12_01/src/main/java/com/microsoft/azure/management/digitaltwins/v2020_12_01/implementation/CheckNameResultImpl.java new file mode 100644 index 0000000000000..3a34db73d3d08 --- /dev/null +++ b/sdk/digitaltwins/mgmt-v2020_12_01/src/main/java/com/microsoft/azure/management/digitaltwins/v2020_12_01/implementation/CheckNameResultImpl.java @@ -0,0 +1,42 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.digitaltwins.v2020_12_01.implementation; + +import com.microsoft.azure.management.digitaltwins.v2020_12_01.CheckNameResult; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.digitaltwins.v2020_12_01.Reason; + +class CheckNameResultImpl extends WrapperImpl implements CheckNameResult { + private final DigitalTwinsManager manager; + CheckNameResultImpl(CheckNameResultInner inner, DigitalTwinsManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public DigitalTwinsManager manager() { + return this.manager; + } + + @Override + public String message() { + return this.inner().message(); + } + + @Override + public Boolean nameAvailable() { + return this.inner().nameAvailable(); + } + + @Override + public Reason reason() { + return this.inner().reason(); + } + +} diff --git a/sdk/digitaltwins/mgmt-v2020_12_01/src/main/java/com/microsoft/azure/management/digitaltwins/v2020_12_01/implementation/CheckNameResultInner.java b/sdk/digitaltwins/mgmt-v2020_12_01/src/main/java/com/microsoft/azure/management/digitaltwins/v2020_12_01/implementation/CheckNameResultInner.java new file mode 100644 index 0000000000000..277ef42117c8d --- /dev/null +++ b/sdk/digitaltwins/mgmt-v2020_12_01/src/main/java/com/microsoft/azure/management/digitaltwins/v2020_12_01/implementation/CheckNameResultInner.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.digitaltwins.v2020_12_01.implementation; + +import com.microsoft.azure.management.digitaltwins.v2020_12_01.Reason; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The result returned from a check name availability request. + */ +public class CheckNameResultInner { + /** + * Specifies a Boolean value that indicates if the name is available. + */ + @JsonProperty(value = "nameAvailable") + private Boolean nameAvailable; + + /** + * Message indicating an unavailable name due to a conflict, or a + * description of the naming rules that are violated. + */ + @JsonProperty(value = "message") + private String message; + + /** + * Message providing the reason why the given name is invalid. Possible + * values include: 'Invalid', 'AlreadyExists'. + */ + @JsonProperty(value = "reason") + private Reason reason; + + /** + * Get specifies a Boolean value that indicates if the name is available. + * + * @return the nameAvailable value + */ + public Boolean nameAvailable() { + return this.nameAvailable; + } + + /** + * Set specifies a Boolean value that indicates if the name is available. + * + * @param nameAvailable the nameAvailable value to set + * @return the CheckNameResultInner object itself. + */ + public CheckNameResultInner withNameAvailable(Boolean nameAvailable) { + this.nameAvailable = nameAvailable; + return this; + } + + /** + * Get message indicating an unavailable name due to a conflict, or a description of the naming rules that are violated. + * + * @return the message value + */ + public String message() { + return this.message; + } + + /** + * Set message indicating an unavailable name due to a conflict, or a description of the naming rules that are violated. + * + * @param message the message value to set + * @return the CheckNameResultInner object itself. + */ + public CheckNameResultInner withMessage(String message) { + this.message = message; + return this; + } + + /** + * Get message providing the reason why the given name is invalid. Possible values include: 'Invalid', 'AlreadyExists'. + * + * @return the reason value + */ + public Reason reason() { + return this.reason; + } + + /** + * Set message providing the reason why the given name is invalid. Possible values include: 'Invalid', 'AlreadyExists'. + * + * @param reason the reason value to set + * @return the CheckNameResultInner object itself. + */ + public CheckNameResultInner withReason(Reason reason) { + this.reason = reason; + return this; + } + +} diff --git a/sdk/digitaltwins/mgmt-v2020_12_01/src/main/java/com/microsoft/azure/management/digitaltwins/v2020_12_01/implementation/DigitalTwinsDescriptionImpl.java b/sdk/digitaltwins/mgmt-v2020_12_01/src/main/java/com/microsoft/azure/management/digitaltwins/v2020_12_01/implementation/DigitalTwinsDescriptionImpl.java new file mode 100644 index 0000000000000..583ed9626d275 --- /dev/null +++ b/sdk/digitaltwins/mgmt-v2020_12_01/src/main/java/com/microsoft/azure/management/digitaltwins/v2020_12_01/implementation/DigitalTwinsDescriptionImpl.java @@ -0,0 +1,118 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.digitaltwins.v2020_12_01.implementation; + +import com.microsoft.azure.arm.resources.models.implementation.GroupableResourceCoreImpl; +import com.microsoft.azure.management.digitaltwins.v2020_12_01.DigitalTwinsDescription; +import rx.Observable; +import com.microsoft.azure.management.digitaltwins.v2020_12_01.DigitalTwinsPatchDescription; +import com.microsoft.azure.management.digitaltwins.v2020_12_01.DigitalTwinsIdentity; +import org.joda.time.DateTime; +import com.microsoft.azure.management.digitaltwins.v2020_12_01.ProvisioningState; +import java.util.List; +import java.util.ArrayList; +import rx.functions.Func1; + +class DigitalTwinsDescriptionImpl extends GroupableResourceCoreImpl implements DigitalTwinsDescription, DigitalTwinsDescription.Definition, DigitalTwinsDescription.Update { + private DigitalTwinsPatchDescription updateParameter; + DigitalTwinsDescriptionImpl(String name, DigitalTwinsDescriptionInner inner, DigitalTwinsManager manager) { + super(name, inner, manager); + this.updateParameter = new DigitalTwinsPatchDescription(); + } + + @Override + public Observable createResourceAsync() { + DigitalTwinsInner client = this.manager().inner().digitalTwins(); + return client.createOrUpdateAsync(this.resourceGroupName(), this.name(), this.inner()) + .map(new Func1() { + @Override + public DigitalTwinsDescriptionInner call(DigitalTwinsDescriptionInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + DigitalTwinsInner client = this.manager().inner().digitalTwins(); + return client.updateAsync(this.resourceGroupName(), this.name(), this.updateParameter) + .map(new Func1() { + @Override + public DigitalTwinsDescriptionInner call(DigitalTwinsDescriptionInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + DigitalTwinsInner client = this.manager().inner().digitalTwins(); + return client.getByResourceGroupAsync(this.resourceGroupName(), this.name()); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + private void resetCreateUpdateParameters() { + this.updateParameter = new DigitalTwinsPatchDescription(); + } + + @Override + public DateTime createdTime() { + return this.inner().createdTime(); + } + + @Override + public String hostName() { + return this.inner().hostName(); + } + + @Override + public DigitalTwinsIdentity identity() { + return this.inner().identity(); + } + + @Override + public DateTime lastUpdatedTime() { + return this.inner().lastUpdatedTime(); + } + + @Override + public List privateEndpointConnections() { + return this.inner().privateEndpointConnections(); + } + + @Override + public ProvisioningState provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public DigitalTwinsDescriptionImpl withPrivateEndpointConnections(List privateEndpointConnections) { + this.inner().withPrivateEndpointConnections(privateEndpointConnections); + return this; + } + + @Override + public DigitalTwinsDescriptionImpl withIdentity(DigitalTwinsIdentity identity) { + if (isInCreateMode()) { + this.inner().withIdentity(identity); + } else { + this.updateParameter.withIdentity(identity); + } + return this; + } + +} diff --git a/sdk/digitaltwins/mgmt-v2020_12_01/src/main/java/com/microsoft/azure/management/digitaltwins/v2020_12_01/implementation/DigitalTwinsDescriptionInner.java b/sdk/digitaltwins/mgmt-v2020_12_01/src/main/java/com/microsoft/azure/management/digitaltwins/v2020_12_01/implementation/DigitalTwinsDescriptionInner.java new file mode 100644 index 0000000000000..af951536c7447 --- /dev/null +++ b/sdk/digitaltwins/mgmt-v2020_12_01/src/main/java/com/microsoft/azure/management/digitaltwins/v2020_12_01/implementation/DigitalTwinsDescriptionInner.java @@ -0,0 +1,111 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.digitaltwins.v2020_12_01.implementation; + +import org.joda.time.DateTime; +import com.microsoft.azure.management.digitaltwins.v2020_12_01.ProvisioningState; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.management.digitaltwins.v2020_12_01.DigitalTwinsResource; + +/** + * The description of the DigitalTwins service. + */ +@JsonFlatten +public class DigitalTwinsDescriptionInner extends DigitalTwinsResource { + /** + * Time when DigitalTwinsInstance was created. + */ + @JsonProperty(value = "properties.createdTime", access = JsonProperty.Access.WRITE_ONLY) + private DateTime createdTime; + + /** + * Time when DigitalTwinsInstance was updated. + */ + @JsonProperty(value = "properties.lastUpdatedTime", access = JsonProperty.Access.WRITE_ONLY) + private DateTime lastUpdatedTime; + + /** + * The provisioning state. Possible values include: 'Provisioning', + * 'Deleting', 'Updating', 'Succeeded', 'Failed', 'Canceled', 'Deleted', + * 'Warning', 'Suspending', 'Restoring', 'Moving'. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /** + * Api endpoint to work with DigitalTwinsInstance. + */ + @JsonProperty(value = "properties.hostName", access = JsonProperty.Access.WRITE_ONLY) + private String hostName; + + /** + * The privateEndpointConnections property. + */ + @JsonProperty(value = "properties.privateEndpointConnections") + private List privateEndpointConnections; + + /** + * Get time when DigitalTwinsInstance was created. + * + * @return the createdTime value + */ + public DateTime createdTime() { + return this.createdTime; + } + + /** + * Get time when DigitalTwinsInstance was updated. + * + * @return the lastUpdatedTime value + */ + public DateTime lastUpdatedTime() { + return this.lastUpdatedTime; + } + + /** + * Get the provisioning state. Possible values include: 'Provisioning', 'Deleting', 'Updating', 'Succeeded', 'Failed', 'Canceled', 'Deleted', 'Warning', 'Suspending', 'Restoring', 'Moving'. + * + * @return the provisioningState value + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get api endpoint to work with DigitalTwinsInstance. + * + * @return the hostName value + */ + public String hostName() { + return this.hostName; + } + + /** + * Get the privateEndpointConnections value. + * + * @return the privateEndpointConnections value + */ + public List privateEndpointConnections() { + return this.privateEndpointConnections; + } + + /** + * Set the privateEndpointConnections value. + * + * @param privateEndpointConnections the privateEndpointConnections value to set + * @return the DigitalTwinsDescriptionInner object itself. + */ + public DigitalTwinsDescriptionInner withPrivateEndpointConnections(List privateEndpointConnections) { + this.privateEndpointConnections = privateEndpointConnections; + return this; + } + +} diff --git a/sdk/digitaltwins/mgmt-v2020_12_01/src/main/java/com/microsoft/azure/management/digitaltwins/v2020_12_01/implementation/DigitalTwinsEndpointResourceImpl.java b/sdk/digitaltwins/mgmt-v2020_12_01/src/main/java/com/microsoft/azure/management/digitaltwins/v2020_12_01/implementation/DigitalTwinsEndpointResourceImpl.java new file mode 100644 index 0000000000000..2f208328fb161 --- /dev/null +++ b/sdk/digitaltwins/mgmt-v2020_12_01/src/main/java/com/microsoft/azure/management/digitaltwins/v2020_12_01/implementation/DigitalTwinsEndpointResourceImpl.java @@ -0,0 +1,136 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.digitaltwins.v2020_12_01.implementation; + +import com.microsoft.azure.management.digitaltwins.v2020_12_01.DigitalTwinsEndpointResource; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import com.microsoft.azure.management.digitaltwins.v2020_12_01.DigitalTwinsEndpointResourceProperties; +import org.joda.time.DateTime; +import rx.functions.Func1; + +class DigitalTwinsEndpointResourceImpl extends CreatableUpdatableImpl implements DigitalTwinsEndpointResource, DigitalTwinsEndpointResource.Definition, DigitalTwinsEndpointResource.Update { + private final DigitalTwinsManager manager; + private String resourceGroupName; + private String resourceName; + private String endpointName; + private DigitalTwinsEndpointResourceProperties cproperties; + private DigitalTwinsEndpointResourceProperties uproperties; + + DigitalTwinsEndpointResourceImpl(String name, DigitalTwinsManager manager) { + super(name, new DigitalTwinsEndpointResourceInner()); + this.manager = manager; + // Set resource name + this.endpointName = name; + // + this.cproperties = new DigitalTwinsEndpointResourceProperties(); + this.uproperties = new DigitalTwinsEndpointResourceProperties(); + } + + DigitalTwinsEndpointResourceImpl(DigitalTwinsEndpointResourceInner inner, DigitalTwinsManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.endpointName = inner.name(); + // set resource ancestor and positional variables + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.resourceName = IdParsingUtils.getValueFromIdByName(inner.id(), "digitalTwinsInstances"); + this.endpointName = IdParsingUtils.getValueFromIdByName(inner.id(), "endpoints"); + // + this.cproperties = new DigitalTwinsEndpointResourceProperties(); + this.uproperties = new DigitalTwinsEndpointResourceProperties(); + } + + @Override + public DigitalTwinsManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + DigitalTwinsEndpointsInner client = this.manager().inner().digitalTwinsEndpoints(); + return client.createOrUpdateAsync(this.resourceGroupName, this.resourceName, this.endpointName, this.cproperties) + .map(new Func1() { + @Override + public DigitalTwinsEndpointResourceInner call(DigitalTwinsEndpointResourceInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + DigitalTwinsEndpointsInner client = this.manager().inner().digitalTwinsEndpoints(); + return client.createOrUpdateAsync(this.resourceGroupName, this.resourceName, this.endpointName, this.uproperties) + .map(new Func1() { + @Override + public DigitalTwinsEndpointResourceInner call(DigitalTwinsEndpointResourceInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + DigitalTwinsEndpointsInner client = this.manager().inner().digitalTwinsEndpoints(); + return client.getAsync(this.resourceGroupName, this.resourceName, this.endpointName); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + private void resetCreateUpdateParameters() { + this.cproperties = new DigitalTwinsEndpointResourceProperties(); + this.uproperties = new DigitalTwinsEndpointResourceProperties(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public DigitalTwinsEndpointResourceProperties properties() { + return this.inner().properties(); + } + + @Override + public String type() { + return this.inner().type(); + } + + @Override + public DigitalTwinsEndpointResourceImpl withExistingDigitalTwinsInstance(String resourceGroupName, String resourceName) { + this.resourceGroupName = resourceGroupName; + this.resourceName = resourceName; + return this; + } + + @Override + public DigitalTwinsEndpointResourceImpl withProperties(DigitalTwinsEndpointResourceProperties properties) { + if (isInCreateMode()) { + this.cproperties = properties; + } else { + this.uproperties = properties; + } + return this; + } + +} diff --git a/sdk/digitaltwins/mgmt-v2020_12_01/src/main/java/com/microsoft/azure/management/digitaltwins/v2020_12_01/implementation/DigitalTwinsEndpointResourceInner.java b/sdk/digitaltwins/mgmt-v2020_12_01/src/main/java/com/microsoft/azure/management/digitaltwins/v2020_12_01/implementation/DigitalTwinsEndpointResourceInner.java new file mode 100644 index 0000000000000..5ce37dac77aa6 --- /dev/null +++ b/sdk/digitaltwins/mgmt-v2020_12_01/src/main/java/com/microsoft/azure/management/digitaltwins/v2020_12_01/implementation/DigitalTwinsEndpointResourceInner.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.digitaltwins.v2020_12_01.implementation; + +import com.microsoft.azure.management.digitaltwins.v2020_12_01.DigitalTwinsEndpointResourceProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.azure.management.digitaltwins.v2020_12_01.ExternalResource; + +/** + * DigitalTwinsInstance endpoint resource. + */ +public class DigitalTwinsEndpointResourceInner extends ExternalResource { + /** + * DigitalTwinsInstance endpoint resource properties. + */ + @JsonProperty(value = "properties") + private DigitalTwinsEndpointResourceProperties properties; + + /** + * Get digitalTwinsInstance endpoint resource properties. + * + * @return the properties value + */ + public DigitalTwinsEndpointResourceProperties properties() { + return this.properties; + } + + /** + * Set digitalTwinsInstance endpoint resource properties. + * + * @param properties the properties value to set + * @return the DigitalTwinsEndpointResourceInner object itself. + */ + public DigitalTwinsEndpointResourceInner withProperties(DigitalTwinsEndpointResourceProperties properties) { + this.properties = properties; + return this; + } + +} diff --git a/sdk/digitaltwins/mgmt-v2020_12_01/src/main/java/com/microsoft/azure/management/digitaltwins/v2020_12_01/implementation/DigitalTwinsEndpointsImpl.java b/sdk/digitaltwins/mgmt-v2020_12_01/src/main/java/com/microsoft/azure/management/digitaltwins/v2020_12_01/implementation/DigitalTwinsEndpointsImpl.java new file mode 100644 index 0000000000000..3d5871ed9a3d6 --- /dev/null +++ b/sdk/digitaltwins/mgmt-v2020_12_01/src/main/java/com/microsoft/azure/management/digitaltwins/v2020_12_01/implementation/DigitalTwinsEndpointsImpl.java @@ -0,0 +1,85 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * + */ + +package com.microsoft.azure.management.digitaltwins.v2020_12_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.digitaltwins.v2020_12_01.DigitalTwinsEndpoints; +import rx.Completable; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.digitaltwins.v2020_12_01.DigitalTwinsEndpointResource; + +class DigitalTwinsEndpointsImpl extends WrapperImpl implements DigitalTwinsEndpoints { + private final DigitalTwinsManager manager; + + DigitalTwinsEndpointsImpl(DigitalTwinsManager manager) { + super(manager.inner().digitalTwinsEndpoints()); + this.manager = manager; + } + + public DigitalTwinsManager manager() { + return this.manager; + } + + @Override + public DigitalTwinsEndpointResourceImpl define(String name) { + return wrapModel(name); + } + + private DigitalTwinsEndpointResourceImpl wrapModel(DigitalTwinsEndpointResourceInner inner) { + return new DigitalTwinsEndpointResourceImpl(inner, manager()); + } + + private DigitalTwinsEndpointResourceImpl wrapModel(String name) { + return new DigitalTwinsEndpointResourceImpl(name, this.manager()); + } + + @Override + public Observable listAsync(final String resourceGroupName, final String resourceName) { + DigitalTwinsEndpointsInner client = this.inner(); + return client.listAsync(resourceGroupName, resourceName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public DigitalTwinsEndpointResource call(DigitalTwinsEndpointResourceInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Observable getAsync(String resourceGroupName, String resourceName, String endpointName) { + DigitalTwinsEndpointsInner client = this.inner(); + return client.getAsync(resourceGroupName, resourceName, endpointName) + .flatMap(new Func1>() { + @Override + public Observable call(DigitalTwinsEndpointResourceInner inner) { + if (inner == null) { + return Observable.empty(); + } else { + return Observable.just((DigitalTwinsEndpointResource)wrapModel(inner)); + } + } + }); + } + + @Override + public Completable deleteAsync(String resourceGroupName, String resourceName, String endpointName) { + DigitalTwinsEndpointsInner client = this.inner(); + return client.deleteAsync(resourceGroupName, resourceName, endpointName).toCompletable(); + } + +} diff --git a/sdk/digitaltwins/mgmt-v2020_12_01/src/main/java/com/microsoft/azure/management/digitaltwins/v2020_12_01/implementation/DigitalTwinsEndpointsInner.java b/sdk/digitaltwins/mgmt-v2020_12_01/src/main/java/com/microsoft/azure/management/digitaltwins/v2020_12_01/implementation/DigitalTwinsEndpointsInner.java new file mode 100644 index 0000000000000..49cc0334b6916 --- /dev/null +++ b/sdk/digitaltwins/mgmt-v2020_12_01/src/main/java/com/microsoft/azure/management/digitaltwins/v2020_12_01/implementation/DigitalTwinsEndpointsInner.java @@ -0,0 +1,920 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.digitaltwins.v2020_12_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.digitaltwins.v2020_12_01.DigitalTwinsEndpointResourceProperties; +import com.microsoft.azure.management.digitaltwins.v2020_12_01.ErrorResponseException; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.Path; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in DigitalTwinsEndpoints. + */ +public class DigitalTwinsEndpointsInner { + /** The Retrofit service to perform REST calls. */ + private DigitalTwinsEndpointsService service; + /** The service client containing this operation class. */ + private AzureDigitalTwinsManagementClientImpl client; + + /** + * Initializes an instance of DigitalTwinsEndpointsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public DigitalTwinsEndpointsInner(Retrofit retrofit, AzureDigitalTwinsManagementClientImpl client) { + this.service = retrofit.create(DigitalTwinsEndpointsService.class); + this.client = client; + } + + /** + * The interface defining all the services for DigitalTwinsEndpoints to be + * used by Retrofit to perform actually REST calls. + */ + interface DigitalTwinsEndpointsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.digitaltwins.v2020_12_01.DigitalTwinsEndpoints list" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DigitalTwins/digitalTwinsInstances/{resourceName}/endpoints") + Observable> list(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("resourceName") String resourceName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.digitaltwins.v2020_12_01.DigitalTwinsEndpoints get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DigitalTwins/digitalTwinsInstances/{resourceName}/endpoints/{endpointName}") + Observable> get(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("resourceName") String resourceName, @Path("endpointName") String endpointName, @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.digitaltwins.v2020_12_01.DigitalTwinsEndpoints createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DigitalTwins/digitalTwinsInstances/{resourceName}/endpoints/{endpointName}") + Observable> createOrUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("resourceName") String resourceName, @Path("endpointName") String endpointName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body DigitalTwinsEndpointResourceInner endpointDescription, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.digitaltwins.v2020_12_01.DigitalTwinsEndpoints beginCreateOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DigitalTwins/digitalTwinsInstances/{resourceName}/endpoints/{endpointName}") + Observable> beginCreateOrUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("resourceName") String resourceName, @Path("endpointName") String endpointName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body DigitalTwinsEndpointResourceInner endpointDescription, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.digitaltwins.v2020_12_01.DigitalTwinsEndpoints delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DigitalTwins/digitalTwinsInstances/{resourceName}/endpoints/{endpointName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("resourceName") String resourceName, @Path("endpointName") String endpointName, @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.digitaltwins.v2020_12_01.DigitalTwinsEndpoints beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DigitalTwins/digitalTwinsInstances/{resourceName}/endpoints/{endpointName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("resourceName") String resourceName, @Path("endpointName") String endpointName, @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.digitaltwins.v2020_12_01.DigitalTwinsEndpoints listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Get DigitalTwinsInstance Endpoints. + * + * @param resourceGroupName The name of the resource group that contains the DigitalTwinsInstance. + * @param resourceName The name of the DigitalTwinsInstance. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<DigitalTwinsEndpointResourceInner> object if successful. + */ + public PagedList list(final String resourceGroupName, final String resourceName) { + ServiceResponse> response = listSinglePageAsync(resourceGroupName, resourceName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Get DigitalTwinsInstance Endpoints. + * + * @param resourceGroupName The name of the resource group that contains the DigitalTwinsInstance. + * @param resourceName The name of the DigitalTwinsInstance. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final String resourceGroupName, final String resourceName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(resourceGroupName, resourceName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Get DigitalTwinsInstance Endpoints. + * + * @param resourceGroupName The name of the resource group that contains the DigitalTwinsInstance. + * @param resourceName The name of the DigitalTwinsInstance. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DigitalTwinsEndpointResourceInner> object + */ + public Observable> listAsync(final String resourceGroupName, final String resourceName) { + return listWithServiceResponseAsync(resourceGroupName, resourceName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Get DigitalTwinsInstance Endpoints. + * + * @param resourceGroupName The name of the resource group that contains the DigitalTwinsInstance. + * @param resourceName The name of the DigitalTwinsInstance. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DigitalTwinsEndpointResourceInner> object + */ + public Observable>> listWithServiceResponseAsync(final String resourceGroupName, final String resourceName) { + return listSinglePageAsync(resourceGroupName, resourceName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Get DigitalTwinsInstance Endpoints. + * + ServiceResponse> * @param resourceGroupName The name of the resource group that contains the DigitalTwinsInstance. + ServiceResponse> * @param resourceName The name of the DigitalTwinsInstance. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<DigitalTwinsEndpointResourceInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync(final String resourceGroupName, final String resourceName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (resourceName == null) { + throw new IllegalArgumentException("Parameter resourceName is required and cannot be null."); + } + return service.list(this.client.subscriptionId(), resourceGroupName, resourceName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Get DigitalTwinsInstances Endpoint. + * + * @param resourceGroupName The name of the resource group that contains the DigitalTwinsInstance. + * @param resourceName The name of the DigitalTwinsInstance. + * @param endpointName Name of Endpoint Resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the DigitalTwinsEndpointResourceInner object if successful. + */ + public DigitalTwinsEndpointResourceInner get(String resourceGroupName, String resourceName, String endpointName) { + return getWithServiceResponseAsync(resourceGroupName, resourceName, endpointName).toBlocking().single().body(); + } + + /** + * Get DigitalTwinsInstances Endpoint. + * + * @param resourceGroupName The name of the resource group that contains the DigitalTwinsInstance. + * @param resourceName The name of the DigitalTwinsInstance. + * @param endpointName Name of Endpoint Resource. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String resourceGroupName, String resourceName, String endpointName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, resourceName, endpointName), serviceCallback); + } + + /** + * Get DigitalTwinsInstances Endpoint. + * + * @param resourceGroupName The name of the resource group that contains the DigitalTwinsInstance. + * @param resourceName The name of the DigitalTwinsInstance. + * @param endpointName Name of Endpoint Resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DigitalTwinsEndpointResourceInner object + */ + public Observable getAsync(String resourceGroupName, String resourceName, String endpointName) { + return getWithServiceResponseAsync(resourceGroupName, resourceName, endpointName).map(new Func1, DigitalTwinsEndpointResourceInner>() { + @Override + public DigitalTwinsEndpointResourceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get DigitalTwinsInstances Endpoint. + * + * @param resourceGroupName The name of the resource group that contains the DigitalTwinsInstance. + * @param resourceName The name of the DigitalTwinsInstance. + * @param endpointName Name of Endpoint Resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DigitalTwinsEndpointResourceInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String resourceName, String endpointName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (resourceName == null) { + throw new IllegalArgumentException("Parameter resourceName is required and cannot be null."); + } + if (endpointName == null) { + throw new IllegalArgumentException("Parameter endpointName is required and cannot be null."); + } + return service.get(this.client.subscriptionId(), resourceGroupName, resourceName, endpointName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Create or update DigitalTwinsInstance endpoint. + * + * @param resourceGroupName The name of the resource group that contains the DigitalTwinsInstance. + * @param resourceName The name of the DigitalTwinsInstance. + * @param endpointName Name of Endpoint Resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the DigitalTwinsEndpointResourceInner object if successful. + */ + public DigitalTwinsEndpointResourceInner createOrUpdate(String resourceGroupName, String resourceName, String endpointName) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, resourceName, endpointName).toBlocking().last().body(); + } + + /** + * Create or update DigitalTwinsInstance endpoint. + * + * @param resourceGroupName The name of the resource group that contains the DigitalTwinsInstance. + * @param resourceName The name of the DigitalTwinsInstance. + * @param endpointName Name of Endpoint Resource. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String resourceGroupName, String resourceName, String endpointName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, resourceName, endpointName), serviceCallback); + } + + /** + * Create or update DigitalTwinsInstance endpoint. + * + * @param resourceGroupName The name of the resource group that contains the DigitalTwinsInstance. + * @param resourceName The name of the DigitalTwinsInstance. + * @param endpointName Name of Endpoint Resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createOrUpdateAsync(String resourceGroupName, String resourceName, String endpointName) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, resourceName, endpointName).map(new Func1, DigitalTwinsEndpointResourceInner>() { + @Override + public DigitalTwinsEndpointResourceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create or update DigitalTwinsInstance endpoint. + * + * @param resourceGroupName The name of the resource group that contains the DigitalTwinsInstance. + * @param resourceName The name of the DigitalTwinsInstance. + * @param endpointName Name of Endpoint Resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String resourceName, String endpointName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (resourceName == null) { + throw new IllegalArgumentException("Parameter resourceName is required and cannot be null."); + } + if (endpointName == null) { + throw new IllegalArgumentException("Parameter endpointName is required and cannot be null."); + } + final DigitalTwinsEndpointResourceProperties properties = null; + DigitalTwinsEndpointResourceInner endpointDescription = new DigitalTwinsEndpointResourceInner(); + endpointDescription.withProperties(null); + Observable> observable = service.createOrUpdate(this.client.subscriptionId(), resourceGroupName, resourceName, endpointName, this.client.apiVersion(), this.client.acceptLanguage(), endpointDescription, this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + /** + * Create or update DigitalTwinsInstance endpoint. + * + * @param resourceGroupName The name of the resource group that contains the DigitalTwinsInstance. + * @param resourceName The name of the DigitalTwinsInstance. + * @param endpointName Name of Endpoint Resource. + * @param properties DigitalTwinsInstance endpoint resource properties. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the DigitalTwinsEndpointResourceInner object if successful. + */ + public DigitalTwinsEndpointResourceInner createOrUpdate(String resourceGroupName, String resourceName, String endpointName, DigitalTwinsEndpointResourceProperties properties) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, resourceName, endpointName, properties).toBlocking().last().body(); + } + + /** + * Create or update DigitalTwinsInstance endpoint. + * + * @param resourceGroupName The name of the resource group that contains the DigitalTwinsInstance. + * @param resourceName The name of the DigitalTwinsInstance. + * @param endpointName Name of Endpoint Resource. + * @param properties DigitalTwinsInstance endpoint resource properties. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String resourceGroupName, String resourceName, String endpointName, DigitalTwinsEndpointResourceProperties properties, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, resourceName, endpointName, properties), serviceCallback); + } + + /** + * Create or update DigitalTwinsInstance endpoint. + * + * @param resourceGroupName The name of the resource group that contains the DigitalTwinsInstance. + * @param resourceName The name of the DigitalTwinsInstance. + * @param endpointName Name of Endpoint Resource. + * @param properties DigitalTwinsInstance endpoint resource properties. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createOrUpdateAsync(String resourceGroupName, String resourceName, String endpointName, DigitalTwinsEndpointResourceProperties properties) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, resourceName, endpointName, properties).map(new Func1, DigitalTwinsEndpointResourceInner>() { + @Override + public DigitalTwinsEndpointResourceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create or update DigitalTwinsInstance endpoint. + * + * @param resourceGroupName The name of the resource group that contains the DigitalTwinsInstance. + * @param resourceName The name of the DigitalTwinsInstance. + * @param endpointName Name of Endpoint Resource. + * @param properties DigitalTwinsInstance endpoint resource properties. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String resourceName, String endpointName, DigitalTwinsEndpointResourceProperties properties) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (resourceName == null) { + throw new IllegalArgumentException("Parameter resourceName is required and cannot be null."); + } + if (endpointName == null) { + throw new IllegalArgumentException("Parameter endpointName is required and cannot be null."); + } + Validator.validate(properties); + DigitalTwinsEndpointResourceInner endpointDescription = new DigitalTwinsEndpointResourceInner(); + endpointDescription.withProperties(properties); + Observable> observable = service.createOrUpdate(this.client.subscriptionId(), resourceGroupName, resourceName, endpointName, this.client.apiVersion(), this.client.acceptLanguage(), endpointDescription, this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Create or update DigitalTwinsInstance endpoint. + * + * @param resourceGroupName The name of the resource group that contains the DigitalTwinsInstance. + * @param resourceName The name of the DigitalTwinsInstance. + * @param endpointName Name of Endpoint Resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the DigitalTwinsEndpointResourceInner object if successful. + */ + public DigitalTwinsEndpointResourceInner beginCreateOrUpdate(String resourceGroupName, String resourceName, String endpointName) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, resourceName, endpointName).toBlocking().single().body(); + } + + /** + * Create or update DigitalTwinsInstance endpoint. + * + * @param resourceGroupName The name of the resource group that contains the DigitalTwinsInstance. + * @param resourceName The name of the DigitalTwinsInstance. + * @param endpointName Name of Endpoint Resource. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginCreateOrUpdateAsync(String resourceGroupName, String resourceName, String endpointName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, resourceName, endpointName), serviceCallback); + } + + /** + * Create or update DigitalTwinsInstance endpoint. + * + * @param resourceGroupName The name of the resource group that contains the DigitalTwinsInstance. + * @param resourceName The name of the DigitalTwinsInstance. + * @param endpointName Name of Endpoint Resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DigitalTwinsEndpointResourceInner object + */ + public Observable beginCreateOrUpdateAsync(String resourceGroupName, String resourceName, String endpointName) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, resourceName, endpointName).map(new Func1, DigitalTwinsEndpointResourceInner>() { + @Override + public DigitalTwinsEndpointResourceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create or update DigitalTwinsInstance endpoint. + * + * @param resourceGroupName The name of the resource group that contains the DigitalTwinsInstance. + * @param resourceName The name of the DigitalTwinsInstance. + * @param endpointName Name of Endpoint Resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DigitalTwinsEndpointResourceInner object + */ + public Observable> beginCreateOrUpdateWithServiceResponseAsync(String resourceGroupName, String resourceName, String endpointName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (resourceName == null) { + throw new IllegalArgumentException("Parameter resourceName is required and cannot be null."); + } + if (endpointName == null) { + throw new IllegalArgumentException("Parameter endpointName is required and cannot be null."); + } + final DigitalTwinsEndpointResourceProperties properties = null; + DigitalTwinsEndpointResourceInner endpointDescription = new DigitalTwinsEndpointResourceInner(); + endpointDescription.withProperties(null); + return service.beginCreateOrUpdate(this.client.subscriptionId(), resourceGroupName, resourceName, endpointName, this.client.apiVersion(), this.client.acceptLanguage(), endpointDescription, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Create or update DigitalTwinsInstance endpoint. + * + * @param resourceGroupName The name of the resource group that contains the DigitalTwinsInstance. + * @param resourceName The name of the DigitalTwinsInstance. + * @param endpointName Name of Endpoint Resource. + * @param properties DigitalTwinsInstance endpoint resource properties. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the DigitalTwinsEndpointResourceInner object if successful. + */ + public DigitalTwinsEndpointResourceInner beginCreateOrUpdate(String resourceGroupName, String resourceName, String endpointName, DigitalTwinsEndpointResourceProperties properties) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, resourceName, endpointName, properties).toBlocking().single().body(); + } + + /** + * Create or update DigitalTwinsInstance endpoint. + * + * @param resourceGroupName The name of the resource group that contains the DigitalTwinsInstance. + * @param resourceName The name of the DigitalTwinsInstance. + * @param endpointName Name of Endpoint Resource. + * @param properties DigitalTwinsInstance endpoint resource properties. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginCreateOrUpdateAsync(String resourceGroupName, String resourceName, String endpointName, DigitalTwinsEndpointResourceProperties properties, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, resourceName, endpointName, properties), serviceCallback); + } + + /** + * Create or update DigitalTwinsInstance endpoint. + * + * @param resourceGroupName The name of the resource group that contains the DigitalTwinsInstance. + * @param resourceName The name of the DigitalTwinsInstance. + * @param endpointName Name of Endpoint Resource. + * @param properties DigitalTwinsInstance endpoint resource properties. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DigitalTwinsEndpointResourceInner object + */ + public Observable beginCreateOrUpdateAsync(String resourceGroupName, String resourceName, String endpointName, DigitalTwinsEndpointResourceProperties properties) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, resourceName, endpointName, properties).map(new Func1, DigitalTwinsEndpointResourceInner>() { + @Override + public DigitalTwinsEndpointResourceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create or update DigitalTwinsInstance endpoint. + * + * @param resourceGroupName The name of the resource group that contains the DigitalTwinsInstance. + * @param resourceName The name of the DigitalTwinsInstance. + * @param endpointName Name of Endpoint Resource. + * @param properties DigitalTwinsInstance endpoint resource properties. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DigitalTwinsEndpointResourceInner object + */ + public Observable> beginCreateOrUpdateWithServiceResponseAsync(String resourceGroupName, String resourceName, String endpointName, DigitalTwinsEndpointResourceProperties properties) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (resourceName == null) { + throw new IllegalArgumentException("Parameter resourceName is required and cannot be null."); + } + if (endpointName == null) { + throw new IllegalArgumentException("Parameter endpointName is required and cannot be null."); + } + Validator.validate(properties); + DigitalTwinsEndpointResourceInner endpointDescription = new DigitalTwinsEndpointResourceInner(); + endpointDescription.withProperties(properties); + return service.beginCreateOrUpdate(this.client.subscriptionId(), resourceGroupName, resourceName, endpointName, this.client.apiVersion(), this.client.acceptLanguage(), endpointDescription, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateOrUpdateDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Delete a DigitalTwinsInstance endpoint. + * + * @param resourceGroupName The name of the resource group that contains the DigitalTwinsInstance. + * @param resourceName The name of the DigitalTwinsInstance. + * @param endpointName Name of Endpoint Resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the DigitalTwinsEndpointResourceInner object if successful. + */ + public DigitalTwinsEndpointResourceInner delete(String resourceGroupName, String resourceName, String endpointName) { + return deleteWithServiceResponseAsync(resourceGroupName, resourceName, endpointName).toBlocking().last().body(); + } + + /** + * Delete a DigitalTwinsInstance endpoint. + * + * @param resourceGroupName The name of the resource group that contains the DigitalTwinsInstance. + * @param resourceName The name of the DigitalTwinsInstance. + * @param endpointName Name of Endpoint Resource. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String resourceName, String endpointName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, resourceName, endpointName), serviceCallback); + } + + /** + * Delete a DigitalTwinsInstance endpoint. + * + * @param resourceGroupName The name of the resource group that contains the DigitalTwinsInstance. + * @param resourceName The name of the DigitalTwinsInstance. + * @param endpointName Name of Endpoint Resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String resourceName, String endpointName) { + return deleteWithServiceResponseAsync(resourceGroupName, resourceName, endpointName).map(new Func1, DigitalTwinsEndpointResourceInner>() { + @Override + public DigitalTwinsEndpointResourceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Delete a DigitalTwinsInstance endpoint. + * + * @param resourceGroupName The name of the resource group that contains the DigitalTwinsInstance. + * @param resourceName The name of the DigitalTwinsInstance. + * @param endpointName Name of Endpoint Resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String resourceName, String endpointName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (resourceName == null) { + throw new IllegalArgumentException("Parameter resourceName is required and cannot be null."); + } + if (endpointName == null) { + throw new IllegalArgumentException("Parameter endpointName is required and cannot be null."); + } + Observable> observable = service.delete(this.client.subscriptionId(), resourceGroupName, resourceName, endpointName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Delete a DigitalTwinsInstance endpoint. + * + * @param resourceGroupName The name of the resource group that contains the DigitalTwinsInstance. + * @param resourceName The name of the DigitalTwinsInstance. + * @param endpointName Name of Endpoint Resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the DigitalTwinsEndpointResourceInner object if successful. + */ + public DigitalTwinsEndpointResourceInner beginDelete(String resourceGroupName, String resourceName, String endpointName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, resourceName, endpointName).toBlocking().single().body(); + } + + /** + * Delete a DigitalTwinsInstance endpoint. + * + * @param resourceGroupName The name of the resource group that contains the DigitalTwinsInstance. + * @param resourceName The name of the DigitalTwinsInstance. + * @param endpointName Name of Endpoint Resource. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteAsync(String resourceGroupName, String resourceName, String endpointName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, resourceName, endpointName), serviceCallback); + } + + /** + * Delete a DigitalTwinsInstance endpoint. + * + * @param resourceGroupName The name of the resource group that contains the DigitalTwinsInstance. + * @param resourceName The name of the DigitalTwinsInstance. + * @param endpointName Name of Endpoint Resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DigitalTwinsEndpointResourceInner object + */ + public Observable beginDeleteAsync(String resourceGroupName, String resourceName, String endpointName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, resourceName, endpointName).map(new Func1, DigitalTwinsEndpointResourceInner>() { + @Override + public DigitalTwinsEndpointResourceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Delete a DigitalTwinsInstance endpoint. + * + * @param resourceGroupName The name of the resource group that contains the DigitalTwinsInstance. + * @param resourceName The name of the DigitalTwinsInstance. + * @param endpointName Name of Endpoint Resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DigitalTwinsEndpointResourceInner object + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String resourceName, String endpointName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (resourceName == null) { + throw new IllegalArgumentException("Parameter resourceName is required and cannot be null."); + } + if (endpointName == null) { + throw new IllegalArgumentException("Parameter endpointName is required and cannot be null."); + } + return service.beginDelete(this.client.subscriptionId(), resourceGroupName, resourceName, endpointName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Get DigitalTwinsInstance Endpoints. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<DigitalTwinsEndpointResourceInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Get DigitalTwinsInstance Endpoints. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Get DigitalTwinsInstance Endpoints. + * + * @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<DigitalTwinsEndpointResourceInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Get DigitalTwinsInstance Endpoints. + * + * @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<DigitalTwinsEndpointResourceInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Get DigitalTwinsInstance Endpoints. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<DigitalTwinsEndpointResourceInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + +} diff --git a/sdk/digitaltwins/mgmt-v2020_12_01/src/main/java/com/microsoft/azure/management/digitaltwins/v2020_12_01/implementation/DigitalTwinsImpl.java b/sdk/digitaltwins/mgmt-v2020_12_01/src/main/java/com/microsoft/azure/management/digitaltwins/v2020_12_01/implementation/DigitalTwinsImpl.java new file mode 100644 index 0000000000000..c438167179139 --- /dev/null +++ b/sdk/digitaltwins/mgmt-v2020_12_01/src/main/java/com/microsoft/azure/management/digitaltwins/v2020_12_01/implementation/DigitalTwinsImpl.java @@ -0,0 +1,118 @@ +/** + * Copyright (c) Microsoft Corporation. All rights 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.digitaltwins.v2020_12_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.digitaltwins.v2020_12_01.DigitalTwins; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.management.digitaltwins.v2020_12_01.DigitalTwinsDescription; +import com.microsoft.azure.Page; +import rx.Completable; +import com.microsoft.azure.management.digitaltwins.v2020_12_01.CheckNameResult; + +class DigitalTwinsImpl extends WrapperImpl implements DigitalTwins { + private final DigitalTwinsManager manager; + + DigitalTwinsImpl(DigitalTwinsManager manager) { + super(manager.inner().digitalTwins()); + this.manager = manager; + } + + public DigitalTwinsManager manager() { + return this.manager; + } + + @Override + public DigitalTwinsDescriptionImpl defineDigitalTwinsInstance(String name) { + return wrapDigitalTwinsInstanceModel(name); + } + + private DigitalTwinsDescriptionImpl wrapDigitalTwinsInstanceModel(String name) { + return new DigitalTwinsDescriptionImpl(name, new DigitalTwinsDescriptionInner(), this.manager()); + } + + private DigitalTwinsDescriptionImpl wrapDigitalTwinsDescriptionModel(DigitalTwinsDescriptionInner inner) { + return new DigitalTwinsDescriptionImpl(inner.name(), inner, manager()); + } + + private Observable getDigitalTwinsDescriptionInnerUsingDigitalTwinsInnerAsync(String resourceGroupName, String name) { + DigitalTwinsInner client = this.inner(); + return client.getByResourceGroupAsync(resourceGroupName, name); + } + + @Override + public Observable getByResourceGroupAsync(String resourceGroupName, String name) { + return this.getDigitalTwinsDescriptionInnerUsingDigitalTwinsInnerAsync(resourceGroupName, name).flatMap(new Func1> () { + @Override + public Observable call(DigitalTwinsDescriptionInner inner) { + if (inner == null) { + return Observable.empty(); + } else { + return Observable.just((DigitalTwinsDescription)wrapDigitalTwinsDescriptionModel(inner)); + } + } + }); + } + + @Override + public Observable listByResourceGroupAsync(String resourceGroupName) { + DigitalTwinsInner 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 DigitalTwinsDescription call(DigitalTwinsDescriptionInner inner) { + return wrapDigitalTwinsDescriptionModel(inner); + } + }); + } + + @Override + public Observable listAsync() { + DigitalTwinsInner client = this.inner(); + return client.listAsync() + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public DigitalTwinsDescription call(DigitalTwinsDescriptionInner inner) { + return wrapDigitalTwinsDescriptionModel(inner); + } + }); + } + + @Override + public Completable deleteAsync(String resourceGroupName, String name) { + return this.inner().deleteAsync(resourceGroupName, name).toCompletable(); + } + + @Override + public Observable checkNameAvailabilityAsync(String location, String name) { + DigitalTwinsInner client = this.inner(); + return client.checkNameAvailabilityAsync(location, name) + .map(new Func1() { + @Override + public CheckNameResult call(CheckNameResultInner inner) { + return new CheckNameResultImpl(inner, manager()); + } + }); + } + +} diff --git a/sdk/digitaltwins/mgmt-v2020_12_01/src/main/java/com/microsoft/azure/management/digitaltwins/v2020_12_01/implementation/DigitalTwinsInner.java b/sdk/digitaltwins/mgmt-v2020_12_01/src/main/java/com/microsoft/azure/management/digitaltwins/v2020_12_01/implementation/DigitalTwinsInner.java new file mode 100644 index 0000000000000..b902a5dedf1b8 --- /dev/null +++ b/sdk/digitaltwins/mgmt-v2020_12_01/src/main/java/com/microsoft/azure/management/digitaltwins/v2020_12_01/implementation/DigitalTwinsInner.java @@ -0,0 +1,1210 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.digitaltwins.v2020_12_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.ListOperationCallback; +import com.microsoft.azure.management.digitaltwins.v2020_12_01.CheckNameRequest; +import com.microsoft.azure.management.digitaltwins.v2020_12_01.DigitalTwinsPatchDescription; +import com.microsoft.azure.management.digitaltwins.v2020_12_01.ErrorResponseException; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.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 DigitalTwins. + */ +public class DigitalTwinsInner implements InnerSupportsGet, InnerSupportsDelete, InnerSupportsListing { + /** The Retrofit service to perform REST calls. */ + private DigitalTwinsService service; + /** The service client containing this operation class. */ + private AzureDigitalTwinsManagementClientImpl client; + + /** + * Initializes an instance of DigitalTwinsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public DigitalTwinsInner(Retrofit retrofit, AzureDigitalTwinsManagementClientImpl client) { + this.service = retrofit.create(DigitalTwinsService.class); + this.client = client; + } + + /** + * The interface defining all the services for DigitalTwins to be + * used by Retrofit to perform actually REST calls. + */ + interface DigitalTwinsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.digitaltwins.v2020_12_01.DigitalTwins getByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DigitalTwins/digitalTwinsInstances/{resourceName}") + Observable> getByResourceGroup(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("resourceName") String resourceName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.digitaltwins.v2020_12_01.DigitalTwins createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DigitalTwins/digitalTwinsInstances/{resourceName}") + Observable> createOrUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("resourceName") String resourceName, @Query("api-version") String apiVersion, @Body DigitalTwinsDescriptionInner digitalTwinsCreate, @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.digitaltwins.v2020_12_01.DigitalTwins beginCreateOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DigitalTwins/digitalTwinsInstances/{resourceName}") + Observable> beginCreateOrUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("resourceName") String resourceName, @Query("api-version") String apiVersion, @Body DigitalTwinsDescriptionInner digitalTwinsCreate, @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.digitaltwins.v2020_12_01.DigitalTwins update" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DigitalTwins/digitalTwinsInstances/{resourceName}") + Observable> update(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("resourceName") String resourceName, @Query("api-version") String apiVersion, @Body DigitalTwinsPatchDescription digitalTwinsPatchDescription, @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.digitaltwins.v2020_12_01.DigitalTwins beginUpdate" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DigitalTwins/digitalTwinsInstances/{resourceName}") + Observable> beginUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("resourceName") String resourceName, @Query("api-version") String apiVersion, @Body DigitalTwinsPatchDescription digitalTwinsPatchDescription, @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.digitaltwins.v2020_12_01.DigitalTwins delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DigitalTwins/digitalTwinsInstances/{resourceName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("resourceName") String resourceName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.digitaltwins.v2020_12_01.DigitalTwins beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DigitalTwins/digitalTwinsInstances/{resourceName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("resourceName") String resourceName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.digitaltwins.v2020_12_01.DigitalTwins list" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.DigitalTwins/digitalTwinsInstances") + 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.digitaltwins.v2020_12_01.DigitalTwins listByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DigitalTwins/digitalTwinsInstances") + 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.digitaltwins.v2020_12_01.DigitalTwins checkNameAvailability" }) + @POST("subscriptions/{subscriptionId}/providers/Microsoft.DigitalTwins/locations/{location}/checkNameAvailability") + Observable> checkNameAvailability(@Path("subscriptionId") String subscriptionId, @Path("location") String location, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body CheckNameRequest digitalTwinsInstanceCheckName, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.digitaltwins.v2020_12_01.DigitalTwins 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.digitaltwins.v2020_12_01.DigitalTwins listByResourceGroupNext" }) + @GET + Observable> listByResourceGroupNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Get DigitalTwinsInstances resource. + * + * @param resourceGroupName The name of the resource group that contains the DigitalTwinsInstance. + * @param resourceName The name of the DigitalTwinsInstance. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the DigitalTwinsDescriptionInner object if successful. + */ + public DigitalTwinsDescriptionInner getByResourceGroup(String resourceGroupName, String resourceName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, resourceName).toBlocking().single().body(); + } + + /** + * Get DigitalTwinsInstances resource. + * + * @param resourceGroupName The name of the resource group that contains the DigitalTwinsInstance. + * @param resourceName The name of the DigitalTwinsInstance. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getByResourceGroupAsync(String resourceGroupName, String resourceName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getByResourceGroupWithServiceResponseAsync(resourceGroupName, resourceName), serviceCallback); + } + + /** + * Get DigitalTwinsInstances resource. + * + * @param resourceGroupName The name of the resource group that contains the DigitalTwinsInstance. + * @param resourceName The name of the DigitalTwinsInstance. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DigitalTwinsDescriptionInner object + */ + public Observable getByResourceGroupAsync(String resourceGroupName, String resourceName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, resourceName).map(new Func1, DigitalTwinsDescriptionInner>() { + @Override + public DigitalTwinsDescriptionInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get DigitalTwinsInstances resource. + * + * @param resourceGroupName The name of the resource group that contains the DigitalTwinsInstance. + * @param resourceName The name of the DigitalTwinsInstance. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DigitalTwinsDescriptionInner object + */ + public Observable> getByResourceGroupWithServiceResponseAsync(String resourceGroupName, String resourceName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (resourceName == null) { + throw new IllegalArgumentException("Parameter resourceName is required and cannot be null."); + } + return service.getByResourceGroup(this.client.subscriptionId(), resourceGroupName, resourceName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getByResourceGroupDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getByResourceGroupDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Create or update the metadata of a DigitalTwinsInstance. The usual pattern to modify a property is to retrieve the DigitalTwinsInstance and security metadata, and then combine them with the modified values in a new body to update the DigitalTwinsInstance. + * + * @param resourceGroupName The name of the resource group that contains the DigitalTwinsInstance. + * @param resourceName The name of the DigitalTwinsInstance. + * @param digitalTwinsCreate The DigitalTwinsInstance and security metadata. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the DigitalTwinsDescriptionInner object if successful. + */ + public DigitalTwinsDescriptionInner createOrUpdate(String resourceGroupName, String resourceName, DigitalTwinsDescriptionInner digitalTwinsCreate) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, resourceName, digitalTwinsCreate).toBlocking().last().body(); + } + + /** + * Create or update the metadata of a DigitalTwinsInstance. The usual pattern to modify a property is to retrieve the DigitalTwinsInstance and security metadata, and then combine them with the modified values in a new body to update the DigitalTwinsInstance. + * + * @param resourceGroupName The name of the resource group that contains the DigitalTwinsInstance. + * @param resourceName The name of the DigitalTwinsInstance. + * @param digitalTwinsCreate The DigitalTwinsInstance and security metadata. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String resourceGroupName, String resourceName, DigitalTwinsDescriptionInner digitalTwinsCreate, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, resourceName, digitalTwinsCreate), serviceCallback); + } + + /** + * Create or update the metadata of a DigitalTwinsInstance. The usual pattern to modify a property is to retrieve the DigitalTwinsInstance and security metadata, and then combine them with the modified values in a new body to update the DigitalTwinsInstance. + * + * @param resourceGroupName The name of the resource group that contains the DigitalTwinsInstance. + * @param resourceName The name of the DigitalTwinsInstance. + * @param digitalTwinsCreate The DigitalTwinsInstance and security metadata. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createOrUpdateAsync(String resourceGroupName, String resourceName, DigitalTwinsDescriptionInner digitalTwinsCreate) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, resourceName, digitalTwinsCreate).map(new Func1, DigitalTwinsDescriptionInner>() { + @Override + public DigitalTwinsDescriptionInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create or update the metadata of a DigitalTwinsInstance. The usual pattern to modify a property is to retrieve the DigitalTwinsInstance and security metadata, and then combine them with the modified values in a new body to update the DigitalTwinsInstance. + * + * @param resourceGroupName The name of the resource group that contains the DigitalTwinsInstance. + * @param resourceName The name of the DigitalTwinsInstance. + * @param digitalTwinsCreate The DigitalTwinsInstance and security metadata. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String resourceName, DigitalTwinsDescriptionInner digitalTwinsCreate) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (resourceName == null) { + throw new IllegalArgumentException("Parameter resourceName is required and cannot be null."); + } + if (digitalTwinsCreate == null) { + throw new IllegalArgumentException("Parameter digitalTwinsCreate is required and cannot be null."); + } + Validator.validate(digitalTwinsCreate); + Observable> observable = service.createOrUpdate(this.client.subscriptionId(), resourceGroupName, resourceName, this.client.apiVersion(), digitalTwinsCreate, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Create or update the metadata of a DigitalTwinsInstance. The usual pattern to modify a property is to retrieve the DigitalTwinsInstance and security metadata, and then combine them with the modified values in a new body to update the DigitalTwinsInstance. + * + * @param resourceGroupName The name of the resource group that contains the DigitalTwinsInstance. + * @param resourceName The name of the DigitalTwinsInstance. + * @param digitalTwinsCreate The DigitalTwinsInstance and security metadata. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the DigitalTwinsDescriptionInner object if successful. + */ + public DigitalTwinsDescriptionInner beginCreateOrUpdate(String resourceGroupName, String resourceName, DigitalTwinsDescriptionInner digitalTwinsCreate) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, resourceName, digitalTwinsCreate).toBlocking().single().body(); + } + + /** + * Create or update the metadata of a DigitalTwinsInstance. The usual pattern to modify a property is to retrieve the DigitalTwinsInstance and security metadata, and then combine them with the modified values in a new body to update the DigitalTwinsInstance. + * + * @param resourceGroupName The name of the resource group that contains the DigitalTwinsInstance. + * @param resourceName The name of the DigitalTwinsInstance. + * @param digitalTwinsCreate The DigitalTwinsInstance and security metadata. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginCreateOrUpdateAsync(String resourceGroupName, String resourceName, DigitalTwinsDescriptionInner digitalTwinsCreate, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, resourceName, digitalTwinsCreate), serviceCallback); + } + + /** + * Create or update the metadata of a DigitalTwinsInstance. The usual pattern to modify a property is to retrieve the DigitalTwinsInstance and security metadata, and then combine them with the modified values in a new body to update the DigitalTwinsInstance. + * + * @param resourceGroupName The name of the resource group that contains the DigitalTwinsInstance. + * @param resourceName The name of the DigitalTwinsInstance. + * @param digitalTwinsCreate The DigitalTwinsInstance and security metadata. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DigitalTwinsDescriptionInner object + */ + public Observable beginCreateOrUpdateAsync(String resourceGroupName, String resourceName, DigitalTwinsDescriptionInner digitalTwinsCreate) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, resourceName, digitalTwinsCreate).map(new Func1, DigitalTwinsDescriptionInner>() { + @Override + public DigitalTwinsDescriptionInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create or update the metadata of a DigitalTwinsInstance. The usual pattern to modify a property is to retrieve the DigitalTwinsInstance and security metadata, and then combine them with the modified values in a new body to update the DigitalTwinsInstance. + * + * @param resourceGroupName The name of the resource group that contains the DigitalTwinsInstance. + * @param resourceName The name of the DigitalTwinsInstance. + * @param digitalTwinsCreate The DigitalTwinsInstance and security metadata. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DigitalTwinsDescriptionInner object + */ + public Observable> beginCreateOrUpdateWithServiceResponseAsync(String resourceGroupName, String resourceName, DigitalTwinsDescriptionInner digitalTwinsCreate) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (resourceName == null) { + throw new IllegalArgumentException("Parameter resourceName is required and cannot be null."); + } + if (digitalTwinsCreate == null) { + throw new IllegalArgumentException("Parameter digitalTwinsCreate is required and cannot be null."); + } + Validator.validate(digitalTwinsCreate); + return service.beginCreateOrUpdate(this.client.subscriptionId(), resourceGroupName, resourceName, this.client.apiVersion(), digitalTwinsCreate, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateOrUpdateDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Update metadata of DigitalTwinsInstance. + * + * @param resourceGroupName The name of the resource group that contains the DigitalTwinsInstance. + * @param resourceName The name of the DigitalTwinsInstance. + * @param digitalTwinsPatchDescription The DigitalTwinsInstance and security metadata. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the DigitalTwinsDescriptionInner object if successful. + */ + public DigitalTwinsDescriptionInner update(String resourceGroupName, String resourceName, DigitalTwinsPatchDescription digitalTwinsPatchDescription) { + return updateWithServiceResponseAsync(resourceGroupName, resourceName, digitalTwinsPatchDescription).toBlocking().last().body(); + } + + /** + * Update metadata of DigitalTwinsInstance. + * + * @param resourceGroupName The name of the resource group that contains the DigitalTwinsInstance. + * @param resourceName The name of the DigitalTwinsInstance. + * @param digitalTwinsPatchDescription The DigitalTwinsInstance and security metadata. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateAsync(String resourceGroupName, String resourceName, DigitalTwinsPatchDescription digitalTwinsPatchDescription, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, resourceName, digitalTwinsPatchDescription), serviceCallback); + } + + /** + * Update metadata of DigitalTwinsInstance. + * + * @param resourceGroupName The name of the resource group that contains the DigitalTwinsInstance. + * @param resourceName The name of the DigitalTwinsInstance. + * @param digitalTwinsPatchDescription The DigitalTwinsInstance and security metadata. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable updateAsync(String resourceGroupName, String resourceName, DigitalTwinsPatchDescription digitalTwinsPatchDescription) { + return updateWithServiceResponseAsync(resourceGroupName, resourceName, digitalTwinsPatchDescription).map(new Func1, DigitalTwinsDescriptionInner>() { + @Override + public DigitalTwinsDescriptionInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Update metadata of DigitalTwinsInstance. + * + * @param resourceGroupName The name of the resource group that contains the DigitalTwinsInstance. + * @param resourceName The name of the DigitalTwinsInstance. + * @param digitalTwinsPatchDescription The DigitalTwinsInstance and security metadata. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> updateWithServiceResponseAsync(String resourceGroupName, String resourceName, DigitalTwinsPatchDescription digitalTwinsPatchDescription) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (resourceName == null) { + throw new IllegalArgumentException("Parameter resourceName is required and cannot be null."); + } + if (digitalTwinsPatchDescription == null) { + throw new IllegalArgumentException("Parameter digitalTwinsPatchDescription is required and cannot be null."); + } + Validator.validate(digitalTwinsPatchDescription); + Observable> observable = service.update(this.client.subscriptionId(), resourceGroupName, resourceName, this.client.apiVersion(), digitalTwinsPatchDescription, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Update metadata of DigitalTwinsInstance. + * + * @param resourceGroupName The name of the resource group that contains the DigitalTwinsInstance. + * @param resourceName The name of the DigitalTwinsInstance. + * @param digitalTwinsPatchDescription The DigitalTwinsInstance and security metadata. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the DigitalTwinsDescriptionInner object if successful. + */ + public DigitalTwinsDescriptionInner beginUpdate(String resourceGroupName, String resourceName, DigitalTwinsPatchDescription digitalTwinsPatchDescription) { + return beginUpdateWithServiceResponseAsync(resourceGroupName, resourceName, digitalTwinsPatchDescription).toBlocking().single().body(); + } + + /** + * Update metadata of DigitalTwinsInstance. + * + * @param resourceGroupName The name of the resource group that contains the DigitalTwinsInstance. + * @param resourceName The name of the DigitalTwinsInstance. + * @param digitalTwinsPatchDescription The DigitalTwinsInstance and security metadata. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginUpdateAsync(String resourceGroupName, String resourceName, DigitalTwinsPatchDescription digitalTwinsPatchDescription, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateWithServiceResponseAsync(resourceGroupName, resourceName, digitalTwinsPatchDescription), serviceCallback); + } + + /** + * Update metadata of DigitalTwinsInstance. + * + * @param resourceGroupName The name of the resource group that contains the DigitalTwinsInstance. + * @param resourceName The name of the DigitalTwinsInstance. + * @param digitalTwinsPatchDescription The DigitalTwinsInstance and security metadata. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DigitalTwinsDescriptionInner object + */ + public Observable beginUpdateAsync(String resourceGroupName, String resourceName, DigitalTwinsPatchDescription digitalTwinsPatchDescription) { + return beginUpdateWithServiceResponseAsync(resourceGroupName, resourceName, digitalTwinsPatchDescription).map(new Func1, DigitalTwinsDescriptionInner>() { + @Override + public DigitalTwinsDescriptionInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Update metadata of DigitalTwinsInstance. + * + * @param resourceGroupName The name of the resource group that contains the DigitalTwinsInstance. + * @param resourceName The name of the DigitalTwinsInstance. + * @param digitalTwinsPatchDescription The DigitalTwinsInstance and security metadata. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DigitalTwinsDescriptionInner object + */ + public Observable> beginUpdateWithServiceResponseAsync(String resourceGroupName, String resourceName, DigitalTwinsPatchDescription digitalTwinsPatchDescription) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (resourceName == null) { + throw new IllegalArgumentException("Parameter resourceName is required and cannot be null."); + } + if (digitalTwinsPatchDescription == null) { + throw new IllegalArgumentException("Parameter digitalTwinsPatchDescription is required and cannot be null."); + } + Validator.validate(digitalTwinsPatchDescription); + return service.beginUpdate(this.client.subscriptionId(), resourceGroupName, resourceName, this.client.apiVersion(), digitalTwinsPatchDescription, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginUpdateDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Delete a DigitalTwinsInstance. + * + * @param resourceGroupName The name of the resource group that contains the DigitalTwinsInstance. + * @param resourceName The name of the DigitalTwinsInstance. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the DigitalTwinsDescriptionInner object if successful. + */ + public DigitalTwinsDescriptionInner delete(String resourceGroupName, String resourceName) { + return deleteWithServiceResponseAsync(resourceGroupName, resourceName).toBlocking().last().body(); + } + + /** + * Delete a DigitalTwinsInstance. + * + * @param resourceGroupName The name of the resource group that contains the DigitalTwinsInstance. + * @param resourceName The name of the DigitalTwinsInstance. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String resourceName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, resourceName), serviceCallback); + } + + /** + * Delete a DigitalTwinsInstance. + * + * @param resourceGroupName The name of the resource group that contains the DigitalTwinsInstance. + * @param resourceName The name of the DigitalTwinsInstance. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String resourceName) { + return deleteWithServiceResponseAsync(resourceGroupName, resourceName).map(new Func1, DigitalTwinsDescriptionInner>() { + @Override + public DigitalTwinsDescriptionInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Delete a DigitalTwinsInstance. + * + * @param resourceGroupName The name of the resource group that contains the DigitalTwinsInstance. + * @param resourceName The name of the DigitalTwinsInstance. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String resourceName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (resourceName == null) { + throw new IllegalArgumentException("Parameter resourceName is required and cannot be null."); + } + Observable> observable = service.delete(this.client.subscriptionId(), resourceGroupName, resourceName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Delete a DigitalTwinsInstance. + * + * @param resourceGroupName The name of the resource group that contains the DigitalTwinsInstance. + * @param resourceName The name of the DigitalTwinsInstance. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the DigitalTwinsDescriptionInner object if successful. + */ + public DigitalTwinsDescriptionInner beginDelete(String resourceGroupName, String resourceName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, resourceName).toBlocking().single().body(); + } + + /** + * Delete a DigitalTwinsInstance. + * + * @param resourceGroupName The name of the resource group that contains the DigitalTwinsInstance. + * @param resourceName The name of the DigitalTwinsInstance. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteAsync(String resourceGroupName, String resourceName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, resourceName), serviceCallback); + } + + /** + * Delete a DigitalTwinsInstance. + * + * @param resourceGroupName The name of the resource group that contains the DigitalTwinsInstance. + * @param resourceName The name of the DigitalTwinsInstance. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DigitalTwinsDescriptionInner object + */ + public Observable beginDeleteAsync(String resourceGroupName, String resourceName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, resourceName).map(new Func1, DigitalTwinsDescriptionInner>() { + @Override + public DigitalTwinsDescriptionInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Delete a DigitalTwinsInstance. + * + * @param resourceGroupName The name of the resource group that contains the DigitalTwinsInstance. + * @param resourceName The name of the DigitalTwinsInstance. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DigitalTwinsDescriptionInner object + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String resourceName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (resourceName == null) { + throw new IllegalArgumentException("Parameter resourceName is required and cannot be null."); + } + return service.beginDelete(this.client.subscriptionId(), resourceGroupName, resourceName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Get all the DigitalTwinsInstances in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<DigitalTwinsDescriptionInner> object if successful. + */ + public PagedList list() { + ServiceResponse> response = listSinglePageAsync().toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Get all the DigitalTwinsInstances in a subscription. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Get all the DigitalTwinsInstances in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DigitalTwinsDescriptionInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Get all the DigitalTwinsInstances in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DigitalTwinsDescriptionInner> object + */ + public Observable>> listWithServiceResponseAsync() { + return listSinglePageAsync() + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Get all the DigitalTwinsInstances in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<DigitalTwinsDescriptionInner> 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."); + } + return service.list(this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Get all the DigitalTwinsInstances in a resource group. + * + * @param resourceGroupName The name of the resource group that contains the DigitalTwinsInstance. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<DigitalTwinsDescriptionInner> object if successful. + */ + public PagedList listByResourceGroup(final String resourceGroupName) { + ServiceResponse> response = listByResourceGroupSinglePageAsync(resourceGroupName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Get all the DigitalTwinsInstances in a resource group. + * + * @param resourceGroupName The name of the resource group that contains the DigitalTwinsInstance. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupAsync(final String resourceGroupName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupSinglePageAsync(resourceGroupName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Get all the DigitalTwinsInstances in a resource group. + * + * @param resourceGroupName The name of the resource group that contains the DigitalTwinsInstance. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DigitalTwinsDescriptionInner> object + */ + public Observable> listByResourceGroupAsync(final String resourceGroupName) { + return listByResourceGroupWithServiceResponseAsync(resourceGroupName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Get all the DigitalTwinsInstances in a resource group. + * + * @param resourceGroupName The name of the resource group that contains the DigitalTwinsInstance. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DigitalTwinsDescriptionInner> object + */ + public Observable>> listByResourceGroupWithServiceResponseAsync(final String resourceGroupName) { + return listByResourceGroupSinglePageAsync(resourceGroupName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Get all the DigitalTwinsInstances in a resource group. + * + ServiceResponse> * @param resourceGroupName The name of the resource group that contains the DigitalTwinsInstance. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<DigitalTwinsDescriptionInner> 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."); + } + return service.listByResourceGroup(this.client.subscriptionId(), resourceGroupName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Check if a DigitalTwinsInstance name is available. + * + * @param location Location of DigitalTwinsInstance. + * @param name Resource name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the CheckNameResultInner object if successful. + */ + public CheckNameResultInner checkNameAvailability(String location, String name) { + return checkNameAvailabilityWithServiceResponseAsync(location, name).toBlocking().single().body(); + } + + /** + * Check if a DigitalTwinsInstance name is available. + * + * @param location Location of DigitalTwinsInstance. + * @param name Resource name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture checkNameAvailabilityAsync(String location, String name, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(checkNameAvailabilityWithServiceResponseAsync(location, name), serviceCallback); + } + + /** + * Check if a DigitalTwinsInstance name is available. + * + * @param location Location of DigitalTwinsInstance. + * @param name Resource name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the CheckNameResultInner object + */ + public Observable checkNameAvailabilityAsync(String location, String name) { + return checkNameAvailabilityWithServiceResponseAsync(location, name).map(new Func1, CheckNameResultInner>() { + @Override + public CheckNameResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Check if a DigitalTwinsInstance name is available. + * + * @param location Location of DigitalTwinsInstance. + * @param name Resource name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the CheckNameResultInner object + */ + public Observable> checkNameAvailabilityWithServiceResponseAsync(String location, String name) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (location == null) { + throw new IllegalArgumentException("Parameter location is required and cannot be null."); + } + if (name == null) { + throw new IllegalArgumentException("Parameter name is required and cannot be null."); + } + CheckNameRequest digitalTwinsInstanceCheckName = new CheckNameRequest(); + digitalTwinsInstanceCheckName.withName(name); + return service.checkNameAvailability(this.client.subscriptionId(), location, this.client.apiVersion(), this.client.acceptLanguage(), digitalTwinsInstanceCheckName, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = checkNameAvailabilityDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse checkNameAvailabilityDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Get all the DigitalTwinsInstances in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<DigitalTwinsDescriptionInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Get all the DigitalTwinsInstances in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Get all the DigitalTwinsInstances in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DigitalTwinsDescriptionInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Get all the DigitalTwinsInstances in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DigitalTwinsDescriptionInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Get all the DigitalTwinsInstances in a subscription. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<DigitalTwinsDescriptionInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Get all the DigitalTwinsInstances in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<DigitalTwinsDescriptionInner> object if successful. + */ + public PagedList listByResourceGroupNext(final String nextPageLink) { + ServiceResponse> response = listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Get all the DigitalTwinsInstances in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Get all the DigitalTwinsInstances in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DigitalTwinsDescriptionInner> object + */ + public Observable> listByResourceGroupNextAsync(final String nextPageLink) { + return listByResourceGroupNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Get all the DigitalTwinsInstances in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DigitalTwinsDescriptionInner> object + */ + public Observable>> listByResourceGroupNextWithServiceResponseAsync(final String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Get all the DigitalTwinsInstances in a resource group. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<DigitalTwinsDescriptionInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listByResourceGroupNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupNextDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + +} diff --git a/sdk/digitaltwins/mgmt-v2020_12_01/src/main/java/com/microsoft/azure/management/digitaltwins/v2020_12_01/implementation/DigitalTwinsManager.java b/sdk/digitaltwins/mgmt-v2020_12_01/src/main/java/com/microsoft/azure/management/digitaltwins/v2020_12_01/implementation/DigitalTwinsManager.java new file mode 100644 index 0000000000000..0892b7db13e83 --- /dev/null +++ b/sdk/digitaltwins/mgmt-v2020_12_01/src/main/java/com/microsoft/azure/management/digitaltwins/v2020_12_01/implementation/DigitalTwinsManager.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.digitaltwins.v2020_12_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.digitaltwins.v2020_12_01.DigitalTwins; +import com.microsoft.azure.management.digitaltwins.v2020_12_01.DigitalTwinsEndpoints; +import com.microsoft.azure.management.digitaltwins.v2020_12_01.Operations; +import com.microsoft.azure.arm.resources.implementation.AzureConfigurableCoreImpl; +import com.microsoft.azure.arm.resources.implementation.ManagerCore; + +/** + * Entry point to Azure DigitalTwins resource management. + */ +public final class DigitalTwinsManager extends ManagerCore { + private DigitalTwins digitalTwins; + private DigitalTwinsEndpoints digitalTwinsEndpoints; + private Operations operations; + /** + * Get a Configurable instance that can be used to create DigitalTwinsManager with optional configuration. + * + * @return the instance allowing configurations + */ + public static Configurable configure() { + return new DigitalTwinsManager.ConfigurableImpl(); + } + /** + * Creates an instance of DigitalTwinsManager that exposes DigitalTwins resource management API entry points. + * + * @param credentials the credentials to use + * @param subscriptionId the subscription UUID + * @return the DigitalTwinsManager + */ + public static DigitalTwinsManager authenticate(AzureTokenCredentials credentials, String subscriptionId) { + return new DigitalTwinsManager(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 DigitalTwinsManager that exposes DigitalTwins resource management API entry points. + * + * @param restClient the RestClient to be used for API calls. + * @param subscriptionId the subscription UUID + * @return the DigitalTwinsManager + */ + public static DigitalTwinsManager authenticate(RestClient restClient, String subscriptionId) { + return new DigitalTwinsManager(restClient, subscriptionId); + } + /** + * The interface allowing configurations to be set. + */ + public interface Configurable extends AzureConfigurable { + /** + * Creates an instance of DigitalTwinsManager that exposes DigitalTwins management API entry points. + * + * @param credentials the credentials to use + * @param subscriptionId the subscription UUID + * @return the interface exposing DigitalTwins management API entry points that work across subscriptions + */ + DigitalTwinsManager authenticate(AzureTokenCredentials credentials, String subscriptionId); + } + + /** + * @return Entry point to manage DigitalTwins. + */ + public DigitalTwins digitalTwins() { + if (this.digitalTwins == null) { + this.digitalTwins = new DigitalTwinsImpl(this); + } + return this.digitalTwins; + } + + /** + * @return Entry point to manage DigitalTwinsEndpoints. + */ + public DigitalTwinsEndpoints digitalTwinsEndpoints() { + if (this.digitalTwinsEndpoints == null) { + this.digitalTwinsEndpoints = new DigitalTwinsEndpointsImpl(this); + } + return this.digitalTwinsEndpoints; + } + + /** + * @return Entry point to manage Operations. + */ + public Operations operations() { + if (this.operations == null) { + this.operations = new OperationsImpl(this); + } + return this.operations; + } + + /** + * The implementation for Configurable interface. + */ + private static final class ConfigurableImpl extends AzureConfigurableCoreImpl implements Configurable { + public DigitalTwinsManager authenticate(AzureTokenCredentials credentials, String subscriptionId) { + return DigitalTwinsManager.authenticate(buildRestClient(credentials), subscriptionId); + } + } + private DigitalTwinsManager(RestClient restClient, String subscriptionId) { + super( + restClient, + subscriptionId, + new AzureDigitalTwinsManagementClientImpl(restClient).withSubscriptionId(subscriptionId)); + } +} diff --git a/sdk/digitaltwins/mgmt-v2020_12_01/src/main/java/com/microsoft/azure/management/digitaltwins/v2020_12_01/implementation/GroupIdInformationInner.java b/sdk/digitaltwins/mgmt-v2020_12_01/src/main/java/com/microsoft/azure/management/digitaltwins/v2020_12_01/implementation/GroupIdInformationInner.java new file mode 100644 index 0000000000000..46af3cf877482 --- /dev/null +++ b/sdk/digitaltwins/mgmt-v2020_12_01/src/main/java/com/microsoft/azure/management/digitaltwins/v2020_12_01/implementation/GroupIdInformationInner.java @@ -0,0 +1,100 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.digitaltwins.v2020_12_01.implementation; + +import com.microsoft.azure.management.digitaltwins.v2020_12_01.GroupIdInformationPropertiesModel; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The group information for creating a private endpoint on Digital Twin. + */ +public class GroupIdInformationInner { + /** + * The properties property. + */ + @JsonProperty(value = "properties", required = true) + private GroupIdInformationPropertiesModel properties; + + /** + * The resource identifier. + */ + @JsonProperty(value = "id") + private String id; + + /** + * The resource name. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /** + * The resource type. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /** + * Get the properties value. + * + * @return the properties value + */ + public GroupIdInformationPropertiesModel properties() { + return this.properties; + } + + /** + * Set the properties value. + * + * @param properties the properties value to set + * @return the GroupIdInformationInner object itself. + */ + public GroupIdInformationInner withProperties(GroupIdInformationPropertiesModel properties) { + this.properties = properties; + return this; + } + + /** + * Get the resource identifier. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set the resource identifier. + * + * @param id the id value to set + * @return the GroupIdInformationInner object itself. + */ + public GroupIdInformationInner withId(String id) { + this.id = id; + return this; + } + + /** + * Get the resource name. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Get the resource type. + * + * @return the type value + */ + public String type() { + return this.type; + } + +} diff --git a/sdk/digitaltwins/mgmt-v2020_12_01/src/main/java/com/microsoft/azure/management/digitaltwins/v2020_12_01/implementation/GroupIdInformationResponseInner.java b/sdk/digitaltwins/mgmt-v2020_12_01/src/main/java/com/microsoft/azure/management/digitaltwins/v2020_12_01/implementation/GroupIdInformationResponseInner.java new file mode 100644 index 0000000000000..307072c59bc73 --- /dev/null +++ b/sdk/digitaltwins/mgmt-v2020_12_01/src/main/java/com/microsoft/azure/management/digitaltwins/v2020_12_01/implementation/GroupIdInformationResponseInner.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.digitaltwins.v2020_12_01.implementation; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The available private link resources for a Digital Twin. + */ +public class GroupIdInformationResponseInner { + /** + * The list of available private link resources for a Digital Twin. + */ + @JsonProperty(value = "value") + private List value; + + /** + * Get the list of available private link resources for a Digital Twin. + * + * @return the value value + */ + public List value() { + return this.value; + } + + /** + * Set the list of available private link resources for a Digital Twin. + * + * @param value the value value to set + * @return the GroupIdInformationResponseInner object itself. + */ + public GroupIdInformationResponseInner withValue(List value) { + this.value = value; + return this; + } + +} diff --git a/sdk/digitaltwins/mgmt-v2020_12_01/src/main/java/com/microsoft/azure/management/digitaltwins/v2020_12_01/implementation/IdParsingUtils.java b/sdk/digitaltwins/mgmt-v2020_12_01/src/main/java/com/microsoft/azure/management/digitaltwins/v2020_12_01/implementation/IdParsingUtils.java new file mode 100644 index 0000000000000..c1b128e4a65b4 --- /dev/null +++ b/sdk/digitaltwins/mgmt-v2020_12_01/src/main/java/com/microsoft/azure/management/digitaltwins/v2020_12_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.digitaltwins.v2020_12_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/digitaltwins/mgmt-v2020_12_01/src/main/java/com/microsoft/azure/management/digitaltwins/v2020_12_01/implementation/OperationImpl.java b/sdk/digitaltwins/mgmt-v2020_12_01/src/main/java/com/microsoft/azure/management/digitaltwins/v2020_12_01/implementation/OperationImpl.java new file mode 100644 index 0000000000000..8dd31683349e3 --- /dev/null +++ b/sdk/digitaltwins/mgmt-v2020_12_01/src/main/java/com/microsoft/azure/management/digitaltwins/v2020_12_01/implementation/OperationImpl.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.digitaltwins.v2020_12_01.implementation; + +import com.microsoft.azure.management.digitaltwins.v2020_12_01.Operation; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.digitaltwins.v2020_12_01.OperationDisplay; + +class OperationImpl extends WrapperImpl implements Operation { + private final DigitalTwinsManager manager; + OperationImpl(OperationInner inner, DigitalTwinsManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public DigitalTwinsManager manager() { + return this.manager; + } + + @Override + public OperationDisplay display() { + return this.inner().display(); + } + + @Override + public Boolean isDataAction() { + return this.inner().isDataAction(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public String origin() { + return this.inner().origin(); + } + +} diff --git a/sdk/digitaltwins/mgmt-v2020_12_01/src/main/java/com/microsoft/azure/management/digitaltwins/v2020_12_01/implementation/OperationInner.java b/sdk/digitaltwins/mgmt-v2020_12_01/src/main/java/com/microsoft/azure/management/digitaltwins/v2020_12_01/implementation/OperationInner.java new file mode 100644 index 0000000000000..adf9a7f7fa46b --- /dev/null +++ b/sdk/digitaltwins/mgmt-v2020_12_01/src/main/java/com/microsoft/azure/management/digitaltwins/v2020_12_01/implementation/OperationInner.java @@ -0,0 +1,89 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.digitaltwins.v2020_12_01.implementation; + +import com.microsoft.azure.management.digitaltwins.v2020_12_01.OperationDisplay; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * DigitalTwins service REST API operation. + */ +public class OperationInner { + /** + * Operation name: {provider}/{resource}/{read | write | action | delete}. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /** + * Operation properties display. + */ + @JsonProperty(value = "display") + private OperationDisplay display; + + /** + * The intended executor of the operation. + */ + @JsonProperty(value = "origin", access = JsonProperty.Access.WRITE_ONLY) + private String origin; + + /** + * If the operation is a data action (for data plane rbac). + */ + @JsonProperty(value = "isDataAction", access = JsonProperty.Access.WRITE_ONLY) + private Boolean isDataAction; + + /** + * Get operation name: {provider}/{resource}/{read | write | action | delete}. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Get operation properties display. + * + * @return the display value + */ + public OperationDisplay display() { + return this.display; + } + + /** + * Set operation properties display. + * + * @param display the display value to set + * @return the OperationInner object itself. + */ + public OperationInner withDisplay(OperationDisplay display) { + this.display = display; + return this; + } + + /** + * Get the intended executor of the operation. + * + * @return the origin value + */ + public String origin() { + return this.origin; + } + + /** + * Get if the operation is a data action (for data plane rbac). + * + * @return the isDataAction value + */ + public Boolean isDataAction() { + return this.isDataAction; + } + +} diff --git a/sdk/digitaltwins/mgmt-v2020_12_01/src/main/java/com/microsoft/azure/management/digitaltwins/v2020_12_01/implementation/OperationsImpl.java b/sdk/digitaltwins/mgmt-v2020_12_01/src/main/java/com/microsoft/azure/management/digitaltwins/v2020_12_01/implementation/OperationsImpl.java new file mode 100644 index 0000000000000..71f3f9278737c --- /dev/null +++ b/sdk/digitaltwins/mgmt-v2020_12_01/src/main/java/com/microsoft/azure/management/digitaltwins/v2020_12_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.digitaltwins.v2020_12_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.digitaltwins.v2020_12_01.Operations; +import rx.functions.Func1; +import rx.Observable; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.digitaltwins.v2020_12_01.Operation; + +class OperationsImpl extends WrapperImpl implements Operations { + private final DigitalTwinsManager manager; + + OperationsImpl(DigitalTwinsManager manager) { + super(manager.inner().operations()); + this.manager = manager; + } + + public DigitalTwinsManager 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/digitaltwins/mgmt-v2020_12_01/src/main/java/com/microsoft/azure/management/digitaltwins/v2020_12_01/implementation/OperationsInner.java b/sdk/digitaltwins/mgmt-v2020_12_01/src/main/java/com/microsoft/azure/management/digitaltwins/v2020_12_01/implementation/OperationsInner.java new file mode 100644 index 0000000000000..a81ef68c434ab --- /dev/null +++ b/sdk/digitaltwins/mgmt-v2020_12_01/src/main/java/com/microsoft/azure/management/digitaltwins/v2020_12_01/implementation/OperationsInner.java @@ -0,0 +1,280 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.digitaltwins.v2020_12_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.digitaltwins.v2020_12_01.ErrorResponseException; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Operations. + */ +public class OperationsInner { + /** The Retrofit service to perform REST calls. */ + private OperationsService service; + /** The service client containing this operation class. */ + private AzureDigitalTwinsManagementClientImpl 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, AzureDigitalTwinsManagementClientImpl 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.digitaltwins.v2020_12_01.Operations list" }) + @GET("providers/Microsoft.DigitalTwins/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.digitaltwins.v2020_12_01.Operations listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Lists all of the available DigitalTwins service REST API operations. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<OperationInner> object if successful. + */ + public PagedList list() { + ServiceResponse> response = listSinglePageAsync().toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all of the available DigitalTwins service REST API operations. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all of the available DigitalTwins service REST API operations. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<OperationInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all of the available DigitalTwins service REST API operations. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<OperationInner> object + */ + public Observable>> listWithServiceResponseAsync() { + return listSinglePageAsync() + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all of the available DigitalTwins service REST API operations. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<OperationInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync() { + return service.list(this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws ErrorResponseException, IOException { + return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Lists all of the available DigitalTwins service REST API operations. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<OperationInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all of the available DigitalTwins service REST API operations. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all of the available DigitalTwins service REST API operations. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<OperationInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all of the available DigitalTwins service REST API operations. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<OperationInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all of the available DigitalTwins service REST API operations. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<OperationInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + +} diff --git a/sdk/digitaltwins/mgmt-v2020_12_01/src/main/java/com/microsoft/azure/management/digitaltwins/v2020_12_01/implementation/PageImpl.java b/sdk/digitaltwins/mgmt-v2020_12_01/src/main/java/com/microsoft/azure/management/digitaltwins/v2020_12_01/implementation/PageImpl.java new file mode 100644 index 0000000000000..a180d0a7baddf --- /dev/null +++ b/sdk/digitaltwins/mgmt-v2020_12_01/src/main/java/com/microsoft/azure/management/digitaltwins/v2020_12_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.digitaltwins.v2020_12_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/digitaltwins/mgmt-v2020_12_01/src/main/java/com/microsoft/azure/management/digitaltwins/v2020_12_01/implementation/PrivateEndpointConnectionInner.java b/sdk/digitaltwins/mgmt-v2020_12_01/src/main/java/com/microsoft/azure/management/digitaltwins/v2020_12_01/implementation/PrivateEndpointConnectionInner.java new file mode 100644 index 0000000000000..4e1ac7fa183eb --- /dev/null +++ b/sdk/digitaltwins/mgmt-v2020_12_01/src/main/java/com/microsoft/azure/management/digitaltwins/v2020_12_01/implementation/PrivateEndpointConnectionInner.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.digitaltwins.v2020_12_01.implementation; + +import com.microsoft.azure.management.digitaltwins.v2020_12_01.PrivateEndpointConnectionProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.azure.ProxyResource; + +/** + * The private endpoint connection of a Digital Twin. + */ +public class PrivateEndpointConnectionInner extends ProxyResource { + /** + * The properties property. + */ + @JsonProperty(value = "properties", required = true) + private PrivateEndpointConnectionProperties properties; + + /** + * Get the properties value. + * + * @return the properties value + */ + public PrivateEndpointConnectionProperties properties() { + return this.properties; + } + + /** + * Set the properties value. + * + * @param properties the properties value to set + * @return the PrivateEndpointConnectionInner object itself. + */ + public PrivateEndpointConnectionInner withProperties(PrivateEndpointConnectionProperties properties) { + this.properties = properties; + return this; + } + +} diff --git a/sdk/digitaltwins/mgmt-v2020_12_01/src/main/java/com/microsoft/azure/management/digitaltwins/v2020_12_01/implementation/package-info.java b/sdk/digitaltwins/mgmt-v2020_12_01/src/main/java/com/microsoft/azure/management/digitaltwins/v2020_12_01/implementation/package-info.java new file mode 100644 index 0000000000000..643529d7f5685 --- /dev/null +++ b/sdk/digitaltwins/mgmt-v2020_12_01/src/main/java/com/microsoft/azure/management/digitaltwins/v2020_12_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 AzureDigitalTwinsManagementClient. + * Azure Digital Twins Client for managing DigitalTwinsInstance. + */ +package com.microsoft.azure.management.digitaltwins.v2020_12_01.implementation; diff --git a/sdk/digitaltwins/mgmt-v2020_12_01/src/main/java/com/microsoft/azure/management/digitaltwins/v2020_12_01/package-info.java b/sdk/digitaltwins/mgmt-v2020_12_01/src/main/java/com/microsoft/azure/management/digitaltwins/v2020_12_01/package-info.java new file mode 100644 index 0000000000000..df22eb9bff284 --- /dev/null +++ b/sdk/digitaltwins/mgmt-v2020_12_01/src/main/java/com/microsoft/azure/management/digitaltwins/v2020_12_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 AzureDigitalTwinsManagementClient. + * Azure Digital Twins Client for managing DigitalTwinsInstance. + */ +package com.microsoft.azure.management.digitaltwins.v2020_12_01;