diff --git a/sdk/iothub/mgmt-v2020_03_01/pom.xml b/sdk/iothub/mgmt-v2020_03_01/pom.xml new file mode 100644 index 0000000000000..d5ee3095abad8 --- /dev/null +++ b/sdk/iothub/mgmt-v2020_03_01/pom.xml @@ -0,0 +1,135 @@ + + + 4.0.0 + com.microsoft.azure.iothub.v2020_03_01 + + com.microsoft.azure + azure-arm-parent + 1.1.0 + ../../../pom.management.xml + + azure-mgmt-devices + 1.0.0-beta + jar + Microsoft Azure SDK for Devices Management + This package contains Microsoft Devices 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/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/AccessRights.java b/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/AccessRights.java new file mode 100644 index 0000000000000..691fd93d7c4bd --- /dev/null +++ b/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/AccessRights.java @@ -0,0 +1,92 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.iothub.v2020_03_01; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for AccessRights. + */ +public enum AccessRights { + /** Enum value RegistryRead. */ + REGISTRY_READ("RegistryRead"), + + /** Enum value RegistryWrite. */ + REGISTRY_WRITE("RegistryWrite"), + + /** Enum value ServiceConnect. */ + SERVICE_CONNECT("ServiceConnect"), + + /** Enum value DeviceConnect. */ + DEVICE_CONNECT("DeviceConnect"), + + /** Enum value RegistryRead, RegistryWrite. */ + REGISTRY_READ_REGISTRY_WRITE("RegistryRead, RegistryWrite"), + + /** Enum value RegistryRead, ServiceConnect. */ + REGISTRY_READ_SERVICE_CONNECT("RegistryRead, ServiceConnect"), + + /** Enum value RegistryRead, DeviceConnect. */ + REGISTRY_READ_DEVICE_CONNECT("RegistryRead, DeviceConnect"), + + /** Enum value RegistryWrite, ServiceConnect. */ + REGISTRY_WRITE_SERVICE_CONNECT("RegistryWrite, ServiceConnect"), + + /** Enum value RegistryWrite, DeviceConnect. */ + REGISTRY_WRITE_DEVICE_CONNECT("RegistryWrite, DeviceConnect"), + + /** Enum value ServiceConnect, DeviceConnect. */ + SERVICE_CONNECT_DEVICE_CONNECT("ServiceConnect, DeviceConnect"), + + /** Enum value RegistryRead, RegistryWrite, ServiceConnect. */ + REGISTRY_READ_REGISTRY_WRITE_SERVICE_CONNECT("RegistryRead, RegistryWrite, ServiceConnect"), + + /** Enum value RegistryRead, RegistryWrite, DeviceConnect. */ + REGISTRY_READ_REGISTRY_WRITE_DEVICE_CONNECT("RegistryRead, RegistryWrite, DeviceConnect"), + + /** Enum value RegistryRead, ServiceConnect, DeviceConnect. */ + REGISTRY_READ_SERVICE_CONNECT_DEVICE_CONNECT("RegistryRead, ServiceConnect, DeviceConnect"), + + /** Enum value RegistryWrite, ServiceConnect, DeviceConnect. */ + REGISTRY_WRITE_SERVICE_CONNECT_DEVICE_CONNECT("RegistryWrite, ServiceConnect, DeviceConnect"), + + /** Enum value RegistryRead, RegistryWrite, ServiceConnect, DeviceConnect. */ + REGISTRY_READ_REGISTRY_WRITE_SERVICE_CONNECT_DEVICE_CONNECT("RegistryRead, RegistryWrite, ServiceConnect, DeviceConnect"); + + /** The actual serialized value for a AccessRights instance. */ + private String value; + + AccessRights(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a AccessRights instance. + * + * @param value the serialized value to parse. + * @return the parsed AccessRights object, or null if unable to parse. + */ + @JsonCreator + public static AccessRights fromString(String value) { + AccessRights[] items = AccessRights.values(); + for (AccessRights item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/AuthenticationType.java b/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/AuthenticationType.java new file mode 100644 index 0000000000000..c3005cc58f55d --- /dev/null +++ b/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_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.iothub.v2020_03_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/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/Capabilities.java b/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/Capabilities.java new file mode 100644 index 0000000000000..bb3f929e6fee5 --- /dev/null +++ b/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/Capabilities.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.iothub.v2020_03_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for Capabilities. + */ +public final class Capabilities extends ExpandableStringEnum { + /** Static value None for Capabilities. */ + public static final Capabilities NONE = fromString("None"); + + /** Static value DeviceManagement for Capabilities. */ + public static final Capabilities DEVICE_MANAGEMENT = fromString("DeviceManagement"); + + /** + * Creates or finds a Capabilities from its string representation. + * @param name a name to look for + * @return the corresponding Capabilities + */ + @JsonCreator + public static Capabilities fromString(String name) { + return fromString(name, Capabilities.class); + } + + /** + * @return known Capabilities values + */ + public static Collection values() { + return values(Capabilities.class); + } +} diff --git a/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/CertificateBodyDescription.java b/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/CertificateBodyDescription.java new file mode 100644 index 0000000000000..6b1fe200e64cd --- /dev/null +++ b/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/CertificateBodyDescription.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.iothub.v2020_03_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The JSON-serialized X509 Certificate. + */ +public class CertificateBodyDescription { + /** + * base-64 representation of the X509 leaf certificate .cer file or just + * .pem file content. + */ + @JsonProperty(value = "certificate") + private String certificate; + + /** + * Get base-64 representation of the X509 leaf certificate .cer file or just .pem file content. + * + * @return the certificate value + */ + public String certificate() { + return this.certificate; + } + + /** + * Set base-64 representation of the X509 leaf certificate .cer file or just .pem file content. + * + * @param certificate the certificate value to set + * @return the CertificateBodyDescription object itself. + */ + public CertificateBodyDescription withCertificate(String certificate) { + this.certificate = certificate; + return this; + } + +} diff --git a/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/CertificateDescription.java b/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/CertificateDescription.java new file mode 100644 index 0000000000000..5a4bbd9bc3f5e --- /dev/null +++ b/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/CertificateDescription.java @@ -0,0 +1,146 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.iothub.v2020_03_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.iothub.v2020_03_01.implementation.CertificateDescriptionInner; +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.iothub.v2020_03_01.implementation.DevicesManager; + +/** + * Type representing CertificateDescription. + */ +public interface CertificateDescription extends HasInner, Indexable, Refreshable, Updatable, HasManager { + /** + * @return the etag value. + */ + String etag(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the properties value. + */ + CertificateProperties properties(); + + /** + * @return the type value. + */ + String type(); + + /** + * The entirety of the CertificateDescription definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithIotHub, DefinitionStages.WithIfMatch, DefinitionStages.WithCertificate, DefinitionStages.WithCreate { + } + + /** + * Grouping of CertificateDescription definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a CertificateDescription definition. + */ + interface Blank extends WithIotHub { + } + + /** + * The stage of the certificatedescription definition allowing to specify IotHub. + */ + interface WithIotHub { + /** + * Specifies resourceGroupName, resourceName. + * @param resourceGroupName The name of the resource group that contains the IoT hub + * @param resourceName The name of the IoT hub + * @return the next definition stage + */ + WithIfMatch withExistingIotHub(String resourceGroupName, String resourceName); + } + + /** + * The stage of the certificatedescription definition allowing to specify IfMatch. + */ + interface WithIfMatch { + /** + * Specifies ifMatch. + * @param ifMatch ETag of the Certificate. Do not specify for creating a brand new certificate. Required to update an existing certificate + * @return the next definition stage + */ + WithCertificate withIfMatch(String ifMatch); + } + + /** + * The stage of the certificatedescription definition allowing to specify Certificate. + */ + interface WithCertificate { + /** + * Specifies certificate. + * @param certificate base-64 representation of the X509 leaf certificate .cer file or just .pem file content + * @return the next definition stage + */ + WithCreate withCertificate(String certificate); + } + + /** + * 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 CertificateDescription update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, UpdateStages.WithIfMatch, UpdateStages.WithCertificate { + } + + /** + * Grouping of CertificateDescription update stages. + */ + interface UpdateStages { + /** + * The stage of the certificatedescription update allowing to specify IfMatch. + */ + interface WithIfMatch { + /** + * Specifies ifMatch. + * @param ifMatch ETag of the Certificate. Do not specify for creating a brand new certificate. Required to update an existing certificate + * @return the next update stage + */ + Update withIfMatch(String ifMatch); + } + + /** + * The stage of the certificatedescription update allowing to specify Certificate. + */ + interface WithCertificate { + /** + * Specifies certificate. + * @param certificate base-64 representation of the X509 leaf certificate .cer file or just .pem file content + * @return the next update stage + */ + Update withCertificate(String certificate); + } + + } +} diff --git a/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/CertificateListDescription.java b/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/CertificateListDescription.java new file mode 100644 index 0000000000000..3342143b35bee --- /dev/null +++ b/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/CertificateListDescription.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.iothub.v2020_03_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.iothub.v2020_03_01.implementation.DevicesManager; +import com.microsoft.azure.management.iothub.v2020_03_01.implementation.CertificateListDescriptionInner; +import com.microsoft.azure.management.iothub.v2020_03_01.implementation.CertificateDescriptionInner; +import java.util.List; + +/** + * Type representing CertificateListDescription. + */ +public interface CertificateListDescription extends HasInner, HasManager { + /** + * @return the value value. + */ + List value(); + +} diff --git a/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/CertificateProperties.java b/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/CertificateProperties.java new file mode 100644 index 0000000000000..8b9a3b5ee42c8 --- /dev/null +++ b/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/CertificateProperties.java @@ -0,0 +1,144 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.iothub.v2020_03_01; + +import com.microsoft.rest.DateTimeRfc1123; +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The description of an X509 CA Certificate. + */ +public class CertificateProperties { + /** + * The certificate's subject name. + */ + @JsonProperty(value = "subject", access = JsonProperty.Access.WRITE_ONLY) + private String subject; + + /** + * The certificate's expiration date and time. + */ + @JsonProperty(value = "expiry", access = JsonProperty.Access.WRITE_ONLY) + private DateTimeRfc1123 expiry; + + /** + * The certificate's thumbprint. + */ + @JsonProperty(value = "thumbprint", access = JsonProperty.Access.WRITE_ONLY) + private String thumbprint; + + /** + * Determines whether certificate has been verified. + */ + @JsonProperty(value = "isVerified", access = JsonProperty.Access.WRITE_ONLY) + private Boolean isVerified; + + /** + * The certificate's create date and time. + */ + @JsonProperty(value = "created", access = JsonProperty.Access.WRITE_ONLY) + private DateTimeRfc1123 created; + + /** + * The certificate's last update date and time. + */ + @JsonProperty(value = "updated", access = JsonProperty.Access.WRITE_ONLY) + private DateTimeRfc1123 updated; + + /** + * The certificate content. + */ + @JsonProperty(value = "certificate") + private String certificate; + + /** + * Get the certificate's subject name. + * + * @return the subject value + */ + public String subject() { + return this.subject; + } + + /** + * Get the certificate's expiration date and time. + * + * @return the expiry value + */ + public DateTime expiry() { + if (this.expiry == null) { + return null; + } + return this.expiry.dateTime(); + } + + /** + * Get the certificate's thumbprint. + * + * @return the thumbprint value + */ + public String thumbprint() { + return this.thumbprint; + } + + /** + * Get determines whether certificate has been verified. + * + * @return the isVerified value + */ + public Boolean isVerified() { + return this.isVerified; + } + + /** + * Get the certificate's create date and time. + * + * @return the created value + */ + public DateTime created() { + if (this.created == null) { + return null; + } + return this.created.dateTime(); + } + + /** + * Get the certificate's last update date and time. + * + * @return the updated value + */ + public DateTime updated() { + if (this.updated == null) { + return null; + } + return this.updated.dateTime(); + } + + /** + * Get the certificate content. + * + * @return the certificate value + */ + public String certificate() { + return this.certificate; + } + + /** + * Set the certificate content. + * + * @param certificate the certificate value to set + * @return the CertificateProperties object itself. + */ + public CertificateProperties withCertificate(String certificate) { + this.certificate = certificate; + return this; + } + +} diff --git a/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/CertificatePropertiesWithNonce.java b/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/CertificatePropertiesWithNonce.java new file mode 100644 index 0000000000000..09c18c4eee3af --- /dev/null +++ b/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/CertificatePropertiesWithNonce.java @@ -0,0 +1,150 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.iothub.v2020_03_01; + +import com.microsoft.rest.DateTimeRfc1123; +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The description of an X509 CA Certificate including the challenge nonce + * issued for the Proof-Of-Possession flow. + */ +public class CertificatePropertiesWithNonce { + /** + * The certificate's subject name. + */ + @JsonProperty(value = "subject", access = JsonProperty.Access.WRITE_ONLY) + private String subject; + + /** + * The certificate's expiration date and time. + */ + @JsonProperty(value = "expiry", access = JsonProperty.Access.WRITE_ONLY) + private DateTimeRfc1123 expiry; + + /** + * The certificate's thumbprint. + */ + @JsonProperty(value = "thumbprint", access = JsonProperty.Access.WRITE_ONLY) + private String thumbprint; + + /** + * Determines whether certificate has been verified. + */ + @JsonProperty(value = "isVerified", access = JsonProperty.Access.WRITE_ONLY) + private Boolean isVerified; + + /** + * The certificate's create date and time. + */ + @JsonProperty(value = "created", access = JsonProperty.Access.WRITE_ONLY) + private DateTimeRfc1123 created; + + /** + * The certificate's last update date and time. + */ + @JsonProperty(value = "updated", access = JsonProperty.Access.WRITE_ONLY) + private DateTimeRfc1123 updated; + + /** + * The certificate's verification code that will be used for proof of + * possession. + */ + @JsonProperty(value = "verificationCode", access = JsonProperty.Access.WRITE_ONLY) + private String verificationCode; + + /** + * The certificate content. + */ + @JsonProperty(value = "certificate", access = JsonProperty.Access.WRITE_ONLY) + private String certificate; + + /** + * Get the certificate's subject name. + * + * @return the subject value + */ + public String subject() { + return this.subject; + } + + /** + * Get the certificate's expiration date and time. + * + * @return the expiry value + */ + public DateTime expiry() { + if (this.expiry == null) { + return null; + } + return this.expiry.dateTime(); + } + + /** + * Get the certificate's thumbprint. + * + * @return the thumbprint value + */ + public String thumbprint() { + return this.thumbprint; + } + + /** + * Get determines whether certificate has been verified. + * + * @return the isVerified value + */ + public Boolean isVerified() { + return this.isVerified; + } + + /** + * Get the certificate's create date and time. + * + * @return the created value + */ + public DateTime created() { + if (this.created == null) { + return null; + } + return this.created.dateTime(); + } + + /** + * Get the certificate's last update date and time. + * + * @return the updated value + */ + public DateTime updated() { + if (this.updated == null) { + return null; + } + return this.updated.dateTime(); + } + + /** + * Get the certificate's verification code that will be used for proof of possession. + * + * @return the verificationCode value + */ + public String verificationCode() { + return this.verificationCode; + } + + /** + * Get the certificate content. + * + * @return the certificate value + */ + public String certificate() { + return this.certificate; + } + +} diff --git a/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/CertificateVerificationDescription.java b/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/CertificateVerificationDescription.java new file mode 100644 index 0000000000000..1f0b6c82a760b --- /dev/null +++ b/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/CertificateVerificationDescription.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.iothub.v2020_03_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The JSON-serialized leaf certificate. + */ +public class CertificateVerificationDescription { + /** + * base-64 representation of X509 certificate .cer file or just .pem file + * content. + */ + @JsonProperty(value = "certificate") + private String certificate; + + /** + * Get base-64 representation of X509 certificate .cer file or just .pem file content. + * + * @return the certificate value + */ + public String certificate() { + return this.certificate; + } + + /** + * Set base-64 representation of X509 certificate .cer file or just .pem file content. + * + * @param certificate the certificate value to set + * @return the CertificateVerificationDescription object itself. + */ + public CertificateVerificationDescription withCertificate(String certificate) { + this.certificate = certificate; + return this; + } + +} diff --git a/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/CertificateWithNonceDescription.java b/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/CertificateWithNonceDescription.java new file mode 100644 index 0000000000000..85ac40b48999f --- /dev/null +++ b/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/CertificateWithNonceDescription.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.iothub.v2020_03_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.iothub.v2020_03_01.implementation.DevicesManager; +import com.microsoft.azure.management.iothub.v2020_03_01.implementation.CertificateWithNonceDescriptionInner; + +/** + * Type representing CertificateWithNonceDescription. + */ +public interface CertificateWithNonceDescription extends HasInner, HasManager { + /** + * @return the etag value. + */ + String etag(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the properties value. + */ + CertificatePropertiesWithNonce properties(); + + /** + * @return the type value. + */ + String type(); + +} diff --git a/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/Certificates.java b/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/Certificates.java new file mode 100644 index 0000000000000..77bcc1efd1197 --- /dev/null +++ b/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/Certificates.java @@ -0,0 +1,83 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.iothub.v2020_03_01; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import rx.Completable; +import rx.Observable; +import com.microsoft.azure.management.iothub.v2020_03_01.implementation.CertificatesInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing Certificates. + */ +public interface Certificates extends SupportsCreating, HasInner { + /** + * Get the certificate list. + * Returns the list of certificates. + * + * @param resourceGroupName The name of the resource group that contains the IoT hub. + * @param resourceName The name of the IoT hub. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listByIotHubAsync(String resourceGroupName, String resourceName); + + /** + * Generate verification code for proof of possession flow. + * Generates verification code for proof of possession flow. The verification code will be used to generate a leaf certificate. + * + * @param resourceGroupName The name of the resource group that contains the IoT hub. + * @param resourceName The name of the IoT hub. + * @param certificateName The name of the certificate + * @param ifMatch ETag of the Certificate. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable generateVerificationCodeAsync(String resourceGroupName, String resourceName, String certificateName, String ifMatch); + + /** + * Verify certificate's private key possession. + * Verifies the certificate's private key possession by providing the leaf cert issued by the verifying pre uploaded certificate. + * + * @param resourceGroupName The name of the resource group that contains the IoT hub. + * @param resourceName The name of the IoT hub. + * @param certificateName The name of the certificate + * @param ifMatch ETag of the Certificate. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable verifyAsync(String resourceGroupName, String resourceName, String certificateName, String ifMatch); + + /** + * Get the certificate. + * Returns the certificate. + * + * @param resourceGroupName The name of the resource group that contains the IoT hub. + * @param resourceName The name of the IoT hub. + * @param certificateName The name of the certificate + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String resourceName, String certificateName); + + /** + * Delete an X509 certificate. + * Deletes an existing X509 certificate or does nothing if it does not exist. + * + * @param resourceGroupName The name of the resource group that contains the IoT hub. + * @param resourceName The name of the IoT hub. + * @param certificateName The name of the certificate + * @param ifMatch ETag of the Certificate. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable deleteAsync(String resourceGroupName, String resourceName, String certificateName, String ifMatch); + +} diff --git a/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/CloudToDeviceProperties.java b/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/CloudToDeviceProperties.java new file mode 100644 index 0000000000000..30c457ed5b88f --- /dev/null +++ b/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/CloudToDeviceProperties.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.iothub.v2020_03_01; + +import org.joda.time.Period; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The IoT hub cloud-to-device messaging properties. + */ +public class CloudToDeviceProperties { + /** + * The max delivery count for cloud-to-device messages in the device queue. + * See: + * https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-messaging#cloud-to-device-messages. + */ + @JsonProperty(value = "maxDeliveryCount") + private Integer maxDeliveryCount; + + /** + * The default time to live for cloud-to-device messages in the device + * queue. See: + * https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-messaging#cloud-to-device-messages. + */ + @JsonProperty(value = "defaultTtlAsIso8601") + private Period defaultTtlAsIso8601; + + /** + * The feedback property. + */ + @JsonProperty(value = "feedback") + private FeedbackProperties feedback; + + /** + * Get the max delivery count for cloud-to-device messages in the device queue. See: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-messaging#cloud-to-device-messages. + * + * @return the maxDeliveryCount value + */ + public Integer maxDeliveryCount() { + return this.maxDeliveryCount; + } + + /** + * Set the max delivery count for cloud-to-device messages in the device queue. See: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-messaging#cloud-to-device-messages. + * + * @param maxDeliveryCount the maxDeliveryCount value to set + * @return the CloudToDeviceProperties object itself. + */ + public CloudToDeviceProperties withMaxDeliveryCount(Integer maxDeliveryCount) { + this.maxDeliveryCount = maxDeliveryCount; + return this; + } + + /** + * Get the default time to live for cloud-to-device messages in the device queue. See: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-messaging#cloud-to-device-messages. + * + * @return the defaultTtlAsIso8601 value + */ + public Period defaultTtlAsIso8601() { + return this.defaultTtlAsIso8601; + } + + /** + * Set the default time to live for cloud-to-device messages in the device queue. See: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-messaging#cloud-to-device-messages. + * + * @param defaultTtlAsIso8601 the defaultTtlAsIso8601 value to set + * @return the CloudToDeviceProperties object itself. + */ + public CloudToDeviceProperties withDefaultTtlAsIso8601(Period defaultTtlAsIso8601) { + this.defaultTtlAsIso8601 = defaultTtlAsIso8601; + return this; + } + + /** + * Get the feedback value. + * + * @return the feedback value + */ + public FeedbackProperties feedback() { + return this.feedback; + } + + /** + * Set the feedback value. + * + * @param feedback the feedback value to set + * @return the CloudToDeviceProperties object itself. + */ + public CloudToDeviceProperties withFeedback(FeedbackProperties feedback) { + this.feedback = feedback; + return this; + } + +} diff --git a/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/EndpointHealthData.java b/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/EndpointHealthData.java new file mode 100644 index 0000000000000..cfe0a7a315057 --- /dev/null +++ b/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/EndpointHealthData.java @@ -0,0 +1,30 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.iothub.v2020_03_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.iothub.v2020_03_01.implementation.DevicesManager; +import com.microsoft.azure.management.iothub.v2020_03_01.implementation.EndpointHealthDataInner; + +/** + * Type representing EndpointHealthData. + */ +public interface EndpointHealthData extends HasInner, HasManager { + /** + * @return the endpointId value. + */ + String endpointId(); + + /** + * @return the healthStatus value. + */ + EndpointHealthStatus healthStatus(); + +} diff --git a/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/EndpointHealthStatus.java b/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/EndpointHealthStatus.java new file mode 100644 index 0000000000000..e0e2b2671dca5 --- /dev/null +++ b/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/EndpointHealthStatus.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.iothub.v2020_03_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for EndpointHealthStatus. + */ +public final class EndpointHealthStatus extends ExpandableStringEnum { + /** Static value unknown for EndpointHealthStatus. */ + public static final EndpointHealthStatus UNKNOWN = fromString("unknown"); + + /** Static value healthy for EndpointHealthStatus. */ + public static final EndpointHealthStatus HEALTHY = fromString("healthy"); + + /** Static value unhealthy for EndpointHealthStatus. */ + public static final EndpointHealthStatus UNHEALTHY = fromString("unhealthy"); + + /** Static value dead for EndpointHealthStatus. */ + public static final EndpointHealthStatus DEAD = fromString("dead"); + + /** + * Creates or finds a EndpointHealthStatus from its string representation. + * @param name a name to look for + * @return the corresponding EndpointHealthStatus + */ + @JsonCreator + public static EndpointHealthStatus fromString(String name) { + return fromString(name, EndpointHealthStatus.class); + } + + /** + * @return known EndpointHealthStatus values + */ + public static Collection values() { + return values(EndpointHealthStatus.class); + } +} diff --git a/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/EnrichmentProperties.java b/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/EnrichmentProperties.java new file mode 100644 index 0000000000000..d37d93b9b7776 --- /dev/null +++ b/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/EnrichmentProperties.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.iothub.v2020_03_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The properties of an enrichment that your IoT hub applies to messages + * delivered to endpoints. + */ +public class EnrichmentProperties { + /** + * The key or name for the enrichment property. + */ + @JsonProperty(value = "key", required = true) + private String key; + + /** + * The value for the enrichment property. + */ + @JsonProperty(value = "value", required = true) + private String value; + + /** + * The list of endpoints for which the enrichment is applied to the + * message. + */ + @JsonProperty(value = "endpointNames", required = true) + private List endpointNames; + + /** + * Get the key or name for the enrichment property. + * + * @return the key value + */ + public String key() { + return this.key; + } + + /** + * Set the key or name for the enrichment property. + * + * @param key the key value to set + * @return the EnrichmentProperties object itself. + */ + public EnrichmentProperties withKey(String key) { + this.key = key; + return this; + } + + /** + * Get the value for the enrichment property. + * + * @return the value value + */ + public String value() { + return this.value; + } + + /** + * Set the value for the enrichment property. + * + * @param value the value value to set + * @return the EnrichmentProperties object itself. + */ + public EnrichmentProperties withValue(String value) { + this.value = value; + return this; + } + + /** + * Get the list of endpoints for which the enrichment is applied to the message. + * + * @return the endpointNames value + */ + public List endpointNames() { + return this.endpointNames; + } + + /** + * Set the list of endpoints for which the enrichment is applied to the message. + * + * @param endpointNames the endpointNames value to set + * @return the EnrichmentProperties object itself. + */ + public EnrichmentProperties withEndpointNames(List endpointNames) { + this.endpointNames = endpointNames; + return this; + } + +} diff --git a/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/EventHubConsumerGroupInfo.java b/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/EventHubConsumerGroupInfo.java new file mode 100644 index 0000000000000..1dacf40270afa --- /dev/null +++ b/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/EventHubConsumerGroupInfo.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.iothub.v2020_03_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.iothub.v2020_03_01.implementation.EventHubConsumerGroupInfoInner; +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.iothub.v2020_03_01.implementation.DevicesManager; +import java.util.Map; + +/** + * Type representing EventHubConsumerGroupInfo. + */ +public interface EventHubConsumerGroupInfo extends HasInner, Indexable, Refreshable, Updatable, HasManager { + /** + * @return the etag value. + */ + String etag(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the properties value. + */ + Map properties(); + + /** + * @return the type value. + */ + String type(); + + /** + * The entirety of the EventHubConsumerGroupInfo definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithEventHubEndpoint, DefinitionStages.WithCreate { + } + + /** + * Grouping of EventHubConsumerGroupInfo definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a EventHubConsumerGroupInfo definition. + */ + interface Blank extends WithEventHubEndpoint { + } + + /** + * The stage of the eventhubconsumergroupinfo definition allowing to specify EventHubEndpoint. + */ + interface WithEventHubEndpoint { + /** + * Specifies resourceGroupName, resourceName, eventHubEndpointName. + * @param resourceGroupName The name of the resource group that contains the IoT hub + * @param resourceName The name of the IoT hub + * @param eventHubEndpointName The name of the Event Hub-compatible endpoint in the IoT hub + * @return the next definition stage + */ + WithCreate withExistingEventHubEndpoint(String resourceGroupName, String resourceName, String eventHubEndpointName); + } + + /** + * 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 EventHubConsumerGroupInfo update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable { + } + + /** + * Grouping of EventHubConsumerGroupInfo update stages. + */ + interface UpdateStages { + } +} diff --git a/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/EventHubProperties.java b/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/EventHubProperties.java new file mode 100644 index 0000000000000..c82cd331c1b5e --- /dev/null +++ b/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/EventHubProperties.java @@ -0,0 +1,119 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.iothub.v2020_03_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The properties of the provisioned Event Hub-compatible endpoint used by the + * IoT hub. + */ +public class EventHubProperties { + /** + * The retention time for device-to-cloud messages in days. See: + * https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-messaging#device-to-cloud-messages. + */ + @JsonProperty(value = "retentionTimeInDays") + private Long retentionTimeInDays; + + /** + * The number of partitions for receiving device-to-cloud messages in the + * Event Hub-compatible endpoint. See: + * https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-messaging#device-to-cloud-messages. + */ + @JsonProperty(value = "partitionCount") + private Integer partitionCount; + + /** + * The partition ids in the Event Hub-compatible endpoint. + */ + @JsonProperty(value = "partitionIds", access = JsonProperty.Access.WRITE_ONLY) + private List partitionIds; + + /** + * The Event Hub-compatible name. + */ + @JsonProperty(value = "path", access = JsonProperty.Access.WRITE_ONLY) + private String path; + + /** + * The Event Hub-compatible endpoint. + */ + @JsonProperty(value = "endpoint", access = JsonProperty.Access.WRITE_ONLY) + private String endpoint; + + /** + * Get the retention time for device-to-cloud messages in days. See: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-messaging#device-to-cloud-messages. + * + * @return the retentionTimeInDays value + */ + public Long retentionTimeInDays() { + return this.retentionTimeInDays; + } + + /** + * Set the retention time for device-to-cloud messages in days. See: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-messaging#device-to-cloud-messages. + * + * @param retentionTimeInDays the retentionTimeInDays value to set + * @return the EventHubProperties object itself. + */ + public EventHubProperties withRetentionTimeInDays(Long retentionTimeInDays) { + this.retentionTimeInDays = retentionTimeInDays; + return this; + } + + /** + * Get the number of partitions for receiving device-to-cloud messages in the Event Hub-compatible endpoint. See: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-messaging#device-to-cloud-messages. + * + * @return the partitionCount value + */ + public Integer partitionCount() { + return this.partitionCount; + } + + /** + * Set the number of partitions for receiving device-to-cloud messages in the Event Hub-compatible endpoint. See: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-messaging#device-to-cloud-messages. + * + * @param partitionCount the partitionCount value to set + * @return the EventHubProperties object itself. + */ + public EventHubProperties withPartitionCount(Integer partitionCount) { + this.partitionCount = partitionCount; + return this; + } + + /** + * Get the partition ids in the Event Hub-compatible endpoint. + * + * @return the partitionIds value + */ + public List partitionIds() { + return this.partitionIds; + } + + /** + * Get the Event Hub-compatible name. + * + * @return the path value + */ + public String path() { + return this.path; + } + + /** + * Get the Event Hub-compatible endpoint. + * + * @return the endpoint value + */ + public String endpoint() { + return this.endpoint; + } + +} diff --git a/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/ExportDevicesRequest.java b/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/ExportDevicesRequest.java new file mode 100644 index 0000000000000..002c2c1f815aa --- /dev/null +++ b/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/ExportDevicesRequest.java @@ -0,0 +1,125 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.iothub.v2020_03_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Use to provide parameters when requesting an export of all devices in the + * IoT hub. + */ +public class ExportDevicesRequest { + /** + * The export blob container URI. + */ + @JsonProperty(value = "exportBlobContainerUri", required = true) + private String exportBlobContainerUri; + + /** + * The value indicating whether keys should be excluded during export. + */ + @JsonProperty(value = "excludeKeys", required = true) + private boolean excludeKeys; + + /** + * The name of the blob that will be created in the provided output blob + * container. This blob will contain the exported device registry + * information for the IoT Hub. + */ + @JsonProperty(value = "exportBlobName") + private String exportBlobName; + + /** + * Specifies authentication type being used for connecting to the storage + * account. Possible values include: 'keyBased', 'identityBased'. + */ + @JsonProperty(value = "authenticationType") + private AuthenticationType authenticationType; + + /** + * Get the export blob container URI. + * + * @return the exportBlobContainerUri value + */ + public String exportBlobContainerUri() { + return this.exportBlobContainerUri; + } + + /** + * Set the export blob container URI. + * + * @param exportBlobContainerUri the exportBlobContainerUri value to set + * @return the ExportDevicesRequest object itself. + */ + public ExportDevicesRequest withExportBlobContainerUri(String exportBlobContainerUri) { + this.exportBlobContainerUri = exportBlobContainerUri; + return this; + } + + /** + * Get the value indicating whether keys should be excluded during export. + * + * @return the excludeKeys value + */ + public boolean excludeKeys() { + return this.excludeKeys; + } + + /** + * Set the value indicating whether keys should be excluded during export. + * + * @param excludeKeys the excludeKeys value to set + * @return the ExportDevicesRequest object itself. + */ + public ExportDevicesRequest withExcludeKeys(boolean excludeKeys) { + this.excludeKeys = excludeKeys; + return this; + } + + /** + * Get the name of the blob that will be created in the provided output blob container. This blob will contain the exported device registry information for the IoT Hub. + * + * @return the exportBlobName value + */ + public String exportBlobName() { + return this.exportBlobName; + } + + /** + * Set the name of the blob that will be created in the provided output blob container. This blob will contain the exported device registry information for the IoT Hub. + * + * @param exportBlobName the exportBlobName value to set + * @return the ExportDevicesRequest object itself. + */ + public ExportDevicesRequest withExportBlobName(String exportBlobName) { + this.exportBlobName = exportBlobName; + return this; + } + + /** + * Get specifies authentication type being used for connecting to the storage account. Possible values include: 'keyBased', 'identityBased'. + * + * @return the authenticationType value + */ + public AuthenticationType authenticationType() { + return this.authenticationType; + } + + /** + * Set specifies authentication type being used for connecting to the storage account. Possible values include: 'keyBased', 'identityBased'. + * + * @param authenticationType the authenticationType value to set + * @return the ExportDevicesRequest object itself. + */ + public ExportDevicesRequest withAuthenticationType(AuthenticationType authenticationType) { + this.authenticationType = authenticationType; + return this; + } + +} diff --git a/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/FailoverInput.java b/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/FailoverInput.java new file mode 100644 index 0000000000000..ba3732e00dcc9 --- /dev/null +++ b/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/FailoverInput.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.iothub.v2020_03_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Use to provide failover region when requesting manual Failover for a hub. + */ +public class FailoverInput { + /** + * Region the hub will be failed over to. + */ + @JsonProperty(value = "failoverRegion", required = true) + private String failoverRegion; + + /** + * Get region the hub will be failed over to. + * + * @return the failoverRegion value + */ + public String failoverRegion() { + return this.failoverRegion; + } + + /** + * Set region the hub will be failed over to. + * + * @param failoverRegion the failoverRegion value to set + * @return the FailoverInput object itself. + */ + public FailoverInput withFailoverRegion(String failoverRegion) { + this.failoverRegion = failoverRegion; + return this; + } + +} diff --git a/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/FallbackRouteProperties.java b/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/FallbackRouteProperties.java new file mode 100644 index 0000000000000..b8c3af3a3be95 --- /dev/null +++ b/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/FallbackRouteProperties.java @@ -0,0 +1,165 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.iothub.v2020_03_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The properties of the fallback route. IoT Hub uses these properties when it + * routes messages to the fallback endpoint. + */ +public class FallbackRouteProperties { + /** + * The name of the route. The name can only include alphanumeric + * characters, periods, underscores, hyphens, has a maximum length of 64 + * characters, and must be unique. + */ + @JsonProperty(value = "name") + private String name; + + /** + * The source to which the routing rule is to be applied to. For example, + * DeviceMessages. + */ + @JsonProperty(value = "source", required = true) + private String source; + + /** + * The condition which is evaluated in order to apply the fallback route. + * If the condition is not provided it will evaluate to true by default. + * For grammar, See: + * https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-query-language. + */ + @JsonProperty(value = "condition") + private String condition; + + /** + * The list of endpoints to which the messages that satisfy the condition + * are routed to. Currently only 1 endpoint is allowed. + */ + @JsonProperty(value = "endpointNames", required = true) + private List endpointNames; + + /** + * Used to specify whether the fallback route is enabled. + */ + @JsonProperty(value = "isEnabled", required = true) + private boolean isEnabled; + + /** + * Creates an instance of FallbackRouteProperties class. + * @param endpointNames the list of endpoints to which the messages that satisfy the condition are routed to. Currently only 1 endpoint is allowed. + * @param isEnabled used to specify whether the fallback route is enabled. + */ + public FallbackRouteProperties() { + source = "DeviceMessages"; + } + + /** + * Get the name of the route. The name can only include alphanumeric characters, periods, underscores, hyphens, has a maximum length of 64 characters, and must be unique. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name of the route. The name can only include alphanumeric characters, periods, underscores, hyphens, has a maximum length of 64 characters, and must be unique. + * + * @param name the name value to set + * @return the FallbackRouteProperties object itself. + */ + public FallbackRouteProperties withName(String name) { + this.name = name; + return this; + } + + /** + * Get the source to which the routing rule is to be applied to. For example, DeviceMessages. + * + * @return the source value + */ + public String source() { + return this.source; + } + + /** + * Set the source to which the routing rule is to be applied to. For example, DeviceMessages. + * + * @param source the source value to set + * @return the FallbackRouteProperties object itself. + */ + public FallbackRouteProperties withSource(String source) { + this.source = source; + return this; + } + + /** + * Get the condition which is evaluated in order to apply the fallback route. If the condition is not provided it will evaluate to true by default. For grammar, See: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-query-language. + * + * @return the condition value + */ + public String condition() { + return this.condition; + } + + /** + * Set the condition which is evaluated in order to apply the fallback route. If the condition is not provided it will evaluate to true by default. For grammar, See: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-query-language. + * + * @param condition the condition value to set + * @return the FallbackRouteProperties object itself. + */ + public FallbackRouteProperties withCondition(String condition) { + this.condition = condition; + return this; + } + + /** + * Get the list of endpoints to which the messages that satisfy the condition are routed to. Currently only 1 endpoint is allowed. + * + * @return the endpointNames value + */ + public List endpointNames() { + return this.endpointNames; + } + + /** + * Set the list of endpoints to which the messages that satisfy the condition are routed to. Currently only 1 endpoint is allowed. + * + * @param endpointNames the endpointNames value to set + * @return the FallbackRouteProperties object itself. + */ + public FallbackRouteProperties withEndpointNames(List endpointNames) { + this.endpointNames = endpointNames; + return this; + } + + /** + * Get used to specify whether the fallback route is enabled. + * + * @return the isEnabled value + */ + public boolean isEnabled() { + return this.isEnabled; + } + + /** + * Set used to specify whether the fallback route is enabled. + * + * @param isEnabled the isEnabled value to set + * @return the FallbackRouteProperties object itself. + */ + public FallbackRouteProperties withIsEnabled(boolean isEnabled) { + this.isEnabled = isEnabled; + return this; + } + +} diff --git a/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/FeedbackProperties.java b/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/FeedbackProperties.java new file mode 100644 index 0000000000000..7cbc517e77968 --- /dev/null +++ b/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/FeedbackProperties.java @@ -0,0 +1,101 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.iothub.v2020_03_01; + +import org.joda.time.Period; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The properties of the feedback queue for cloud-to-device messages. + */ +public class FeedbackProperties { + /** + * The lock duration for the feedback queue. See: + * https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-messaging#cloud-to-device-messages. + */ + @JsonProperty(value = "lockDurationAsIso8601") + private Period lockDurationAsIso8601; + + /** + * The period of time for which a message is available to consume before it + * is expired by the IoT hub. See: + * https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-messaging#cloud-to-device-messages. + */ + @JsonProperty(value = "ttlAsIso8601") + private Period ttlAsIso8601; + + /** + * The number of times the IoT hub attempts to deliver a message on the + * feedback queue. See: + * https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-messaging#cloud-to-device-messages. + */ + @JsonProperty(value = "maxDeliveryCount") + private Integer maxDeliveryCount; + + /** + * Get the lock duration for the feedback queue. See: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-messaging#cloud-to-device-messages. + * + * @return the lockDurationAsIso8601 value + */ + public Period lockDurationAsIso8601() { + return this.lockDurationAsIso8601; + } + + /** + * Set the lock duration for the feedback queue. See: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-messaging#cloud-to-device-messages. + * + * @param lockDurationAsIso8601 the lockDurationAsIso8601 value to set + * @return the FeedbackProperties object itself. + */ + public FeedbackProperties withLockDurationAsIso8601(Period lockDurationAsIso8601) { + this.lockDurationAsIso8601 = lockDurationAsIso8601; + return this; + } + + /** + * Get the period of time for which a message is available to consume before it is expired by the IoT hub. See: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-messaging#cloud-to-device-messages. + * + * @return the ttlAsIso8601 value + */ + public Period ttlAsIso8601() { + return this.ttlAsIso8601; + } + + /** + * Set the period of time for which a message is available to consume before it is expired by the IoT hub. See: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-messaging#cloud-to-device-messages. + * + * @param ttlAsIso8601 the ttlAsIso8601 value to set + * @return the FeedbackProperties object itself. + */ + public FeedbackProperties withTtlAsIso8601(Period ttlAsIso8601) { + this.ttlAsIso8601 = ttlAsIso8601; + return this; + } + + /** + * Get the number of times the IoT hub attempts to deliver a message on the feedback queue. See: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-messaging#cloud-to-device-messages. + * + * @return the maxDeliveryCount value + */ + public Integer maxDeliveryCount() { + return this.maxDeliveryCount; + } + + /** + * Set the number of times the IoT hub attempts to deliver a message on the feedback queue. See: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-messaging#cloud-to-device-messages. + * + * @param maxDeliveryCount the maxDeliveryCount value to set + * @return the FeedbackProperties object itself. + */ + public FeedbackProperties withMaxDeliveryCount(Integer maxDeliveryCount) { + this.maxDeliveryCount = maxDeliveryCount; + return this; + } + +} diff --git a/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/GroupIdInformation.java b/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/GroupIdInformation.java new file mode 100644 index 0000000000000..06bb482cdf7dc --- /dev/null +++ b/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/GroupIdInformation.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.iothub.v2020_03_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.iothub.v2020_03_01.implementation.GroupIdInformationInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.iothub.v2020_03_01.implementation.DevicesManager; + +/** + * Type representing GroupIdInformation. + */ +public interface GroupIdInformation extends HasInner, Indexable, Refreshable, HasManager { + /** + * @return the id value. + */ + String id(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the properties value. + */ + GroupIdInformationProperties properties(); + + /** + * @return the type value. + */ + String type(); + +} diff --git a/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/GroupIdInformationProperties.java b/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/GroupIdInformationProperties.java new file mode 100644 index 0000000000000..c307aab62be6a --- /dev/null +++ b/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_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.iothub.v2020_03_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/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/ImportDevicesRequest.java b/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/ImportDevicesRequest.java new file mode 100644 index 0000000000000..c99b5e627e75e --- /dev/null +++ b/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/ImportDevicesRequest.java @@ -0,0 +1,150 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.iothub.v2020_03_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Use to provide parameters when requesting an import of all devices in the + * hub. + */ +public class ImportDevicesRequest { + /** + * The input blob container URI. + */ + @JsonProperty(value = "inputBlobContainerUri", required = true) + private String inputBlobContainerUri; + + /** + * The output blob container URI. + */ + @JsonProperty(value = "outputBlobContainerUri", required = true) + private String outputBlobContainerUri; + + /** + * The blob name to be used when importing from the provided input blob + * container. + */ + @JsonProperty(value = "inputBlobName") + private String inputBlobName; + + /** + * The blob name to use for storing the status of the import job. + */ + @JsonProperty(value = "outputBlobName") + private String outputBlobName; + + /** + * Specifies authentication type being used for connecting to the storage + * account. Possible values include: 'keyBased', 'identityBased'. + */ + @JsonProperty(value = "authenticationType") + private AuthenticationType authenticationType; + + /** + * Get the input blob container URI. + * + * @return the inputBlobContainerUri value + */ + public String inputBlobContainerUri() { + return this.inputBlobContainerUri; + } + + /** + * Set the input blob container URI. + * + * @param inputBlobContainerUri the inputBlobContainerUri value to set + * @return the ImportDevicesRequest object itself. + */ + public ImportDevicesRequest withInputBlobContainerUri(String inputBlobContainerUri) { + this.inputBlobContainerUri = inputBlobContainerUri; + return this; + } + + /** + * Get the output blob container URI. + * + * @return the outputBlobContainerUri value + */ + public String outputBlobContainerUri() { + return this.outputBlobContainerUri; + } + + /** + * Set the output blob container URI. + * + * @param outputBlobContainerUri the outputBlobContainerUri value to set + * @return the ImportDevicesRequest object itself. + */ + public ImportDevicesRequest withOutputBlobContainerUri(String outputBlobContainerUri) { + this.outputBlobContainerUri = outputBlobContainerUri; + return this; + } + + /** + * Get the blob name to be used when importing from the provided input blob container. + * + * @return the inputBlobName value + */ + public String inputBlobName() { + return this.inputBlobName; + } + + /** + * Set the blob name to be used when importing from the provided input blob container. + * + * @param inputBlobName the inputBlobName value to set + * @return the ImportDevicesRequest object itself. + */ + public ImportDevicesRequest withInputBlobName(String inputBlobName) { + this.inputBlobName = inputBlobName; + return this; + } + + /** + * Get the blob name to use for storing the status of the import job. + * + * @return the outputBlobName value + */ + public String outputBlobName() { + return this.outputBlobName; + } + + /** + * Set the blob name to use for storing the status of the import job. + * + * @param outputBlobName the outputBlobName value to set + * @return the ImportDevicesRequest object itself. + */ + public ImportDevicesRequest withOutputBlobName(String outputBlobName) { + this.outputBlobName = outputBlobName; + return this; + } + + /** + * Get specifies authentication type being used for connecting to the storage account. Possible values include: 'keyBased', 'identityBased'. + * + * @return the authenticationType value + */ + public AuthenticationType authenticationType() { + return this.authenticationType; + } + + /** + * Set specifies authentication type being used for connecting to the storage account. Possible values include: 'keyBased', 'identityBased'. + * + * @param authenticationType the authenticationType value to set + * @return the ImportDevicesRequest object itself. + */ + public ImportDevicesRequest withAuthenticationType(AuthenticationType authenticationType) { + this.authenticationType = authenticationType; + return this; + } + +} diff --git a/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/IotHubCapacity.java b/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/IotHubCapacity.java new file mode 100644 index 0000000000000..d1190cabc0531 --- /dev/null +++ b/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/IotHubCapacity.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.iothub.v2020_03_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * IoT Hub capacity information. + */ +public class IotHubCapacity { + /** + * The minimum number of units. + */ + @JsonProperty(value = "minimum", access = JsonProperty.Access.WRITE_ONLY) + private Long minimum; + + /** + * The maximum number of units. + */ + @JsonProperty(value = "maximum", access = JsonProperty.Access.WRITE_ONLY) + private Long maximum; + + /** + * The default number of units. + */ + @JsonProperty(value = "default", access = JsonProperty.Access.WRITE_ONLY) + private Long defaultProperty; + + /** + * The type of the scaling enabled. Possible values include: 'Automatic', + * 'Manual', 'None'. + */ + @JsonProperty(value = "scaleType", access = JsonProperty.Access.WRITE_ONLY) + private IotHubScaleType scaleType; + + /** + * Get the minimum number of units. + * + * @return the minimum value + */ + public Long minimum() { + return this.minimum; + } + + /** + * Get the maximum number of units. + * + * @return the maximum value + */ + public Long maximum() { + return this.maximum; + } + + /** + * Get the default number of units. + * + * @return the defaultProperty value + */ + public Long defaultProperty() { + return this.defaultProperty; + } + + /** + * Get the type of the scaling enabled. Possible values include: 'Automatic', 'Manual', 'None'. + * + * @return the scaleType value + */ + public IotHubScaleType scaleType() { + return this.scaleType; + } + +} diff --git a/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/IotHubDescription.java b/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/IotHubDescription.java new file mode 100644 index 0000000000000..0865d65eff2cb --- /dev/null +++ b/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/IotHubDescription.java @@ -0,0 +1,167 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.iothub.v2020_03_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.Resource; +import com.microsoft.azure.arm.resources.models.GroupableResourceCore; +import com.microsoft.azure.arm.resources.models.HasResourceGroup; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.iothub.v2020_03_01.implementation.DevicesManager; +import com.microsoft.azure.management.iothub.v2020_03_01.implementation.IotHubDescriptionInner; + +/** + * Type representing IotHubDescription. + */ +public interface IotHubDescription extends HasInner, Resource, GroupableResourceCore, HasResourceGroup, Refreshable, Updatable, HasManager { + /** + * @return the etag value. + */ + String etag(); + + /** + * @return the properties value. + */ + IotHubProperties properties(); + + /** + * @return the sku value. + */ + IotHubSkuInfo sku(); + + /** + * The entirety of the IotHubDescription definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithGroup, DefinitionStages.WithIfMatch, DefinitionStages.WithSku, DefinitionStages.WithCreate { + } + + /** + * Grouping of IotHubDescription definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a IotHubDescription definition. + */ + interface Blank extends GroupableResourceCore.DefinitionWithRegion { + } + + /** + * The stage of the IotHubDescription definition allowing to specify the resource group. + */ + interface WithGroup extends GroupableResourceCore.DefinitionStages.WithGroup { + } + + /** + * The stage of the iothubdescription definition allowing to specify IfMatch. + */ + interface WithIfMatch { + /** + * Specifies ifMatch. + * @param ifMatch ETag of the IoT Hub. Do not specify for creating a brand new IoT Hub. Required to update an existing IoT Hub + * @return the next definition stage +*/ + WithSku withIfMatch(String ifMatch); + } + + /** + * The stage of the iothubdescription definition allowing to specify Sku. + */ + interface WithSku { + /** + * Specifies sku. + * @param sku IotHub SKU info + * @return the next definition stage +*/ + WithCreate withSku(IotHubSkuInfo sku); + } + + /** + * The stage of the iothubdescription definition allowing to specify Etag. + */ + interface WithEtag { + /** + * Specifies etag. + * @param etag The Etag field is *not* required. If it is provided in the response body, it must also be provided as a header per the normal ETag convention + * @return the next definition stage + */ + WithCreate withEtag(String etag); + } + + /** + * The stage of the iothubdescription definition allowing to specify Properties. + */ + interface WithProperties { + /** + * Specifies properties. + * @param properties IotHub properties + * @return the next definition stage + */ + WithCreate withProperties(IotHubProperties properties); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, Resource.DefinitionWithTags, DefinitionStages.WithEtag, DefinitionStages.WithProperties { + } + } + /** + * The template for a IotHubDescription update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, Resource.UpdateWithTags, UpdateStages.WithIfMatch, UpdateStages.WithEtag, UpdateStages.WithProperties { + } + + /** + * Grouping of IotHubDescription update stages. + */ + interface UpdateStages { + /** + * The stage of the iothubdescription update allowing to specify IfMatch. + */ + interface WithIfMatch { + /** + * Specifies ifMatch. + * @param ifMatch ETag of the IoT Hub. Do not specify for creating a brand new IoT Hub. Required to update an existing IoT Hub + * @return the next update stage + */ + Update withIfMatch(String ifMatch); + } + + /** + * The stage of the iothubdescription update allowing to specify Etag. + */ + interface WithEtag { + /** + * Specifies etag. + * @param etag The Etag field is *not* required. If it is provided in the response body, it must also be provided as a header per the normal ETag convention + * @return the next update stage + */ + Update withEtag(String etag); + } + + /** + * The stage of the iothubdescription update allowing to specify Properties. + */ + interface WithProperties { + /** + * Specifies properties. + * @param properties IotHub properties + * @return the next update stage + */ + Update withProperties(IotHubProperties properties); + } + + } +} diff --git a/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/IotHubLocationDescription.java b/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/IotHubLocationDescription.java new file mode 100644 index 0000000000000..ef52792405263 --- /dev/null +++ b/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/IotHubLocationDescription.java @@ -0,0 +1,74 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.iothub.v2020_03_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Public representation of one of the locations where a resource is + * provisioned. + */ +public class IotHubLocationDescription { + /** + * The name of the Azure region. + */ + @JsonProperty(value = "location") + private String location; + + /** + * The role of the region, can be either primary or secondary. The primary + * region is where the IoT hub is currently provisioned. The secondary + * region is the Azure disaster recovery (DR) paired region and also the + * region where the IoT hub can failover to. Possible values include: + * 'primary', 'secondary'. + */ + @JsonProperty(value = "role") + private IotHubReplicaRoleType role; + + /** + * Get the name of the Azure region. + * + * @return the location value + */ + public String location() { + return this.location; + } + + /** + * Set the name of the Azure region. + * + * @param location the location value to set + * @return the IotHubLocationDescription object itself. + */ + public IotHubLocationDescription withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get the role of the region, can be either primary or secondary. The primary region is where the IoT hub is currently provisioned. The secondary region is the Azure disaster recovery (DR) paired region and also the region where the IoT hub can failover to. Possible values include: 'primary', 'secondary'. + * + * @return the role value + */ + public IotHubReplicaRoleType role() { + return this.role; + } + + /** + * Set the role of the region, can be either primary or secondary. The primary region is where the IoT hub is currently provisioned. The secondary region is the Azure disaster recovery (DR) paired region and also the region where the IoT hub can failover to. Possible values include: 'primary', 'secondary'. + * + * @param role the role value to set + * @return the IotHubLocationDescription object itself. + */ + public IotHubLocationDescription withRole(IotHubReplicaRoleType role) { + this.role = role; + return this; + } + +} diff --git a/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/IotHubNameAvailabilityInfo.java b/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/IotHubNameAvailabilityInfo.java new file mode 100644 index 0000000000000..ac6bb55ba33ba --- /dev/null +++ b/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/IotHubNameAvailabilityInfo.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.iothub.v2020_03_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.iothub.v2020_03_01.implementation.DevicesManager; +import com.microsoft.azure.management.iothub.v2020_03_01.implementation.IotHubNameAvailabilityInfoInner; + +/** + * Type representing IotHubNameAvailabilityInfo. + */ +public interface IotHubNameAvailabilityInfo extends HasInner, HasManager { + /** + * @return the message value. + */ + String message(); + + /** + * @return the nameAvailable value. + */ + Boolean nameAvailable(); + + /** + * @return the reason value. + */ + IotHubNameUnavailabilityReason reason(); + +} diff --git a/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/IotHubNameUnavailabilityReason.java b/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/IotHubNameUnavailabilityReason.java new file mode 100644 index 0000000000000..d911330fa8f7b --- /dev/null +++ b/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/IotHubNameUnavailabilityReason.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.iothub.v2020_03_01; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for IotHubNameUnavailabilityReason. + */ +public enum IotHubNameUnavailabilityReason { + /** Enum value Invalid. */ + INVALID("Invalid"), + + /** Enum value AlreadyExists. */ + ALREADY_EXISTS("AlreadyExists"); + + /** The actual serialized value for a IotHubNameUnavailabilityReason instance. */ + private String value; + + IotHubNameUnavailabilityReason(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a IotHubNameUnavailabilityReason instance. + * + * @param value the serialized value to parse. + * @return the parsed IotHubNameUnavailabilityReason object, or null if unable to parse. + */ + @JsonCreator + public static IotHubNameUnavailabilityReason fromString(String value) { + IotHubNameUnavailabilityReason[] items = IotHubNameUnavailabilityReason.values(); + for (IotHubNameUnavailabilityReason item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/IotHubProperties.java b/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/IotHubProperties.java new file mode 100644 index 0000000000000..56eff20bf5b72 --- /dev/null +++ b/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/IotHubProperties.java @@ -0,0 +1,431 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.iothub.v2020_03_01; + +import java.util.List; +import com.microsoft.azure.management.iothub.v2020_03_01.implementation.SharedAccessSignatureAuthorizationRuleInner; +import com.microsoft.azure.management.iothub.v2020_03_01.implementation.PrivateEndpointConnectionInner; +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The properties of an IoT hub. + */ +public class IotHubProperties { + /** + * The shared access policies you can use to secure a connection to the IoT + * hub. + */ + @JsonProperty(value = "authorizationPolicies") + private List authorizationPolicies; + + /** + * Whether requests from Public Network are allowed. Possible values + * include: 'Enabled', 'Disabled'. + */ + @JsonProperty(value = "publicNetworkAccess") + private PublicNetworkAccess publicNetworkAccess; + + /** + * The IP filter rules. + */ + @JsonProperty(value = "ipFilterRules") + private List ipFilterRules; + + /** + * Specifies the minimum TLS version to support for this hub. Can be set to + * "1.2" to have clients that use a TLS version below 1.2 to be rejected. + */ + @JsonProperty(value = "minTlsVersion") + private String minTlsVersion; + + /** + * Private endpoint connections created on this IotHub. + */ + @JsonProperty(value = "privateEndpointConnections") + private List privateEndpointConnections; + + /** + * The provisioning state. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /** + * The hub state. + */ + @JsonProperty(value = "state", access = JsonProperty.Access.WRITE_ONLY) + private String state; + + /** + * The name of the host. + */ + @JsonProperty(value = "hostName", access = JsonProperty.Access.WRITE_ONLY) + private String hostName; + + /** + * The Event Hub-compatible endpoint properties. The only possible keys to + * this dictionary is events. This key has to be present in the dictionary + * while making create or update calls for the IoT hub. + */ + @JsonProperty(value = "eventHubEndpoints") + private Map eventHubEndpoints; + + /** + * The routing property. + */ + @JsonProperty(value = "routing") + private RoutingProperties routing; + + /** + * The list of Azure Storage endpoints where you can upload files. + * Currently you can configure only one Azure Storage account and that MUST + * have its key as $default. Specifying more than one storage account + * causes an error to be thrown. Not specifying a value for this property + * when the enableFileUploadNotifications property is set to True, causes + * an error to be thrown. + */ + @JsonProperty(value = "storageEndpoints") + private Map storageEndpoints; + + /** + * The messaging endpoint properties for the file upload notification + * queue. + */ + @JsonProperty(value = "messagingEndpoints") + private Map messagingEndpoints; + + /** + * If True, file upload notifications are enabled. + */ + @JsonProperty(value = "enableFileUploadNotifications") + private Boolean enableFileUploadNotifications; + + /** + * The cloudToDevice property. + */ + @JsonProperty(value = "cloudToDevice") + private CloudToDeviceProperties cloudToDevice; + + /** + * IoT hub comments. + */ + @JsonProperty(value = "comments") + private String comments; + + /** + * The capabilities and features enabled for the IoT hub. Possible values + * include: 'None', 'DeviceManagement'. + */ + @JsonProperty(value = "features") + private Capabilities features; + + /** + * Primary and secondary location for iot hub. + */ + @JsonProperty(value = "locations", access = JsonProperty.Access.WRITE_ONLY) + private List locations; + + /** + * Get the shared access policies you can use to secure a connection to the IoT hub. + * + * @return the authorizationPolicies value + */ + public List authorizationPolicies() { + return this.authorizationPolicies; + } + + /** + * Set the shared access policies you can use to secure a connection to the IoT hub. + * + * @param authorizationPolicies the authorizationPolicies value to set + * @return the IotHubProperties object itself. + */ + public IotHubProperties withAuthorizationPolicies(List authorizationPolicies) { + this.authorizationPolicies = authorizationPolicies; + return this; + } + + /** + * Get whether requests from Public Network are allowed. Possible values include: 'Enabled', 'Disabled'. + * + * @return the publicNetworkAccess value + */ + public PublicNetworkAccess publicNetworkAccess() { + return this.publicNetworkAccess; + } + + /** + * Set whether requests from Public Network are allowed. Possible values include: 'Enabled', 'Disabled'. + * + * @param publicNetworkAccess the publicNetworkAccess value to set + * @return the IotHubProperties object itself. + */ + public IotHubProperties withPublicNetworkAccess(PublicNetworkAccess publicNetworkAccess) { + this.publicNetworkAccess = publicNetworkAccess; + return this; + } + + /** + * Get the IP filter rules. + * + * @return the ipFilterRules value + */ + public List ipFilterRules() { + return this.ipFilterRules; + } + + /** + * Set the IP filter rules. + * + * @param ipFilterRules the ipFilterRules value to set + * @return the IotHubProperties object itself. + */ + public IotHubProperties withIpFilterRules(List ipFilterRules) { + this.ipFilterRules = ipFilterRules; + return this; + } + + /** + * Get specifies the minimum TLS version to support for this hub. Can be set to "1.2" to have clients that use a TLS version below 1.2 to be rejected. + * + * @return the minTlsVersion value + */ + public String minTlsVersion() { + return this.minTlsVersion; + } + + /** + * Set specifies the minimum TLS version to support for this hub. Can be set to "1.2" to have clients that use a TLS version below 1.2 to be rejected. + * + * @param minTlsVersion the minTlsVersion value to set + * @return the IotHubProperties object itself. + */ + public IotHubProperties withMinTlsVersion(String minTlsVersion) { + this.minTlsVersion = minTlsVersion; + return this; + } + + /** + * Get private endpoint connections created on this IotHub. + * + * @return the privateEndpointConnections value + */ + public List privateEndpointConnections() { + return this.privateEndpointConnections; + } + + /** + * Set private endpoint connections created on this IotHub. + * + * @param privateEndpointConnections the privateEndpointConnections value to set + * @return the IotHubProperties object itself. + */ + public IotHubProperties withPrivateEndpointConnections(List privateEndpointConnections) { + this.privateEndpointConnections = privateEndpointConnections; + return this; + } + + /** + * Get the provisioning state. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get the hub state. + * + * @return the state value + */ + public String state() { + return this.state; + } + + /** + * Get the name of the host. + * + * @return the hostName value + */ + public String hostName() { + return this.hostName; + } + + /** + * Get the Event Hub-compatible endpoint properties. The only possible keys to this dictionary is events. This key has to be present in the dictionary while making create or update calls for the IoT hub. + * + * @return the eventHubEndpoints value + */ + public Map eventHubEndpoints() { + return this.eventHubEndpoints; + } + + /** + * Set the Event Hub-compatible endpoint properties. The only possible keys to this dictionary is events. This key has to be present in the dictionary while making create or update calls for the IoT hub. + * + * @param eventHubEndpoints the eventHubEndpoints value to set + * @return the IotHubProperties object itself. + */ + public IotHubProperties withEventHubEndpoints(Map eventHubEndpoints) { + this.eventHubEndpoints = eventHubEndpoints; + return this; + } + + /** + * Get the routing value. + * + * @return the routing value + */ + public RoutingProperties routing() { + return this.routing; + } + + /** + * Set the routing value. + * + * @param routing the routing value to set + * @return the IotHubProperties object itself. + */ + public IotHubProperties withRouting(RoutingProperties routing) { + this.routing = routing; + return this; + } + + /** + * Get the list of Azure Storage endpoints where you can upload files. Currently you can configure only one Azure Storage account and that MUST have its key as $default. Specifying more than one storage account causes an error to be thrown. Not specifying a value for this property when the enableFileUploadNotifications property is set to True, causes an error to be thrown. + * + * @return the storageEndpoints value + */ + public Map storageEndpoints() { + return this.storageEndpoints; + } + + /** + * Set the list of Azure Storage endpoints where you can upload files. Currently you can configure only one Azure Storage account and that MUST have its key as $default. Specifying more than one storage account causes an error to be thrown. Not specifying a value for this property when the enableFileUploadNotifications property is set to True, causes an error to be thrown. + * + * @param storageEndpoints the storageEndpoints value to set + * @return the IotHubProperties object itself. + */ + public IotHubProperties withStorageEndpoints(Map storageEndpoints) { + this.storageEndpoints = storageEndpoints; + return this; + } + + /** + * Get the messaging endpoint properties for the file upload notification queue. + * + * @return the messagingEndpoints value + */ + public Map messagingEndpoints() { + return this.messagingEndpoints; + } + + /** + * Set the messaging endpoint properties for the file upload notification queue. + * + * @param messagingEndpoints the messagingEndpoints value to set + * @return the IotHubProperties object itself. + */ + public IotHubProperties withMessagingEndpoints(Map messagingEndpoints) { + this.messagingEndpoints = messagingEndpoints; + return this; + } + + /** + * Get if True, file upload notifications are enabled. + * + * @return the enableFileUploadNotifications value + */ + public Boolean enableFileUploadNotifications() { + return this.enableFileUploadNotifications; + } + + /** + * Set if True, file upload notifications are enabled. + * + * @param enableFileUploadNotifications the enableFileUploadNotifications value to set + * @return the IotHubProperties object itself. + */ + public IotHubProperties withEnableFileUploadNotifications(Boolean enableFileUploadNotifications) { + this.enableFileUploadNotifications = enableFileUploadNotifications; + return this; + } + + /** + * Get the cloudToDevice value. + * + * @return the cloudToDevice value + */ + public CloudToDeviceProperties cloudToDevice() { + return this.cloudToDevice; + } + + /** + * Set the cloudToDevice value. + * + * @param cloudToDevice the cloudToDevice value to set + * @return the IotHubProperties object itself. + */ + public IotHubProperties withCloudToDevice(CloudToDeviceProperties cloudToDevice) { + this.cloudToDevice = cloudToDevice; + return this; + } + + /** + * Get ioT hub comments. + * + * @return the comments value + */ + public String comments() { + return this.comments; + } + + /** + * Set ioT hub comments. + * + * @param comments the comments value to set + * @return the IotHubProperties object itself. + */ + public IotHubProperties withComments(String comments) { + this.comments = comments; + return this; + } + + /** + * Get the capabilities and features enabled for the IoT hub. Possible values include: 'None', 'DeviceManagement'. + * + * @return the features value + */ + public Capabilities features() { + return this.features; + } + + /** + * Set the capabilities and features enabled for the IoT hub. Possible values include: 'None', 'DeviceManagement'. + * + * @param features the features value to set + * @return the IotHubProperties object itself. + */ + public IotHubProperties withFeatures(Capabilities features) { + this.features = features; + return this; + } + + /** + * Get primary and secondary location for iot hub. + * + * @return the locations value + */ + public List locations() { + return this.locations; + } + +} diff --git a/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/IotHubQuotaMetricInfo.java b/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/IotHubQuotaMetricInfo.java new file mode 100644 index 0000000000000..898d051da6f44 --- /dev/null +++ b/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/IotHubQuotaMetricInfo.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.iothub.v2020_03_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.iothub.v2020_03_01.implementation.IotHubQuotaMetricInfoInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.iothub.v2020_03_01.implementation.DevicesManager; + +/** + * Type representing IotHubQuotaMetricInfo. + */ +public interface IotHubQuotaMetricInfo extends HasInner, HasManager { + /** + * @return the currentValue value. + */ + Long currentValue(); + + /** + * @return the maxValue value. + */ + Long maxValue(); + + /** + * @return the name value. + */ + String name(); + +} diff --git a/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/IotHubReplicaRoleType.java b/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/IotHubReplicaRoleType.java new file mode 100644 index 0000000000000..f6f1ec8c90e2a --- /dev/null +++ b/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/IotHubReplicaRoleType.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.iothub.v2020_03_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for IotHubReplicaRoleType. + */ +public final class IotHubReplicaRoleType extends ExpandableStringEnum { + /** Static value primary for IotHubReplicaRoleType. */ + public static final IotHubReplicaRoleType PRIMARY = fromString("primary"); + + /** Static value secondary for IotHubReplicaRoleType. */ + public static final IotHubReplicaRoleType SECONDARY = fromString("secondary"); + + /** + * Creates or finds a IotHubReplicaRoleType from its string representation. + * @param name a name to look for + * @return the corresponding IotHubReplicaRoleType + */ + @JsonCreator + public static IotHubReplicaRoleType fromString(String name) { + return fromString(name, IotHubReplicaRoleType.class); + } + + /** + * @return known IotHubReplicaRoleType values + */ + public static Collection values() { + return values(IotHubReplicaRoleType.class); + } +} diff --git a/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/IotHubResources.java b/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/IotHubResources.java new file mode 100644 index 0000000000000..a378a81f97b67 --- /dev/null +++ b/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/IotHubResources.java @@ -0,0 +1,264 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.iothub.v2020_03_01; + +import rx.Observable; +import com.microsoft.azure.management.iothub.v2020_03_01.IotHubDescription; +import rx.Completable; +import com.microsoft.azure.management.iothub.v2020_03_01.IotHubSkuDescription; +import com.microsoft.azure.management.iothub.v2020_03_01.EventHubConsumerGroupInfo; +import com.microsoft.azure.management.iothub.v2020_03_01.JobResponse; +import com.microsoft.azure.management.iothub.v2020_03_01.IotHubQuotaMetricInfo; + +/** + * Type representing IotHubResources. + */ +public interface IotHubResources { + /** + * Begins definition for a new IotHub resource. + * @param name resource name. + * @return the first stage of the new IotHub definition. + */ + IotHubDescription.DefinitionStages.Blank defineIotHub(String name); + + /** + * Begins definition for a new ConsumerGroup resource. + * @param name resource name. + * @return the first stage of the new ConsumerGroup definition. + */ + EventHubConsumerGroupInfo.DefinitionStages.Blank defineConsumerGroup(String name); + + /** + * Get the non-security related metadata of an IoT hub. + * Get the non-security related metadata of an IoT hub. + * + * @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 IoT hubs in a resource group. + * Get all the IoT hubs 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 IoT hubs in a subscription. + * Get all the IoT hubs in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(); + + /** + * Delete an IoT hub. + * Delete an IoT hub. + * + * @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); + + /** + * Get the health for routing endpoints. + * Get the health for routing endpoints. + * + * @param resourceGroupName the String value + * @param iotHubName the String value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getEndpointHealthAsync(final String resourceGroupName, final String iotHubName); + + /** + * Get the security metadata for an IoT hub. For more information, see: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-security. + * Get the security metadata for an IoT hub. For more information, see: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-security. + * + * @param resourceGroupName The name of the resource group that contains the IoT hub. + * @param resourceName The name of the IoT hub. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listKeysAsync(final String resourceGroupName, final String resourceName); + + /** + * Exports all the device identities in the IoT hub identity registry to an Azure Storage blob container. For more information, see: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry#import-and-export-device-identities. + * Exports all the device identities in the IoT hub identity registry to an Azure Storage blob container. For more information, see: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry#import-and-export-device-identities. + * + * @param resourceGroupName The name of the resource group that contains the IoT hub. + * @param resourceName The name of the IoT hub. + * @param exportDevicesParameters The parameters that specify the export devices operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable exportDevicesAsync(String resourceGroupName, String resourceName, ExportDevicesRequest exportDevicesParameters); + + /** + * Import, update, or delete device identities in the IoT hub identity registry from a blob. For more information, see: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry#import-and-export-device-identities. + * Import, update, or delete device identities in the IoT hub identity registry from a blob. For more information, see: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry#import-and-export-device-identities. + * + * @param resourceGroupName The name of the resource group that contains the IoT hub. + * @param resourceName The name of the IoT hub. + * @param importDevicesParameters The parameters that specify the import devices operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable importDevicesAsync(String resourceGroupName, String resourceName, ImportDevicesRequest importDevicesParameters); + + /** + * Check if an IoT hub name is available. + * Check if an IoT hub name is available. + * + * @param name The name of the IoT hub to check. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable checkNameAvailabilityAsync(String name); + + /** + * Get the statistics from an IoT hub. + * Get the statistics from an IoT hub. + * + * @param resourceGroupName The name of the resource group that contains the IoT hub. + * @param resourceName The name of the IoT hub. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getStatsAsync(String resourceGroupName, String resourceName); + + /** + * Get the list of valid SKUs for an IoT hub. + * Get the list of valid SKUs for an IoT hub. + * + * @param resourceGroupName The name of the resource group that contains the IoT hub. + * @param resourceName The name of the IoT hub. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getValidSkusAsync(final String resourceGroupName, final String resourceName); + + /** + * Get a consumer group from the Event Hub-compatible device-to-cloud endpoint for an IoT hub. + * Get a consumer group from the Event Hub-compatible device-to-cloud endpoint for an IoT hub. + * + * @param resourceGroupName The name of the resource group that contains the IoT hub. + * @param resourceName The name of the IoT hub. + * @param eventHubEndpointName The name of the Event Hub-compatible endpoint in the IoT hub. + * @param name The name of the consumer group to retrieve. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getEventHubConsumerGroupAsync(String resourceGroupName, String resourceName, String eventHubEndpointName, String name); + + /** + * Get a list of the consumer groups in the Event Hub-compatible device-to-cloud endpoint in an IoT hub. + * Get a list of the consumer groups in the Event Hub-compatible device-to-cloud endpoint in an IoT hub. + * + * @param resourceGroupName The name of the resource group that contains the IoT hub. + * @param resourceName The name of the IoT hub. + * @param eventHubEndpointName The name of the Event Hub-compatible endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listEventHubConsumerGroupsAsync(final String resourceGroupName, final String resourceName, final String eventHubEndpointName); + + /** + * Delete a consumer group from an Event Hub-compatible endpoint in an IoT hub. + * Delete a consumer group from an Event Hub-compatible endpoint in an IoT hub. + * + * @param resourceGroupName The name of the resource group that contains the IoT hub. + * @param resourceName The name of the IoT hub. + * @param eventHubEndpointName The name of the Event Hub-compatible endpoint in the IoT hub. + * @param name The name of the consumer group to delete. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable deleteEventHubConsumerGroupAsync(String resourceGroupName, String resourceName, String eventHubEndpointName, String name); + + /** + * Get the details of a job from an IoT hub. For more information, see: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry. + * Get the details of a job from an IoT hub. For more information, see: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry. + * + * @param resourceGroupName The name of the resource group that contains the IoT hub. + * @param resourceName The name of the IoT hub. + * @param jobId The job identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getJobAsync(String resourceGroupName, String resourceName, String jobId); + + /** + * Get a list of all the jobs in an IoT hub. For more information, see: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry. + * Get a list of all the jobs in an IoT hub. For more information, see: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry. + * + * @param resourceGroupName The name of the resource group that contains the IoT hub. + * @param resourceName The name of the IoT hub. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listJobsAsync(final String resourceGroupName, final String resourceName); + + /** + * Get the quota metrics for an IoT hub. + * Get the quota metrics for an IoT hub. + * + * @param resourceGroupName The name of the resource group that contains the IoT hub. + * @param resourceName The name of the IoT hub. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getQuotaMetricsAsync(final String resourceGroupName, final String resourceName); + + /** + * Test all routes. + * Test all routes configured in this Iot Hub. + * + * @param iotHubName IotHub to be tested + * @param resourceGroupName resource group which Iot Hub belongs to + * @param input Input for testing all routes + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable testAllRoutesAsync(String iotHubName, String resourceGroupName, TestAllRoutesInput input); + + /** + * Test the new route. + * Test the new route for this Iot Hub. + * + * @param iotHubName IotHub to be tested + * @param resourceGroupName resource group which Iot Hub belongs to + * @param input Route that needs to be tested + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable testRouteAsync(String iotHubName, String resourceGroupName, TestRouteInput input); + + /** + * Get a shared access policy by name from an IoT hub. For more information, see: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-security. + * Get a shared access policy by name from an IoT hub. For more information, see: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-security. + * + * @param resourceGroupName The name of the resource group that contains the IoT hub. + * @param resourceName The name of the IoT hub. + * @param keyName The name of the shared access policy. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getKeysForKeyNameAsync(String resourceGroupName, String resourceName, String keyName); + +} diff --git a/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/IotHubScaleType.java b/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/IotHubScaleType.java new file mode 100644 index 0000000000000..94cf868376e17 --- /dev/null +++ b/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/IotHubScaleType.java @@ -0,0 +1,56 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.iothub.v2020_03_01; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for IotHubScaleType. + */ +public enum IotHubScaleType { + /** Enum value Automatic. */ + AUTOMATIC("Automatic"), + + /** Enum value Manual. */ + MANUAL("Manual"), + + /** Enum value None. */ + NONE("None"); + + /** The actual serialized value for a IotHubScaleType instance. */ + private String value; + + IotHubScaleType(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a IotHubScaleType instance. + * + * @param value the serialized value to parse. + * @return the parsed IotHubScaleType object, or null if unable to parse. + */ + @JsonCreator + public static IotHubScaleType fromString(String value) { + IotHubScaleType[] items = IotHubScaleType.values(); + for (IotHubScaleType item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/IotHubSku.java b/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/IotHubSku.java new file mode 100644 index 0000000000000..1e1efc825f4be --- /dev/null +++ b/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/IotHubSku.java @@ -0,0 +1,56 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.iothub.v2020_03_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for IotHubSku. + */ +public final class IotHubSku extends ExpandableStringEnum { + /** Static value F1 for IotHubSku. */ + public static final IotHubSku F1 = fromString("F1"); + + /** Static value S1 for IotHubSku. */ + public static final IotHubSku S1 = fromString("S1"); + + /** Static value S2 for IotHubSku. */ + public static final IotHubSku S2 = fromString("S2"); + + /** Static value S3 for IotHubSku. */ + public static final IotHubSku S3 = fromString("S3"); + + /** Static value B1 for IotHubSku. */ + public static final IotHubSku B1 = fromString("B1"); + + /** Static value B2 for IotHubSku. */ + public static final IotHubSku B2 = fromString("B2"); + + /** Static value B3 for IotHubSku. */ + public static final IotHubSku B3 = fromString("B3"); + + /** + * Creates or finds a IotHubSku from its string representation. + * @param name a name to look for + * @return the corresponding IotHubSku + */ + @JsonCreator + public static IotHubSku fromString(String name) { + return fromString(name, IotHubSku.class); + } + + /** + * @return known IotHubSku values + */ + public static Collection values() { + return values(IotHubSku.class); + } +} diff --git a/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/IotHubSkuDescription.java b/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/IotHubSkuDescription.java new file mode 100644 index 0000000000000..6525bbf9d83fc --- /dev/null +++ b/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/IotHubSkuDescription.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.iothub.v2020_03_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.iothub.v2020_03_01.implementation.IotHubSkuDescriptionInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.iothub.v2020_03_01.implementation.DevicesManager; + +/** + * Type representing IotHubSkuDescription. + */ +public interface IotHubSkuDescription extends HasInner, HasManager { + /** + * @return the capacity value. + */ + IotHubCapacity capacity(); + + /** + * @return the resourceType value. + */ + String resourceType(); + + /** + * @return the sku value. + */ + IotHubSkuInfo sku(); + +} diff --git a/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/IotHubSkuInfo.java b/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/IotHubSkuInfo.java new file mode 100644 index 0000000000000..0bb64204eeb30 --- /dev/null +++ b/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/IotHubSkuInfo.java @@ -0,0 +1,87 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.iothub.v2020_03_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Information about the SKU of the IoT hub. + */ +public class IotHubSkuInfo { + /** + * The name of the SKU. Possible values include: 'F1', 'S1', 'S2', 'S3', + * 'B1', 'B2', 'B3'. + */ + @JsonProperty(value = "name", required = true) + private IotHubSku name; + + /** + * The billing tier for the IoT hub. Possible values include: 'Free', + * 'Standard', 'Basic'. + */ + @JsonProperty(value = "tier", access = JsonProperty.Access.WRITE_ONLY) + private IotHubSkuTier tier; + + /** + * The number of provisioned IoT Hub units. See: + * https://docs.microsoft.com/azure/azure-subscription-service-limits#iot-hub-limits. + */ + @JsonProperty(value = "capacity") + private Long capacity; + + /** + * Get the name of the SKU. Possible values include: 'F1', 'S1', 'S2', 'S3', 'B1', 'B2', 'B3'. + * + * @return the name value + */ + public IotHubSku name() { + return this.name; + } + + /** + * Set the name of the SKU. Possible values include: 'F1', 'S1', 'S2', 'S3', 'B1', 'B2', 'B3'. + * + * @param name the name value to set + * @return the IotHubSkuInfo object itself. + */ + public IotHubSkuInfo withName(IotHubSku name) { + this.name = name; + return this; + } + + /** + * Get the billing tier for the IoT hub. Possible values include: 'Free', 'Standard', 'Basic'. + * + * @return the tier value + */ + public IotHubSkuTier tier() { + return this.tier; + } + + /** + * Get the number of provisioned IoT Hub units. See: https://docs.microsoft.com/azure/azure-subscription-service-limits#iot-hub-limits. + * + * @return the capacity value + */ + public Long capacity() { + return this.capacity; + } + + /** + * Set the number of provisioned IoT Hub units. See: https://docs.microsoft.com/azure/azure-subscription-service-limits#iot-hub-limits. + * + * @param capacity the capacity value to set + * @return the IotHubSkuInfo object itself. + */ + public IotHubSkuInfo withCapacity(Long capacity) { + this.capacity = capacity; + return this; + } + +} diff --git a/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/IotHubSkuTier.java b/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/IotHubSkuTier.java new file mode 100644 index 0000000000000..6b4852c229732 --- /dev/null +++ b/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/IotHubSkuTier.java @@ -0,0 +1,56 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.iothub.v2020_03_01; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for IotHubSkuTier. + */ +public enum IotHubSkuTier { + /** Enum value Free. */ + FREE("Free"), + + /** Enum value Standard. */ + STANDARD("Standard"), + + /** Enum value Basic. */ + BASIC("Basic"); + + /** The actual serialized value for a IotHubSkuTier instance. */ + private String value; + + IotHubSkuTier(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a IotHubSkuTier instance. + * + * @param value the serialized value to parse. + * @return the parsed IotHubSkuTier object, or null if unable to parse. + */ + @JsonCreator + public static IotHubSkuTier fromString(String value) { + IotHubSkuTier[] items = IotHubSkuTier.values(); + for (IotHubSkuTier item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/IotHubs.java b/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/IotHubs.java new file mode 100644 index 0000000000000..fb8763a035688 --- /dev/null +++ b/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/IotHubs.java @@ -0,0 +1,31 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.iothub.v2020_03_01; + +import rx.Completable; +import com.microsoft.azure.management.iothub.v2020_03_01.implementation.IotHubsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing IotHubs. + */ +public interface IotHubs extends HasInner { + /** + * Manually initiate a failover for the IoT Hub to its secondary region. + * Manually initiate a failover for the IoT Hub to its secondary region. To learn more, see https://aka.ms/manualfailover. + * + * @param iotHubName Name of the IoT hub to failover + * @param resourceGroupName Name of the resource group containing the IoT hub resource + * @param failoverRegion Region the hub will be failed over to + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable manualFailoverAsync(String iotHubName, String resourceGroupName, String failoverRegion); + +} diff --git a/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/IpFilterActionType.java b/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/IpFilterActionType.java new file mode 100644 index 0000000000000..c2dff2aaaf1c9 --- /dev/null +++ b/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/IpFilterActionType.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.iothub.v2020_03_01; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for IpFilterActionType. + */ +public enum IpFilterActionType { + /** Enum value Accept. */ + ACCEPT("Accept"), + + /** Enum value Reject. */ + REJECT("Reject"); + + /** The actual serialized value for a IpFilterActionType instance. */ + private String value; + + IpFilterActionType(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a IpFilterActionType instance. + * + * @param value the serialized value to parse. + * @return the parsed IpFilterActionType object, or null if unable to parse. + */ + @JsonCreator + public static IpFilterActionType fromString(String value) { + IpFilterActionType[] items = IpFilterActionType.values(); + for (IpFilterActionType item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/IpFilterRule.java b/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/IpFilterRule.java new file mode 100644 index 0000000000000..3fea13e03d90c --- /dev/null +++ b/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/IpFilterRule.java @@ -0,0 +1,97 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.iothub.v2020_03_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The IP filter rules for the IoT hub. + */ +public class IpFilterRule { + /** + * The name of the IP filter rule. + */ + @JsonProperty(value = "filterName", required = true) + private String filterName; + + /** + * The desired action for requests captured by this rule. Possible values + * include: 'Accept', 'Reject'. + */ + @JsonProperty(value = "action", required = true) + private IpFilterActionType action; + + /** + * A string that contains the IP address range in CIDR notation for the + * rule. + */ + @JsonProperty(value = "ipMask", required = true) + private String ipMask; + + /** + * Get the name of the IP filter rule. + * + * @return the filterName value + */ + public String filterName() { + return this.filterName; + } + + /** + * Set the name of the IP filter rule. + * + * @param filterName the filterName value to set + * @return the IpFilterRule object itself. + */ + public IpFilterRule withFilterName(String filterName) { + this.filterName = filterName; + return this; + } + + /** + * Get the desired action for requests captured by this rule. Possible values include: 'Accept', 'Reject'. + * + * @return the action value + */ + public IpFilterActionType action() { + return this.action; + } + + /** + * Set the desired action for requests captured by this rule. Possible values include: 'Accept', 'Reject'. + * + * @param action the action value to set + * @return the IpFilterRule object itself. + */ + public IpFilterRule withAction(IpFilterActionType action) { + this.action = action; + return this; + } + + /** + * Get a string that contains the IP address range in CIDR notation for the rule. + * + * @return the ipMask value + */ + public String ipMask() { + return this.ipMask; + } + + /** + * Set a string that contains the IP address range in CIDR notation for the rule. + * + * @param ipMask the ipMask value to set + * @return the IpFilterRule object itself. + */ + public IpFilterRule withIpMask(String ipMask) { + this.ipMask = ipMask; + return this; + } + +} diff --git a/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/JobResponse.java b/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/JobResponse.java new file mode 100644 index 0000000000000..218e63e16baac --- /dev/null +++ b/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/JobResponse.java @@ -0,0 +1,62 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.iothub.v2020_03_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.iothub.v2020_03_01.implementation.JobResponseInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.iothub.v2020_03_01.implementation.DevicesManager; +import com.microsoft.rest.DateTimeRfc1123; +import org.joda.time.DateTime; + +/** + * Type representing JobResponse. + */ +public interface JobResponse extends HasInner, HasManager { + /** + * @return the endTimeUtc value. + */ + DateTime endTimeUtc(); + + /** + * @return the failureReason value. + */ + String failureReason(); + + /** + * @return the jobId value. + */ + String jobId(); + + /** + * @return the parentJobId value. + */ + String parentJobId(); + + /** + * @return the startTimeUtc value. + */ + DateTime startTimeUtc(); + + /** + * @return the status value. + */ + JobStatus status(); + + /** + * @return the statusMessage value. + */ + String statusMessage(); + + /** + * @return the type value. + */ + JobType type(); + +} diff --git a/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/JobStatus.java b/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/JobStatus.java new file mode 100644 index 0000000000000..3d4280a90e4ea --- /dev/null +++ b/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/JobStatus.java @@ -0,0 +1,65 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.iothub.v2020_03_01; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for JobStatus. + */ +public enum JobStatus { + /** Enum value unknown. */ + UNKNOWN("unknown"), + + /** Enum value enqueued. */ + ENQUEUED("enqueued"), + + /** Enum value running. */ + RUNNING("running"), + + /** Enum value completed. */ + COMPLETED("completed"), + + /** Enum value failed. */ + FAILED("failed"), + + /** Enum value cancelled. */ + CANCELLED("cancelled"); + + /** The actual serialized value for a JobStatus instance. */ + private String value; + + JobStatus(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a JobStatus instance. + * + * @param value the serialized value to parse. + * @return the parsed JobStatus object, or null if unable to parse. + */ + @JsonCreator + public static JobStatus fromString(String value) { + JobStatus[] items = JobStatus.values(); + for (JobStatus item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/JobType.java b/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/JobType.java new file mode 100644 index 0000000000000..a3d8245197492 --- /dev/null +++ b/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/JobType.java @@ -0,0 +1,65 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.iothub.v2020_03_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for JobType. + */ +public final class JobType extends ExpandableStringEnum { + /** Static value unknown for JobType. */ + public static final JobType UNKNOWN = fromString("unknown"); + + /** Static value export for JobType. */ + public static final JobType EXPORT = fromString("export"); + + /** Static value import for JobType. */ + public static final JobType IMPORT = fromString("import"); + + /** Static value backup for JobType. */ + public static final JobType BACKUP = fromString("backup"); + + /** Static value readDeviceProperties for JobType. */ + public static final JobType READ_DEVICE_PROPERTIES = fromString("readDeviceProperties"); + + /** Static value writeDeviceProperties for JobType. */ + public static final JobType WRITE_DEVICE_PROPERTIES = fromString("writeDeviceProperties"); + + /** Static value updateDeviceConfiguration for JobType. */ + public static final JobType UPDATE_DEVICE_CONFIGURATION = fromString("updateDeviceConfiguration"); + + /** Static value rebootDevice for JobType. */ + public static final JobType REBOOT_DEVICE = fromString("rebootDevice"); + + /** Static value factoryResetDevice for JobType. */ + public static final JobType FACTORY_RESET_DEVICE = fromString("factoryResetDevice"); + + /** Static value firmwareUpdate for JobType. */ + public static final JobType FIRMWARE_UPDATE = fromString("firmwareUpdate"); + + /** + * Creates or finds a JobType from its string representation. + * @param name a name to look for + * @return the corresponding JobType + */ + @JsonCreator + public static JobType fromString(String name) { + return fromString(name, JobType.class); + } + + /** + * @return known JobType values + */ + public static Collection values() { + return values(JobType.class); + } +} diff --git a/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/MatchedRoute.java b/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/MatchedRoute.java new file mode 100644 index 0000000000000..3af929be07499 --- /dev/null +++ b/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/MatchedRoute.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.iothub.v2020_03_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Routes that matched. + */ +public class MatchedRoute { + /** + * Properties of routes that matched. + */ + @JsonProperty(value = "properties") + private RouteProperties properties; + + /** + * Get properties of routes that matched. + * + * @return the properties value + */ + public RouteProperties properties() { + return this.properties; + } + + /** + * Set properties of routes that matched. + * + * @param properties the properties value to set + * @return the MatchedRoute object itself. + */ + public MatchedRoute withProperties(RouteProperties properties) { + this.properties = properties; + return this; + } + +} diff --git a/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/MessagingEndpointProperties.java b/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/MessagingEndpointProperties.java new file mode 100644 index 0000000000000..c12863c550880 --- /dev/null +++ b/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/MessagingEndpointProperties.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.iothub.v2020_03_01; + +import org.joda.time.Period; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The properties of the messaging endpoints used by this IoT hub. + */ +public class MessagingEndpointProperties { + /** + * The lock duration. See: + * https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-file-upload. + */ + @JsonProperty(value = "lockDurationAsIso8601") + private Period lockDurationAsIso8601; + + /** + * The period of time for which a message is available to consume before it + * is expired by the IoT hub. See: + * https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-file-upload. + */ + @JsonProperty(value = "ttlAsIso8601") + private Period ttlAsIso8601; + + /** + * The number of times the IoT hub attempts to deliver a message. See: + * https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-file-upload. + */ + @JsonProperty(value = "maxDeliveryCount") + private Integer maxDeliveryCount; + + /** + * Get the lock duration. See: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-file-upload. + * + * @return the lockDurationAsIso8601 value + */ + public Period lockDurationAsIso8601() { + return this.lockDurationAsIso8601; + } + + /** + * Set the lock duration. See: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-file-upload. + * + * @param lockDurationAsIso8601 the lockDurationAsIso8601 value to set + * @return the MessagingEndpointProperties object itself. + */ + public MessagingEndpointProperties withLockDurationAsIso8601(Period lockDurationAsIso8601) { + this.lockDurationAsIso8601 = lockDurationAsIso8601; + return this; + } + + /** + * Get the period of time for which a message is available to consume before it is expired by the IoT hub. See: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-file-upload. + * + * @return the ttlAsIso8601 value + */ + public Period ttlAsIso8601() { + return this.ttlAsIso8601; + } + + /** + * Set the period of time for which a message is available to consume before it is expired by the IoT hub. See: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-file-upload. + * + * @param ttlAsIso8601 the ttlAsIso8601 value to set + * @return the MessagingEndpointProperties object itself. + */ + public MessagingEndpointProperties withTtlAsIso8601(Period ttlAsIso8601) { + this.ttlAsIso8601 = ttlAsIso8601; + return this; + } + + /** + * Get the number of times the IoT hub attempts to deliver a message. See: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-file-upload. + * + * @return the maxDeliveryCount value + */ + public Integer maxDeliveryCount() { + return this.maxDeliveryCount; + } + + /** + * Set the number of times the IoT hub attempts to deliver a message. See: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-file-upload. + * + * @param maxDeliveryCount the maxDeliveryCount value to set + * @return the MessagingEndpointProperties object itself. + */ + public MessagingEndpointProperties withMaxDeliveryCount(Integer maxDeliveryCount) { + this.maxDeliveryCount = maxDeliveryCount; + return this; + } + +} diff --git a/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/Name.java b/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/Name.java new file mode 100644 index 0000000000000..54e23da87413a --- /dev/null +++ b/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/Name.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.iothub.v2020_03_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Name of Iot Hub type. + */ +public class Name { + /** + * IotHub type. + */ + @JsonProperty(value = "value") + private String value; + + /** + * Localized value of name. + */ + @JsonProperty(value = "localizedValue") + private String localizedValue; + + /** + * Get iotHub type. + * + * @return the value value + */ + public String value() { + return this.value; + } + + /** + * Set iotHub type. + * + * @param value the value value to set + * @return the Name object itself. + */ + public Name withValue(String value) { + this.value = value; + return this; + } + + /** + * Get localized value of name. + * + * @return the localizedValue value + */ + public String localizedValue() { + return this.localizedValue; + } + + /** + * Set localized value of name. + * + * @param localizedValue the localizedValue value to set + * @return the Name object itself. + */ + public Name withLocalizedValue(String localizedValue) { + this.localizedValue = localizedValue; + return this; + } + +} diff --git a/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/Operation.java b/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/Operation.java new file mode 100644 index 0000000000000..385c4b15ac0b9 --- /dev/null +++ b/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/Operation.java @@ -0,0 +1,30 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.iothub.v2020_03_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.iothub.v2020_03_01.implementation.DevicesManager; +import com.microsoft.azure.management.iothub.v2020_03_01.implementation.OperationInner; + +/** + * Type representing Operation. + */ +public interface Operation extends HasInner, HasManager { + /** + * @return the display value. + */ + OperationDisplay display(); + + /** + * @return the name value. + */ + String name(); + +} diff --git a/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/OperationDisplay.java b/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/OperationDisplay.java new file mode 100644 index 0000000000000..3b57fb86752f8 --- /dev/null +++ b/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_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.iothub.v2020_03_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The object that represents the operation. + */ +public class OperationDisplay { + /** + * Service provider: Microsoft Devices. + */ + @JsonProperty(value = "provider", access = JsonProperty.Access.WRITE_ONLY) + private String provider; + + /** + * Resource Type: IotHubs. + */ + @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; + + /** + * Description of the operation. + */ + @JsonProperty(value = "description", access = JsonProperty.Access.WRITE_ONLY) + private String description; + + /** + * Get service provider: Microsoft Devices. + * + * @return the provider value + */ + public String provider() { + return this.provider; + } + + /** + * Get resource Type: IotHubs. + * + * @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 description of the operation. + * + * @return the description value + */ + public String description() { + return this.description; + } + +} diff --git a/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/OperationInputs.java b/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/OperationInputs.java new file mode 100644 index 0000000000000..a28c0245910cc --- /dev/null +++ b/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/OperationInputs.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.iothub.v2020_03_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Input values. + */ +public class OperationInputs { + /** + * The name of the IoT hub to check. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /** + * Get the name of the IoT hub to check. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name of the IoT hub to check. + * + * @param name the name value to set + * @return the OperationInputs object itself. + */ + public OperationInputs withName(String name) { + this.name = name; + return this; + } + +} diff --git a/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/Operations.java b/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/Operations.java new file mode 100644 index 0000000000000..d56e538d536a7 --- /dev/null +++ b/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_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.iothub.v2020_03_01; + +import rx.Observable; +import com.microsoft.azure.management.iothub.v2020_03_01.implementation.OperationsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing Operations. + */ +public interface Operations extends HasInner { + /** + * Lists all of the available IoT Hub REST API operations. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(); + +} diff --git a/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/PrivateEndpoint.java b/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/PrivateEndpoint.java new file mode 100644 index 0000000000000..8e55f1f954b95 --- /dev/null +++ b/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_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.iothub.v2020_03_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/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/PrivateEndpointConnection.java b/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/PrivateEndpointConnection.java new file mode 100644 index 0000000000000..6dd878b2b6736 --- /dev/null +++ b/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/PrivateEndpointConnection.java @@ -0,0 +1,67 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.iothub.v2020_03_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.iothub.v2020_03_01.implementation.PrivateEndpointConnectionInner; +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.resources.models.HasManager; +import com.microsoft.azure.management.iothub.v2020_03_01.implementation.DevicesManager; + +/** + * Type representing PrivateEndpointConnection. + */ +public interface PrivateEndpointConnection extends HasInner, Indexable, Refreshable, Updatable, HasManager { + /** + * @return the id value. + */ + String id(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the properties value. + */ + PrivateEndpointConnectionProperties properties(); + + /** + * @return the type value. + */ + String type(); + + /** + * The template for a PrivateEndpointConnection update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, UpdateStages.WithProperties { + } + + /** + * Grouping of PrivateEndpointConnection update stages. + */ + interface UpdateStages { + /** + * The stage of the privateendpointconnection update allowing to specify Properties. + */ + interface WithProperties { + /** + * Specifies properties. + * @param properties the properties parameter value + * @return the next update stage + */ + Update withProperties(PrivateEndpointConnectionProperties properties); + } + + } +} diff --git a/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/PrivateEndpointConnectionProperties.java b/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/PrivateEndpointConnectionProperties.java new file mode 100644 index 0000000000000..a882ea8624bb5 --- /dev/null +++ b/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/PrivateEndpointConnectionProperties.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.iothub.v2020_03_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The properties of a private endpoint connection. + */ +public class PrivateEndpointConnectionProperties { + /** + * The privateEndpoint property. + */ + @JsonProperty(value = "privateEndpoint") + private PrivateEndpoint privateEndpoint; + + /** + * The privateLinkServiceConnectionState property. + */ + @JsonProperty(value = "privateLinkServiceConnectionState", required = true) + private PrivateLinkServiceConnectionState privateLinkServiceConnectionState; + + /** + * Get the privateEndpoint value. + * + * @return the privateEndpoint value + */ + public PrivateEndpoint privateEndpoint() { + return this.privateEndpoint; + } + + /** + * Set the privateEndpoint value. + * + * @param privateEndpoint the privateEndpoint value to set + * @return the PrivateEndpointConnectionProperties object itself. + */ + public PrivateEndpointConnectionProperties withPrivateEndpoint(PrivateEndpoint privateEndpoint) { + this.privateEndpoint = privateEndpoint; + return this; + } + + /** + * Get the privateLinkServiceConnectionState value. + * + * @return the privateLinkServiceConnectionState value + */ + public PrivateLinkServiceConnectionState privateLinkServiceConnectionState() { + return this.privateLinkServiceConnectionState; + } + + /** + * Set the privateLinkServiceConnectionState value. + * + * @param privateLinkServiceConnectionState the privateLinkServiceConnectionState value to set + * @return the PrivateEndpointConnectionProperties object itself. + */ + public PrivateEndpointConnectionProperties withPrivateLinkServiceConnectionState(PrivateLinkServiceConnectionState privateLinkServiceConnectionState) { + this.privateLinkServiceConnectionState = privateLinkServiceConnectionState; + return this; + } + +} diff --git a/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/PrivateEndpointConnections.java b/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/PrivateEndpointConnections.java new file mode 100644 index 0000000000000..7670edfd658f7 --- /dev/null +++ b/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/PrivateEndpointConnections.java @@ -0,0 +1,55 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.iothub.v2020_03_01; + +import rx.Completable; +import rx.Observable; +import com.microsoft.azure.management.iothub.v2020_03_01.implementation.PrivateEndpointConnectionsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing PrivateEndpointConnections. + */ +public interface PrivateEndpointConnections extends HasInner { + /** + * Get private endpoint connection. + * Get private endpoint connection properties. + * + * @param resourceGroupName The name of the resource group that contains the IoT hub. + * @param resourceName The name of the IoT hub. + * @param privateEndpointConnectionName The name of the private endpoint connection + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String resourceName, String privateEndpointConnectionName); + + /** + * List private endpoint connections. + * List private endpoint connection properties. + * + * @param resourceGroupName The name of the resource group that contains the IoT hub. + * @param resourceName The name of the IoT hub. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(String resourceGroupName, String resourceName); + + /** + * Delete private endpoint connection. + * Delete private endpoint connection with the specified name. + * + * @param resourceGroupName The name of the resource group that contains the IoT hub. + * @param resourceName The name of the IoT hub. + * @param privateEndpointConnectionName The name of the private endpoint connection + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable deleteAsync(String resourceGroupName, String resourceName, String privateEndpointConnectionName); + +} diff --git a/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/PrivateLinkResource.java b/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/PrivateLinkResource.java new file mode 100644 index 0000000000000..be89e51086b9f --- /dev/null +++ b/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/PrivateLinkResource.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.iothub.v2020_03_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.iothub.v2020_03_01.implementation.DevicesManager; +import com.microsoft.azure.management.iothub.v2020_03_01.implementation.PrivateLinkResourceInner; +import com.microsoft.azure.management.iothub.v2020_03_01.implementation.GroupIdInformationInner; +import java.util.List; + +/** + * Type representing PrivateLinkResource. + */ +public interface PrivateLinkResource extends HasInner, HasManager { + /** + * @return the value value. + */ + List value(); + +} diff --git a/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/PrivateLinkResources.java b/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/PrivateLinkResources.java new file mode 100644 index 0000000000000..fd4cf045c7d5a --- /dev/null +++ b/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/PrivateLinkResources.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.iothub.v2020_03_01; + +import rx.Observable; +import com.microsoft.azure.management.iothub.v2020_03_01.implementation.PrivateLinkResourcesInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing PrivateLinkResources. + */ +public interface PrivateLinkResources extends HasInner { + /** + * List private link resources. + * List private link resources for the given IotHub. + * + * @param resourceGroupName The name of the resource group that contains the IoT hub. + * @param resourceName The name of the IoT hub. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(String resourceGroupName, String resourceName); + + /** + * Get the specified private link resource. + * Get the specified private link resource for the given IotHub. + * + * @param resourceGroupName The name of the resource group that contains the IoT hub. + * @param resourceName The name of the IoT hub. + * @param groupId The name of the private link resource + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String resourceName, String groupId); + +} diff --git a/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/PrivateLinkServiceConnectionState.java b/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/PrivateLinkServiceConnectionState.java new file mode 100644 index 0000000000000..2e547aa99211b --- /dev/null +++ b/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_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.iothub.v2020_03_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/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/PrivateLinkServiceConnectionStatus.java b/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/PrivateLinkServiceConnectionStatus.java new file mode 100644 index 0000000000000..7c919c261dc31 --- /dev/null +++ b/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_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.iothub.v2020_03_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/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/PublicNetworkAccess.java b/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/PublicNetworkAccess.java new file mode 100644 index 0000000000000..a406ee1e0862b --- /dev/null +++ b/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/PublicNetworkAccess.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.iothub.v2020_03_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for PublicNetworkAccess. + */ +public final class PublicNetworkAccess extends ExpandableStringEnum { + /** Static value Enabled for PublicNetworkAccess. */ + public static final PublicNetworkAccess ENABLED = fromString("Enabled"); + + /** Static value Disabled for PublicNetworkAccess. */ + public static final PublicNetworkAccess DISABLED = fromString("Disabled"); + + /** + * Creates or finds a PublicNetworkAccess from its string representation. + * @param name a name to look for + * @return the corresponding PublicNetworkAccess + */ + @JsonCreator + public static PublicNetworkAccess fromString(String name) { + return fromString(name, PublicNetworkAccess.class); + } + + /** + * @return known PublicNetworkAccess values + */ + public static Collection values() { + return values(PublicNetworkAccess.class); + } +} diff --git a/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/RegistryStatistics.java b/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/RegistryStatistics.java new file mode 100644 index 0000000000000..0d5cc3c09634a --- /dev/null +++ b/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/RegistryStatistics.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.iothub.v2020_03_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.iothub.v2020_03_01.implementation.DevicesManager; +import com.microsoft.azure.management.iothub.v2020_03_01.implementation.RegistryStatisticsInner; + +/** + * Type representing RegistryStatistics. + */ +public interface RegistryStatistics extends HasInner, HasManager { + /** + * @return the disabledDeviceCount value. + */ + Long disabledDeviceCount(); + + /** + * @return the enabledDeviceCount value. + */ + Long enabledDeviceCount(); + + /** + * @return the totalDeviceCount value. + */ + Long totalDeviceCount(); + +} diff --git a/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/ResourceProviderCommons.java b/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/ResourceProviderCommons.java new file mode 100644 index 0000000000000..3d342c5723e61 --- /dev/null +++ b/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/ResourceProviderCommons.java @@ -0,0 +1,28 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.iothub.v2020_03_01; + +import rx.Observable; +import com.microsoft.azure.management.iothub.v2020_03_01.implementation.ResourceProviderCommonsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing ResourceProviderCommons. + */ +public interface ResourceProviderCommons extends HasInner { + /** + * Get the number of iot hubs in the subscription. + * Get the number of free and paid iot hubs in the subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(); + +} diff --git a/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/RouteCompilationError.java b/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/RouteCompilationError.java new file mode 100644 index 0000000000000..2521c0e6f9873 --- /dev/null +++ b/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/RouteCompilationError.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.iothub.v2020_03_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Compilation error when evaluating route. + */ +public class RouteCompilationError { + /** + * Route error message. + */ + @JsonProperty(value = "message") + private String message; + + /** + * Severity of the route error. Possible values include: 'error', + * 'warning'. + */ + @JsonProperty(value = "severity") + private RouteErrorSeverity severity; + + /** + * Location where the route error happened. + */ + @JsonProperty(value = "location") + private RouteErrorRange location; + + /** + * Get route error message. + * + * @return the message value + */ + public String message() { + return this.message; + } + + /** + * Set route error message. + * + * @param message the message value to set + * @return the RouteCompilationError object itself. + */ + public RouteCompilationError withMessage(String message) { + this.message = message; + return this; + } + + /** + * Get severity of the route error. Possible values include: 'error', 'warning'. + * + * @return the severity value + */ + public RouteErrorSeverity severity() { + return this.severity; + } + + /** + * Set severity of the route error. Possible values include: 'error', 'warning'. + * + * @param severity the severity value to set + * @return the RouteCompilationError object itself. + */ + public RouteCompilationError withSeverity(RouteErrorSeverity severity) { + this.severity = severity; + return this; + } + + /** + * Get location where the route error happened. + * + * @return the location value + */ + public RouteErrorRange location() { + return this.location; + } + + /** + * Set location where the route error happened. + * + * @param location the location value to set + * @return the RouteCompilationError object itself. + */ + public RouteCompilationError withLocation(RouteErrorRange location) { + this.location = location; + return this; + } + +} diff --git a/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/RouteErrorPosition.java b/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/RouteErrorPosition.java new file mode 100644 index 0000000000000..8ee72c5f3943b --- /dev/null +++ b/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/RouteErrorPosition.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.iothub.v2020_03_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Position where the route error happened. + */ +public class RouteErrorPosition { + /** + * Line where the route error happened. + */ + @JsonProperty(value = "line") + private Integer line; + + /** + * Column where the route error happened. + */ + @JsonProperty(value = "column") + private Integer column; + + /** + * Get line where the route error happened. + * + * @return the line value + */ + public Integer line() { + return this.line; + } + + /** + * Set line where the route error happened. + * + * @param line the line value to set + * @return the RouteErrorPosition object itself. + */ + public RouteErrorPosition withLine(Integer line) { + this.line = line; + return this; + } + + /** + * Get column where the route error happened. + * + * @return the column value + */ + public Integer column() { + return this.column; + } + + /** + * Set column where the route error happened. + * + * @param column the column value to set + * @return the RouteErrorPosition object itself. + */ + public RouteErrorPosition withColumn(Integer column) { + this.column = column; + return this; + } + +} diff --git a/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/RouteErrorRange.java b/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/RouteErrorRange.java new file mode 100644 index 0000000000000..706d2e04e17b3 --- /dev/null +++ b/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/RouteErrorRange.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.iothub.v2020_03_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Range of route errors. + */ +public class RouteErrorRange { + /** + * Start where the route error happened. + */ + @JsonProperty(value = "start") + private RouteErrorPosition start; + + /** + * End where the route error happened. + */ + @JsonProperty(value = "end") + private RouteErrorPosition end; + + /** + * Get start where the route error happened. + * + * @return the start value + */ + public RouteErrorPosition start() { + return this.start; + } + + /** + * Set start where the route error happened. + * + * @param start the start value to set + * @return the RouteErrorRange object itself. + */ + public RouteErrorRange withStart(RouteErrorPosition start) { + this.start = start; + return this; + } + + /** + * Get end where the route error happened. + * + * @return the end value + */ + public RouteErrorPosition end() { + return this.end; + } + + /** + * Set end where the route error happened. + * + * @param end the end value to set + * @return the RouteErrorRange object itself. + */ + public RouteErrorRange withEnd(RouteErrorPosition end) { + this.end = end; + return this; + } + +} diff --git a/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/RouteErrorSeverity.java b/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/RouteErrorSeverity.java new file mode 100644 index 0000000000000..b2ea801ce879a --- /dev/null +++ b/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/RouteErrorSeverity.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.iothub.v2020_03_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for RouteErrorSeverity. + */ +public final class RouteErrorSeverity extends ExpandableStringEnum { + /** Static value error for RouteErrorSeverity. */ + public static final RouteErrorSeverity ERROR = fromString("error"); + + /** Static value warning for RouteErrorSeverity. */ + public static final RouteErrorSeverity WARNING = fromString("warning"); + + /** + * Creates or finds a RouteErrorSeverity from its string representation. + * @param name a name to look for + * @return the corresponding RouteErrorSeverity + */ + @JsonCreator + public static RouteErrorSeverity fromString(String name) { + return fromString(name, RouteErrorSeverity.class); + } + + /** + * @return known RouteErrorSeverity values + */ + public static Collection values() { + return values(RouteErrorSeverity.class); + } +} diff --git a/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/RouteProperties.java b/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/RouteProperties.java new file mode 100644 index 0000000000000..d63aabb14706f --- /dev/null +++ b/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/RouteProperties.java @@ -0,0 +1,157 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.iothub.v2020_03_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The properties of a routing rule that your IoT hub uses to route messages to + * endpoints. + */ +public class RouteProperties { + /** + * The name of the route. The name can only include alphanumeric + * characters, periods, underscores, hyphens, has a maximum length of 64 + * characters, and must be unique. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /** + * The source that the routing rule is to be applied to, such as + * DeviceMessages. Possible values include: 'Invalid', 'DeviceMessages', + * 'TwinChangeEvents', 'DeviceLifecycleEvents', 'DeviceJobLifecycleEvents'. + */ + @JsonProperty(value = "source", required = true) + private RoutingSource source; + + /** + * The condition that is evaluated to apply the routing rule. If no + * condition is provided, it evaluates to true by default. For grammar, + * see: + * https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-query-language. + */ + @JsonProperty(value = "condition") + private String condition; + + /** + * The list of endpoints to which messages that satisfy the condition are + * routed. Currently only one endpoint is allowed. + */ + @JsonProperty(value = "endpointNames", required = true) + private List endpointNames; + + /** + * Used to specify whether a route is enabled. + */ + @JsonProperty(value = "isEnabled", required = true) + private boolean isEnabled; + + /** + * Get the name of the route. The name can only include alphanumeric characters, periods, underscores, hyphens, has a maximum length of 64 characters, and must be unique. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name of the route. The name can only include alphanumeric characters, periods, underscores, hyphens, has a maximum length of 64 characters, and must be unique. + * + * @param name the name value to set + * @return the RouteProperties object itself. + */ + public RouteProperties withName(String name) { + this.name = name; + return this; + } + + /** + * Get the source that the routing rule is to be applied to, such as DeviceMessages. Possible values include: 'Invalid', 'DeviceMessages', 'TwinChangeEvents', 'DeviceLifecycleEvents', 'DeviceJobLifecycleEvents'. + * + * @return the source value + */ + public RoutingSource source() { + return this.source; + } + + /** + * Set the source that the routing rule is to be applied to, such as DeviceMessages. Possible values include: 'Invalid', 'DeviceMessages', 'TwinChangeEvents', 'DeviceLifecycleEvents', 'DeviceJobLifecycleEvents'. + * + * @param source the source value to set + * @return the RouteProperties object itself. + */ + public RouteProperties withSource(RoutingSource source) { + this.source = source; + return this; + } + + /** + * Get the condition that is evaluated to apply the routing rule. If no condition is provided, it evaluates to true by default. For grammar, see: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-query-language. + * + * @return the condition value + */ + public String condition() { + return this.condition; + } + + /** + * Set the condition that is evaluated to apply the routing rule. If no condition is provided, it evaluates to true by default. For grammar, see: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-query-language. + * + * @param condition the condition value to set + * @return the RouteProperties object itself. + */ + public RouteProperties withCondition(String condition) { + this.condition = condition; + return this; + } + + /** + * Get the list of endpoints to which messages that satisfy the condition are routed. Currently only one endpoint is allowed. + * + * @return the endpointNames value + */ + public List endpointNames() { + return this.endpointNames; + } + + /** + * Set the list of endpoints to which messages that satisfy the condition are routed. Currently only one endpoint is allowed. + * + * @param endpointNames the endpointNames value to set + * @return the RouteProperties object itself. + */ + public RouteProperties withEndpointNames(List endpointNames) { + this.endpointNames = endpointNames; + return this; + } + + /** + * Get used to specify whether a route is enabled. + * + * @return the isEnabled value + */ + public boolean isEnabled() { + return this.isEnabled; + } + + /** + * Set used to specify whether a route is enabled. + * + * @param isEnabled the isEnabled value to set + * @return the RouteProperties object itself. + */ + public RouteProperties withIsEnabled(boolean isEnabled) { + this.isEnabled = isEnabled; + return this; + } + +} diff --git a/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/RoutingEndpoints.java b/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/RoutingEndpoints.java new file mode 100644 index 0000000000000..d985a7cd1c5a0 --- /dev/null +++ b/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/RoutingEndpoints.java @@ -0,0 +1,130 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.iothub.v2020_03_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The properties related to the custom endpoints to which your IoT hub routes + * messages based on the routing rules. A maximum of 10 custom endpoints are + * allowed across all endpoint types for paid hubs and only 1 custom endpoint + * is allowed across all endpoint types for free hubs. + */ +public class RoutingEndpoints { + /** + * The list of Service Bus queue endpoints that IoT hub routes the messages + * to, based on the routing rules. + */ + @JsonProperty(value = "serviceBusQueues") + private List serviceBusQueues; + + /** + * The list of Service Bus topic endpoints that the IoT hub routes the + * messages to, based on the routing rules. + */ + @JsonProperty(value = "serviceBusTopics") + private List serviceBusTopics; + + /** + * The list of Event Hubs endpoints that IoT hub routes messages to, based + * on the routing rules. This list does not include the built-in Event Hubs + * endpoint. + */ + @JsonProperty(value = "eventHubs") + private List eventHubs; + + /** + * The list of storage container endpoints that IoT hub routes messages to, + * based on the routing rules. + */ + @JsonProperty(value = "storageContainers") + private List storageContainers; + + /** + * Get the list of Service Bus queue endpoints that IoT hub routes the messages to, based on the routing rules. + * + * @return the serviceBusQueues value + */ + public List serviceBusQueues() { + return this.serviceBusQueues; + } + + /** + * Set the list of Service Bus queue endpoints that IoT hub routes the messages to, based on the routing rules. + * + * @param serviceBusQueues the serviceBusQueues value to set + * @return the RoutingEndpoints object itself. + */ + public RoutingEndpoints withServiceBusQueues(List serviceBusQueues) { + this.serviceBusQueues = serviceBusQueues; + return this; + } + + /** + * Get the list of Service Bus topic endpoints that the IoT hub routes the messages to, based on the routing rules. + * + * @return the serviceBusTopics value + */ + public List serviceBusTopics() { + return this.serviceBusTopics; + } + + /** + * Set the list of Service Bus topic endpoints that the IoT hub routes the messages to, based on the routing rules. + * + * @param serviceBusTopics the serviceBusTopics value to set + * @return the RoutingEndpoints object itself. + */ + public RoutingEndpoints withServiceBusTopics(List serviceBusTopics) { + this.serviceBusTopics = serviceBusTopics; + return this; + } + + /** + * Get the list of Event Hubs endpoints that IoT hub routes messages to, based on the routing rules. This list does not include the built-in Event Hubs endpoint. + * + * @return the eventHubs value + */ + public List eventHubs() { + return this.eventHubs; + } + + /** + * Set the list of Event Hubs endpoints that IoT hub routes messages to, based on the routing rules. This list does not include the built-in Event Hubs endpoint. + * + * @param eventHubs the eventHubs value to set + * @return the RoutingEndpoints object itself. + */ + public RoutingEndpoints withEventHubs(List eventHubs) { + this.eventHubs = eventHubs; + return this; + } + + /** + * Get the list of storage container endpoints that IoT hub routes messages to, based on the routing rules. + * + * @return the storageContainers value + */ + public List storageContainers() { + return this.storageContainers; + } + + /** + * Set the list of storage container endpoints that IoT hub routes messages to, based on the routing rules. + * + * @param storageContainers the storageContainers value to set + * @return the RoutingEndpoints object itself. + */ + public RoutingEndpoints withStorageContainers(List storageContainers) { + this.storageContainers = storageContainers; + return this; + } + +} diff --git a/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/RoutingEventHubProperties.java b/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/RoutingEventHubProperties.java new file mode 100644 index 0000000000000..1fd3eb2380587 --- /dev/null +++ b/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/RoutingEventHubProperties.java @@ -0,0 +1,230 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.iothub.v2020_03_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The properties related to an event hub endpoint. + */ +public class RoutingEventHubProperties { + /** + * Id of the event hub endpoint. + */ + @JsonProperty(value = "id") + private String id; + + /** + * The connection string of the event hub endpoint. + */ + @JsonProperty(value = "connectionString") + private String connectionString; + + /** + * The url of the event hub endpoint. It must include the protocol sb://. + */ + @JsonProperty(value = "endpointUri") + private String endpointUri; + + /** + * Event hub name on the event hub namespace. + */ + @JsonProperty(value = "entityPath") + private String entityPath; + + /** + * Method used to authenticate against the event hub endpoint. Possible + * values include: 'keyBased', 'identityBased'. + */ + @JsonProperty(value = "authenticationType") + private AuthenticationType authenticationType; + + /** + * The name that identifies this endpoint. The name can only include + * alphanumeric characters, periods, underscores, hyphens and has a maximum + * length of 64 characters. The following names are reserved: events, + * fileNotifications, $default. Endpoint names must be unique across + * endpoint types. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /** + * The subscription identifier of the event hub endpoint. + */ + @JsonProperty(value = "subscriptionId") + private String subscriptionId; + + /** + * The name of the resource group of the event hub endpoint. + */ + @JsonProperty(value = "resourceGroup") + private String resourceGroup; + + /** + * Get id of the event hub endpoint. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set id of the event hub endpoint. + * + * @param id the id value to set + * @return the RoutingEventHubProperties object itself. + */ + public RoutingEventHubProperties withId(String id) { + this.id = id; + return this; + } + + /** + * Get the connection string of the event hub endpoint. + * + * @return the connectionString value + */ + public String connectionString() { + return this.connectionString; + } + + /** + * Set the connection string of the event hub endpoint. + * + * @param connectionString the connectionString value to set + * @return the RoutingEventHubProperties object itself. + */ + public RoutingEventHubProperties withConnectionString(String connectionString) { + this.connectionString = connectionString; + return this; + } + + /** + * Get the url of the event hub endpoint. It must include the protocol sb://. + * + * @return the endpointUri value + */ + public String endpointUri() { + return this.endpointUri; + } + + /** + * Set the url of the event hub endpoint. It must include the protocol sb://. + * + * @param endpointUri the endpointUri value to set + * @return the RoutingEventHubProperties object itself. + */ + public RoutingEventHubProperties withEndpointUri(String endpointUri) { + this.endpointUri = endpointUri; + return this; + } + + /** + * Get event hub name on the event hub namespace. + * + * @return the entityPath value + */ + public String entityPath() { + return this.entityPath; + } + + /** + * Set event hub name on the event hub namespace. + * + * @param entityPath the entityPath value to set + * @return the RoutingEventHubProperties object itself. + */ + public RoutingEventHubProperties withEntityPath(String entityPath) { + this.entityPath = entityPath; + return this; + } + + /** + * Get method used to authenticate against the event hub endpoint. Possible values include: 'keyBased', 'identityBased'. + * + * @return the authenticationType value + */ + public AuthenticationType authenticationType() { + return this.authenticationType; + } + + /** + * Set method used to authenticate against the event hub endpoint. Possible values include: 'keyBased', 'identityBased'. + * + * @param authenticationType the authenticationType value to set + * @return the RoutingEventHubProperties object itself. + */ + public RoutingEventHubProperties withAuthenticationType(AuthenticationType authenticationType) { + this.authenticationType = authenticationType; + return this; + } + + /** + * Get the name that identifies this endpoint. The name can only include alphanumeric characters, periods, underscores, hyphens and has a maximum length of 64 characters. The following names are reserved: events, fileNotifications, $default. Endpoint names must be unique across endpoint types. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name that identifies this endpoint. The name can only include alphanumeric characters, periods, underscores, hyphens and has a maximum length of 64 characters. The following names are reserved: events, fileNotifications, $default. Endpoint names must be unique across endpoint types. + * + * @param name the name value to set + * @return the RoutingEventHubProperties object itself. + */ + public RoutingEventHubProperties withName(String name) { + this.name = name; + return this; + } + + /** + * Get the subscription identifier of the event hub endpoint. + * + * @return the subscriptionId value + */ + public String subscriptionId() { + return this.subscriptionId; + } + + /** + * Set the subscription identifier of the event hub endpoint. + * + * @param subscriptionId the subscriptionId value to set + * @return the RoutingEventHubProperties object itself. + */ + public RoutingEventHubProperties withSubscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; + return this; + } + + /** + * Get the name of the resource group of the event hub endpoint. + * + * @return the resourceGroup value + */ + public String resourceGroup() { + return this.resourceGroup; + } + + /** + * Set the name of the resource group of the event hub endpoint. + * + * @param resourceGroup the resourceGroup value to set + * @return the RoutingEventHubProperties object itself. + */ + public RoutingEventHubProperties withResourceGroup(String resourceGroup) { + this.resourceGroup = resourceGroup; + return this; + } + +} diff --git a/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/RoutingMessage.java b/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/RoutingMessage.java new file mode 100644 index 0000000000000..68368b488e6a9 --- /dev/null +++ b/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/RoutingMessage.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.iothub.v2020_03_01; + +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Routing message. + */ +public class RoutingMessage { + /** + * Body of routing message. + */ + @JsonProperty(value = "body") + private String body; + + /** + * App properties. + */ + @JsonProperty(value = "appProperties") + private Map appProperties; + + /** + * System properties. + */ + @JsonProperty(value = "systemProperties") + private Map systemProperties; + + /** + * Get body of routing message. + * + * @return the body value + */ + public String body() { + return this.body; + } + + /** + * Set body of routing message. + * + * @param body the body value to set + * @return the RoutingMessage object itself. + */ + public RoutingMessage withBody(String body) { + this.body = body; + return this; + } + + /** + * Get app properties. + * + * @return the appProperties value + */ + public Map appProperties() { + return this.appProperties; + } + + /** + * Set app properties. + * + * @param appProperties the appProperties value to set + * @return the RoutingMessage object itself. + */ + public RoutingMessage withAppProperties(Map appProperties) { + this.appProperties = appProperties; + return this; + } + + /** + * Get system properties. + * + * @return the systemProperties value + */ + public Map systemProperties() { + return this.systemProperties; + } + + /** + * Set system properties. + * + * @param systemProperties the systemProperties value to set + * @return the RoutingMessage object itself. + */ + public RoutingMessage withSystemProperties(Map systemProperties) { + this.systemProperties = systemProperties; + return this; + } + +} diff --git a/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/RoutingProperties.java b/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/RoutingProperties.java new file mode 100644 index 0000000000000..92c6d7d32bd72 --- /dev/null +++ b/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/RoutingProperties.java @@ -0,0 +1,132 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.iothub.v2020_03_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The routing related properties of the IoT hub. See: + * https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-messaging. + */ +public class RoutingProperties { + /** + * The endpoints property. + */ + @JsonProperty(value = "endpoints") + private RoutingEndpoints endpoints; + + /** + * The list of user-provided routing rules that the IoT hub uses to route + * messages to built-in and custom endpoints. A maximum of 100 routing + * rules are allowed for paid hubs and a maximum of 5 routing rules are + * allowed for free hubs. + */ + @JsonProperty(value = "routes") + private List routes; + + /** + * The properties of the route that is used as a fall-back route when none + * of the conditions specified in the 'routes' section are met. This is an + * optional parameter. When this property is not set, the messages which do + * not meet any of the conditions specified in the 'routes' section get + * routed to the built-in eventhub endpoint. + */ + @JsonProperty(value = "fallbackRoute") + private FallbackRouteProperties fallbackRoute; + + /** + * The list of user-provided enrichments that the IoT hub applies to + * messages to be delivered to built-in and custom endpoints. See: + * https://aka.ms/telemetryoneventgrid. + */ + @JsonProperty(value = "enrichments") + private List enrichments; + + /** + * Get the endpoints value. + * + * @return the endpoints value + */ + public RoutingEndpoints endpoints() { + return this.endpoints; + } + + /** + * Set the endpoints value. + * + * @param endpoints the endpoints value to set + * @return the RoutingProperties object itself. + */ + public RoutingProperties withEndpoints(RoutingEndpoints endpoints) { + this.endpoints = endpoints; + return this; + } + + /** + * Get the list of user-provided routing rules that the IoT hub uses to route messages to built-in and custom endpoints. A maximum of 100 routing rules are allowed for paid hubs and a maximum of 5 routing rules are allowed for free hubs. + * + * @return the routes value + */ + public List routes() { + return this.routes; + } + + /** + * Set the list of user-provided routing rules that the IoT hub uses to route messages to built-in and custom endpoints. A maximum of 100 routing rules are allowed for paid hubs and a maximum of 5 routing rules are allowed for free hubs. + * + * @param routes the routes value to set + * @return the RoutingProperties object itself. + */ + public RoutingProperties withRoutes(List routes) { + this.routes = routes; + return this; + } + + /** + * Get the properties of the route that is used as a fall-back route when none of the conditions specified in the 'routes' section are met. This is an optional parameter. When this property is not set, the messages which do not meet any of the conditions specified in the 'routes' section get routed to the built-in eventhub endpoint. + * + * @return the fallbackRoute value + */ + public FallbackRouteProperties fallbackRoute() { + return this.fallbackRoute; + } + + /** + * Set the properties of the route that is used as a fall-back route when none of the conditions specified in the 'routes' section are met. This is an optional parameter. When this property is not set, the messages which do not meet any of the conditions specified in the 'routes' section get routed to the built-in eventhub endpoint. + * + * @param fallbackRoute the fallbackRoute value to set + * @return the RoutingProperties object itself. + */ + public RoutingProperties withFallbackRoute(FallbackRouteProperties fallbackRoute) { + this.fallbackRoute = fallbackRoute; + return this; + } + + /** + * Get the list of user-provided enrichments that the IoT hub applies to messages to be delivered to built-in and custom endpoints. See: https://aka.ms/telemetryoneventgrid. + * + * @return the enrichments value + */ + public List enrichments() { + return this.enrichments; + } + + /** + * Set the list of user-provided enrichments that the IoT hub applies to messages to be delivered to built-in and custom endpoints. See: https://aka.ms/telemetryoneventgrid. + * + * @param enrichments the enrichments value to set + * @return the RoutingProperties object itself. + */ + public RoutingProperties withEnrichments(List enrichments) { + this.enrichments = enrichments; + return this; + } + +} diff --git a/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/RoutingServiceBusQueueEndpointProperties.java b/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/RoutingServiceBusQueueEndpointProperties.java new file mode 100644 index 0000000000000..378c79877e2a9 --- /dev/null +++ b/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/RoutingServiceBusQueueEndpointProperties.java @@ -0,0 +1,231 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.iothub.v2020_03_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The properties related to service bus queue endpoint types. + */ +public class RoutingServiceBusQueueEndpointProperties { + /** + * Id of the service bus queue endpoint. + */ + @JsonProperty(value = "id") + private String id; + + /** + * The connection string of the service bus queue endpoint. + */ + @JsonProperty(value = "connectionString") + private String connectionString; + + /** + * The url of the service bus queue endpoint. It must include the protocol + * sb://. + */ + @JsonProperty(value = "endpointUri") + private String endpointUri; + + /** + * Queue name on the service bus namespace. + */ + @JsonProperty(value = "entityPath") + private String entityPath; + + /** + * Method used to authenticate against the service bus queue endpoint. + * Possible values include: 'keyBased', 'identityBased'. + */ + @JsonProperty(value = "authenticationType") + private AuthenticationType authenticationType; + + /** + * The name that identifies this endpoint. The name can only include + * alphanumeric characters, periods, underscores, hyphens and has a maximum + * length of 64 characters. The following names are reserved: events, + * fileNotifications, $default. Endpoint names must be unique across + * endpoint types. The name need not be the same as the actual queue name. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /** + * The subscription identifier of the service bus queue endpoint. + */ + @JsonProperty(value = "subscriptionId") + private String subscriptionId; + + /** + * The name of the resource group of the service bus queue endpoint. + */ + @JsonProperty(value = "resourceGroup") + private String resourceGroup; + + /** + * Get id of the service bus queue endpoint. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set id of the service bus queue endpoint. + * + * @param id the id value to set + * @return the RoutingServiceBusQueueEndpointProperties object itself. + */ + public RoutingServiceBusQueueEndpointProperties withId(String id) { + this.id = id; + return this; + } + + /** + * Get the connection string of the service bus queue endpoint. + * + * @return the connectionString value + */ + public String connectionString() { + return this.connectionString; + } + + /** + * Set the connection string of the service bus queue endpoint. + * + * @param connectionString the connectionString value to set + * @return the RoutingServiceBusQueueEndpointProperties object itself. + */ + public RoutingServiceBusQueueEndpointProperties withConnectionString(String connectionString) { + this.connectionString = connectionString; + return this; + } + + /** + * Get the url of the service bus queue endpoint. It must include the protocol sb://. + * + * @return the endpointUri value + */ + public String endpointUri() { + return this.endpointUri; + } + + /** + * Set the url of the service bus queue endpoint. It must include the protocol sb://. + * + * @param endpointUri the endpointUri value to set + * @return the RoutingServiceBusQueueEndpointProperties object itself. + */ + public RoutingServiceBusQueueEndpointProperties withEndpointUri(String endpointUri) { + this.endpointUri = endpointUri; + return this; + } + + /** + * Get queue name on the service bus namespace. + * + * @return the entityPath value + */ + public String entityPath() { + return this.entityPath; + } + + /** + * Set queue name on the service bus namespace. + * + * @param entityPath the entityPath value to set + * @return the RoutingServiceBusQueueEndpointProperties object itself. + */ + public RoutingServiceBusQueueEndpointProperties withEntityPath(String entityPath) { + this.entityPath = entityPath; + return this; + } + + /** + * Get method used to authenticate against the service bus queue endpoint. Possible values include: 'keyBased', 'identityBased'. + * + * @return the authenticationType value + */ + public AuthenticationType authenticationType() { + return this.authenticationType; + } + + /** + * Set method used to authenticate against the service bus queue endpoint. Possible values include: 'keyBased', 'identityBased'. + * + * @param authenticationType the authenticationType value to set + * @return the RoutingServiceBusQueueEndpointProperties object itself. + */ + public RoutingServiceBusQueueEndpointProperties withAuthenticationType(AuthenticationType authenticationType) { + this.authenticationType = authenticationType; + return this; + } + + /** + * Get the name that identifies this endpoint. The name can only include alphanumeric characters, periods, underscores, hyphens and has a maximum length of 64 characters. The following names are reserved: events, fileNotifications, $default. Endpoint names must be unique across endpoint types. The name need not be the same as the actual queue name. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name that identifies this endpoint. The name can only include alphanumeric characters, periods, underscores, hyphens and has a maximum length of 64 characters. The following names are reserved: events, fileNotifications, $default. Endpoint names must be unique across endpoint types. The name need not be the same as the actual queue name. + * + * @param name the name value to set + * @return the RoutingServiceBusQueueEndpointProperties object itself. + */ + public RoutingServiceBusQueueEndpointProperties withName(String name) { + this.name = name; + return this; + } + + /** + * Get the subscription identifier of the service bus queue endpoint. + * + * @return the subscriptionId value + */ + public String subscriptionId() { + return this.subscriptionId; + } + + /** + * Set the subscription identifier of the service bus queue endpoint. + * + * @param subscriptionId the subscriptionId value to set + * @return the RoutingServiceBusQueueEndpointProperties object itself. + */ + public RoutingServiceBusQueueEndpointProperties withSubscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; + return this; + } + + /** + * Get the name of the resource group of the service bus queue endpoint. + * + * @return the resourceGroup value + */ + public String resourceGroup() { + return this.resourceGroup; + } + + /** + * Set the name of the resource group of the service bus queue endpoint. + * + * @param resourceGroup the resourceGroup value to set + * @return the RoutingServiceBusQueueEndpointProperties object itself. + */ + public RoutingServiceBusQueueEndpointProperties withResourceGroup(String resourceGroup) { + this.resourceGroup = resourceGroup; + return this; + } + +} diff --git a/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/RoutingServiceBusTopicEndpointProperties.java b/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/RoutingServiceBusTopicEndpointProperties.java new file mode 100644 index 0000000000000..c78d633009554 --- /dev/null +++ b/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/RoutingServiceBusTopicEndpointProperties.java @@ -0,0 +1,231 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.iothub.v2020_03_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The properties related to service bus topic endpoint types. + */ +public class RoutingServiceBusTopicEndpointProperties { + /** + * Id of the service bus topic endpoint. + */ + @JsonProperty(value = "id") + private String id; + + /** + * The connection string of the service bus topic endpoint. + */ + @JsonProperty(value = "connectionString") + private String connectionString; + + /** + * The url of the service bus topic endpoint. It must include the protocol + * sb://. + */ + @JsonProperty(value = "endpointUri") + private String endpointUri; + + /** + * Queue name on the service bus topic. + */ + @JsonProperty(value = "entityPath") + private String entityPath; + + /** + * Method used to authenticate against the service bus topic endpoint. + * Possible values include: 'keyBased', 'identityBased'. + */ + @JsonProperty(value = "authenticationType") + private AuthenticationType authenticationType; + + /** + * The name that identifies this endpoint. The name can only include + * alphanumeric characters, periods, underscores, hyphens and has a maximum + * length of 64 characters. The following names are reserved: events, + * fileNotifications, $default. Endpoint names must be unique across + * endpoint types. The name need not be the same as the actual topic name. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /** + * The subscription identifier of the service bus topic endpoint. + */ + @JsonProperty(value = "subscriptionId") + private String subscriptionId; + + /** + * The name of the resource group of the service bus topic endpoint. + */ + @JsonProperty(value = "resourceGroup") + private String resourceGroup; + + /** + * Get id of the service bus topic endpoint. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set id of the service bus topic endpoint. + * + * @param id the id value to set + * @return the RoutingServiceBusTopicEndpointProperties object itself. + */ + public RoutingServiceBusTopicEndpointProperties withId(String id) { + this.id = id; + return this; + } + + /** + * Get the connection string of the service bus topic endpoint. + * + * @return the connectionString value + */ + public String connectionString() { + return this.connectionString; + } + + /** + * Set the connection string of the service bus topic endpoint. + * + * @param connectionString the connectionString value to set + * @return the RoutingServiceBusTopicEndpointProperties object itself. + */ + public RoutingServiceBusTopicEndpointProperties withConnectionString(String connectionString) { + this.connectionString = connectionString; + return this; + } + + /** + * Get the url of the service bus topic endpoint. It must include the protocol sb://. + * + * @return the endpointUri value + */ + public String endpointUri() { + return this.endpointUri; + } + + /** + * Set the url of the service bus topic endpoint. It must include the protocol sb://. + * + * @param endpointUri the endpointUri value to set + * @return the RoutingServiceBusTopicEndpointProperties object itself. + */ + public RoutingServiceBusTopicEndpointProperties withEndpointUri(String endpointUri) { + this.endpointUri = endpointUri; + return this; + } + + /** + * Get queue name on the service bus topic. + * + * @return the entityPath value + */ + public String entityPath() { + return this.entityPath; + } + + /** + * Set queue name on the service bus topic. + * + * @param entityPath the entityPath value to set + * @return the RoutingServiceBusTopicEndpointProperties object itself. + */ + public RoutingServiceBusTopicEndpointProperties withEntityPath(String entityPath) { + this.entityPath = entityPath; + return this; + } + + /** + * Get method used to authenticate against the service bus topic endpoint. Possible values include: 'keyBased', 'identityBased'. + * + * @return the authenticationType value + */ + public AuthenticationType authenticationType() { + return this.authenticationType; + } + + /** + * Set method used to authenticate against the service bus topic endpoint. Possible values include: 'keyBased', 'identityBased'. + * + * @param authenticationType the authenticationType value to set + * @return the RoutingServiceBusTopicEndpointProperties object itself. + */ + public RoutingServiceBusTopicEndpointProperties withAuthenticationType(AuthenticationType authenticationType) { + this.authenticationType = authenticationType; + return this; + } + + /** + * Get the name that identifies this endpoint. The name can only include alphanumeric characters, periods, underscores, hyphens and has a maximum length of 64 characters. The following names are reserved: events, fileNotifications, $default. Endpoint names must be unique across endpoint types. The name need not be the same as the actual topic name. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name that identifies this endpoint. The name can only include alphanumeric characters, periods, underscores, hyphens and has a maximum length of 64 characters. The following names are reserved: events, fileNotifications, $default. Endpoint names must be unique across endpoint types. The name need not be the same as the actual topic name. + * + * @param name the name value to set + * @return the RoutingServiceBusTopicEndpointProperties object itself. + */ + public RoutingServiceBusTopicEndpointProperties withName(String name) { + this.name = name; + return this; + } + + /** + * Get the subscription identifier of the service bus topic endpoint. + * + * @return the subscriptionId value + */ + public String subscriptionId() { + return this.subscriptionId; + } + + /** + * Set the subscription identifier of the service bus topic endpoint. + * + * @param subscriptionId the subscriptionId value to set + * @return the RoutingServiceBusTopicEndpointProperties object itself. + */ + public RoutingServiceBusTopicEndpointProperties withSubscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; + return this; + } + + /** + * Get the name of the resource group of the service bus topic endpoint. + * + * @return the resourceGroup value + */ + public String resourceGroup() { + return this.resourceGroup; + } + + /** + * Set the name of the resource group of the service bus topic endpoint. + * + * @param resourceGroup the resourceGroup value to set + * @return the RoutingServiceBusTopicEndpointProperties object itself. + */ + public RoutingServiceBusTopicEndpointProperties withResourceGroup(String resourceGroup) { + this.resourceGroup = resourceGroup; + return this; + } + +} diff --git a/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/RoutingSource.java b/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/RoutingSource.java new file mode 100644 index 0000000000000..36bf2ad069749 --- /dev/null +++ b/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/RoutingSource.java @@ -0,0 +1,50 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.iothub.v2020_03_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for RoutingSource. + */ +public final class RoutingSource extends ExpandableStringEnum { + /** Static value Invalid for RoutingSource. */ + public static final RoutingSource INVALID = fromString("Invalid"); + + /** Static value DeviceMessages for RoutingSource. */ + public static final RoutingSource DEVICE_MESSAGES = fromString("DeviceMessages"); + + /** Static value TwinChangeEvents for RoutingSource. */ + public static final RoutingSource TWIN_CHANGE_EVENTS = fromString("TwinChangeEvents"); + + /** Static value DeviceLifecycleEvents for RoutingSource. */ + public static final RoutingSource DEVICE_LIFECYCLE_EVENTS = fromString("DeviceLifecycleEvents"); + + /** Static value DeviceJobLifecycleEvents for RoutingSource. */ + public static final RoutingSource DEVICE_JOB_LIFECYCLE_EVENTS = fromString("DeviceJobLifecycleEvents"); + + /** + * Creates or finds a RoutingSource from its string representation. + * @param name a name to look for + * @return the corresponding RoutingSource + */ + @JsonCreator + public static RoutingSource fromString(String name) { + return fromString(name, RoutingSource.class); + } + + /** + * @return known RoutingSource values + */ + public static Collection values() { + return values(RoutingSource.class); + } +} diff --git a/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/RoutingStorageContainerProperties.java b/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/RoutingStorageContainerProperties.java new file mode 100644 index 0000000000000..6055450f58996 --- /dev/null +++ b/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/RoutingStorageContainerProperties.java @@ -0,0 +1,341 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.iothub.v2020_03_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The properties related to a storage container endpoint. + */ +public class RoutingStorageContainerProperties { + /** + * Id of the storage container endpoint. + */ + @JsonProperty(value = "id") + private String id; + + /** + * The connection string of the storage account. + */ + @JsonProperty(value = "connectionString") + private String connectionString; + + /** + * The url of the storage endpoint. It must include the protocol https://. + */ + @JsonProperty(value = "endpointUri") + private String endpointUri; + + /** + * Method used to authenticate against the storage endpoint. Possible + * values include: 'keyBased', 'identityBased'. + */ + @JsonProperty(value = "authenticationType") + private AuthenticationType authenticationType; + + /** + * The name that identifies this endpoint. The name can only include + * alphanumeric characters, periods, underscores, hyphens and has a maximum + * length of 64 characters. The following names are reserved: events, + * fileNotifications, $default. Endpoint names must be unique across + * endpoint types. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /** + * The subscription identifier of the storage account. + */ + @JsonProperty(value = "subscriptionId") + private String subscriptionId; + + /** + * The name of the resource group of the storage account. + */ + @JsonProperty(value = "resourceGroup") + private String resourceGroup; + + /** + * The name of storage container in the storage account. + */ + @JsonProperty(value = "containerName", required = true) + private String containerName; + + /** + * File name format for the blob. Default format is + * {iothub}/{partition}/{YYYY}/{MM}/{DD}/{HH}/{mm}. All parameters are + * mandatory but can be reordered. + */ + @JsonProperty(value = "fileNameFormat") + private String fileNameFormat; + + /** + * Time interval at which blobs are written to storage. Value should be + * between 60 and 720 seconds. Default value is 300 seconds. + */ + @JsonProperty(value = "batchFrequencyInSeconds") + private Integer batchFrequencyInSeconds; + + /** + * Maximum number of bytes for each blob written to storage. Value should + * be between 10485760(10MB) and 524288000(500MB). Default value is + * 314572800(300MB). + */ + @JsonProperty(value = "maxChunkSizeInBytes") + private Integer maxChunkSizeInBytes; + + /** + * Encoding that is used to serialize messages to blobs. Supported values + * are 'avro', 'avrodeflate', and 'JSON'. Default value is 'avro'. Possible + * values include: 'Avro', 'AvroDeflate', 'JSON'. + */ + @JsonProperty(value = "encoding") + private String encoding; + + /** + * Get id of the storage container endpoint. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set id of the storage container endpoint. + * + * @param id the id value to set + * @return the RoutingStorageContainerProperties object itself. + */ + public RoutingStorageContainerProperties withId(String id) { + this.id = id; + return this; + } + + /** + * Get the connection string of the storage account. + * + * @return the connectionString value + */ + public String connectionString() { + return this.connectionString; + } + + /** + * Set the connection string of the storage account. + * + * @param connectionString the connectionString value to set + * @return the RoutingStorageContainerProperties object itself. + */ + public RoutingStorageContainerProperties withConnectionString(String connectionString) { + this.connectionString = connectionString; + return this; + } + + /** + * Get the url of the storage endpoint. It must include the protocol https://. + * + * @return the endpointUri value + */ + public String endpointUri() { + return this.endpointUri; + } + + /** + * Set the url of the storage endpoint. It must include the protocol https://. + * + * @param endpointUri the endpointUri value to set + * @return the RoutingStorageContainerProperties object itself. + */ + public RoutingStorageContainerProperties withEndpointUri(String endpointUri) { + this.endpointUri = endpointUri; + return this; + } + + /** + * Get method used to authenticate against the storage endpoint. Possible values include: 'keyBased', 'identityBased'. + * + * @return the authenticationType value + */ + public AuthenticationType authenticationType() { + return this.authenticationType; + } + + /** + * Set method used to authenticate against the storage endpoint. Possible values include: 'keyBased', 'identityBased'. + * + * @param authenticationType the authenticationType value to set + * @return the RoutingStorageContainerProperties object itself. + */ + public RoutingStorageContainerProperties withAuthenticationType(AuthenticationType authenticationType) { + this.authenticationType = authenticationType; + return this; + } + + /** + * Get the name that identifies this endpoint. The name can only include alphanumeric characters, periods, underscores, hyphens and has a maximum length of 64 characters. The following names are reserved: events, fileNotifications, $default. Endpoint names must be unique across endpoint types. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name that identifies this endpoint. The name can only include alphanumeric characters, periods, underscores, hyphens and has a maximum length of 64 characters. The following names are reserved: events, fileNotifications, $default. Endpoint names must be unique across endpoint types. + * + * @param name the name value to set + * @return the RoutingStorageContainerProperties object itself. + */ + public RoutingStorageContainerProperties withName(String name) { + this.name = name; + return this; + } + + /** + * Get the subscription identifier of the storage account. + * + * @return the subscriptionId value + */ + public String subscriptionId() { + return this.subscriptionId; + } + + /** + * Set the subscription identifier of the storage account. + * + * @param subscriptionId the subscriptionId value to set + * @return the RoutingStorageContainerProperties object itself. + */ + public RoutingStorageContainerProperties withSubscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; + return this; + } + + /** + * Get the name of the resource group of the storage account. + * + * @return the resourceGroup value + */ + public String resourceGroup() { + return this.resourceGroup; + } + + /** + * Set the name of the resource group of the storage account. + * + * @param resourceGroup the resourceGroup value to set + * @return the RoutingStorageContainerProperties object itself. + */ + public RoutingStorageContainerProperties withResourceGroup(String resourceGroup) { + this.resourceGroup = resourceGroup; + return this; + } + + /** + * Get the name of storage container in the storage account. + * + * @return the containerName value + */ + public String containerName() { + return this.containerName; + } + + /** + * Set the name of storage container in the storage account. + * + * @param containerName the containerName value to set + * @return the RoutingStorageContainerProperties object itself. + */ + public RoutingStorageContainerProperties withContainerName(String containerName) { + this.containerName = containerName; + return this; + } + + /** + * Get file name format for the blob. Default format is {iothub}/{partition}/{YYYY}/{MM}/{DD}/{HH}/{mm}. All parameters are mandatory but can be reordered. + * + * @return the fileNameFormat value + */ + public String fileNameFormat() { + return this.fileNameFormat; + } + + /** + * Set file name format for the blob. Default format is {iothub}/{partition}/{YYYY}/{MM}/{DD}/{HH}/{mm}. All parameters are mandatory but can be reordered. + * + * @param fileNameFormat the fileNameFormat value to set + * @return the RoutingStorageContainerProperties object itself. + */ + public RoutingStorageContainerProperties withFileNameFormat(String fileNameFormat) { + this.fileNameFormat = fileNameFormat; + return this; + } + + /** + * Get time interval at which blobs are written to storage. Value should be between 60 and 720 seconds. Default value is 300 seconds. + * + * @return the batchFrequencyInSeconds value + */ + public Integer batchFrequencyInSeconds() { + return this.batchFrequencyInSeconds; + } + + /** + * Set time interval at which blobs are written to storage. Value should be between 60 and 720 seconds. Default value is 300 seconds. + * + * @param batchFrequencyInSeconds the batchFrequencyInSeconds value to set + * @return the RoutingStorageContainerProperties object itself. + */ + public RoutingStorageContainerProperties withBatchFrequencyInSeconds(Integer batchFrequencyInSeconds) { + this.batchFrequencyInSeconds = batchFrequencyInSeconds; + return this; + } + + /** + * Get maximum number of bytes for each blob written to storage. Value should be between 10485760(10MB) and 524288000(500MB). Default value is 314572800(300MB). + * + * @return the maxChunkSizeInBytes value + */ + public Integer maxChunkSizeInBytes() { + return this.maxChunkSizeInBytes; + } + + /** + * Set maximum number of bytes for each blob written to storage. Value should be between 10485760(10MB) and 524288000(500MB). Default value is 314572800(300MB). + * + * @param maxChunkSizeInBytes the maxChunkSizeInBytes value to set + * @return the RoutingStorageContainerProperties object itself. + */ + public RoutingStorageContainerProperties withMaxChunkSizeInBytes(Integer maxChunkSizeInBytes) { + this.maxChunkSizeInBytes = maxChunkSizeInBytes; + return this; + } + + /** + * Get encoding that is used to serialize messages to blobs. Supported values are 'avro', 'avrodeflate', and 'JSON'. Default value is 'avro'. Possible values include: 'Avro', 'AvroDeflate', 'JSON'. + * + * @return the encoding value + */ + public String encoding() { + return this.encoding; + } + + /** + * Set encoding that is used to serialize messages to blobs. Supported values are 'avro', 'avrodeflate', and 'JSON'. Default value is 'avro'. Possible values include: 'Avro', 'AvroDeflate', 'JSON'. + * + * @param encoding the encoding value to set + * @return the RoutingStorageContainerProperties object itself. + */ + public RoutingStorageContainerProperties withEncoding(String encoding) { + this.encoding = encoding; + return this; + } + +} diff --git a/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/RoutingTwin.java b/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/RoutingTwin.java new file mode 100644 index 0000000000000..4f2bc2ddcd093 --- /dev/null +++ b/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/RoutingTwin.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.iothub.v2020_03_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Twin reference input parameter. This is an optional parameter. + */ +public class RoutingTwin { + /** + * Twin Tags. + */ + @JsonProperty(value = "tags") + private Object tags; + + /** + * The properties property. + */ + @JsonProperty(value = "properties") + private RoutingTwinProperties properties; + + /** + * Get twin Tags. + * + * @return the tags value + */ + public Object tags() { + return this.tags; + } + + /** + * Set twin Tags. + * + * @param tags the tags value to set + * @return the RoutingTwin object itself. + */ + public RoutingTwin withTags(Object tags) { + this.tags = tags; + return this; + } + + /** + * Get the properties value. + * + * @return the properties value + */ + public RoutingTwinProperties properties() { + return this.properties; + } + + /** + * Set the properties value. + * + * @param properties the properties value to set + * @return the RoutingTwin object itself. + */ + public RoutingTwin withProperties(RoutingTwinProperties properties) { + this.properties = properties; + return this; + } + +} diff --git a/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/RoutingTwinProperties.java b/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/RoutingTwinProperties.java new file mode 100644 index 0000000000000..368eeadac70c5 --- /dev/null +++ b/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/RoutingTwinProperties.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.iothub.v2020_03_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The RoutingTwinProperties model. + */ +public class RoutingTwinProperties { + /** + * Twin desired properties. + */ + @JsonProperty(value = "desired") + private Object desired; + + /** + * Twin desired properties. + */ + @JsonProperty(value = "reported") + private Object reported; + + /** + * Get twin desired properties. + * + * @return the desired value + */ + public Object desired() { + return this.desired; + } + + /** + * Set twin desired properties. + * + * @param desired the desired value to set + * @return the RoutingTwinProperties object itself. + */ + public RoutingTwinProperties withDesired(Object desired) { + this.desired = desired; + return this; + } + + /** + * Get twin desired properties. + * + * @return the reported value + */ + public Object reported() { + return this.reported; + } + + /** + * Set twin desired properties. + * + * @param reported the reported value to set + * @return the RoutingTwinProperties object itself. + */ + public RoutingTwinProperties withReported(Object reported) { + this.reported = reported; + return this; + } + +} diff --git a/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/SharedAccessSignatureAuthorizationRule.java b/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/SharedAccessSignatureAuthorizationRule.java new file mode 100644 index 0000000000000..a33985f05424e --- /dev/null +++ b/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/SharedAccessSignatureAuthorizationRule.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.iothub.v2020_03_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.iothub.v2020_03_01.implementation.DevicesManager; +import com.microsoft.azure.management.iothub.v2020_03_01.implementation.SharedAccessSignatureAuthorizationRuleInner; + +/** + * Type representing SharedAccessSignatureAuthorizationRule. + */ +public interface SharedAccessSignatureAuthorizationRule extends HasInner, HasManager { + /** + * @return the keyName value. + */ + String keyName(); + + /** + * @return the primaryKey value. + */ + String primaryKey(); + + /** + * @return the rights value. + */ + AccessRights rights(); + + /** + * @return the secondaryKey value. + */ + String secondaryKey(); + +} diff --git a/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/StorageEndpointProperties.java b/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/StorageEndpointProperties.java new file mode 100644 index 0000000000000..274f8dad2f200 --- /dev/null +++ b/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/StorageEndpointProperties.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.iothub.v2020_03_01; + +import org.joda.time.Period; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The properties of the Azure Storage endpoint for file upload. + */ +public class StorageEndpointProperties { + /** + * The period of time for which the SAS URI generated by IoT Hub for file + * upload is valid. See: + * https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-file-upload#file-upload-notification-configuration-options. + */ + @JsonProperty(value = "sasTtlAsIso8601") + private Period sasTtlAsIso8601; + + /** + * The connection string for the Azure Storage account to which files are + * uploaded. + */ + @JsonProperty(value = "connectionString", required = true) + private String connectionString; + + /** + * The name of the root container where you upload files. The container + * need not exist but should be creatable using the connectionString + * specified. + */ + @JsonProperty(value = "containerName", required = true) + private String containerName; + + /** + * Specifies authentication type being used for connecting to the storage + * account. Possible values include: 'keyBased', 'identityBased'. + */ + @JsonProperty(value = "authenticationType") + private AuthenticationType authenticationType; + + /** + * Get the period of time for which the SAS URI generated by IoT Hub for file upload is valid. See: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-file-upload#file-upload-notification-configuration-options. + * + * @return the sasTtlAsIso8601 value + */ + public Period sasTtlAsIso8601() { + return this.sasTtlAsIso8601; + } + + /** + * Set the period of time for which the SAS URI generated by IoT Hub for file upload is valid. See: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-file-upload#file-upload-notification-configuration-options. + * + * @param sasTtlAsIso8601 the sasTtlAsIso8601 value to set + * @return the StorageEndpointProperties object itself. + */ + public StorageEndpointProperties withSasTtlAsIso8601(Period sasTtlAsIso8601) { + this.sasTtlAsIso8601 = sasTtlAsIso8601; + return this; + } + + /** + * Get the connection string for the Azure Storage account to which files are uploaded. + * + * @return the connectionString value + */ + public String connectionString() { + return this.connectionString; + } + + /** + * Set the connection string for the Azure Storage account to which files are uploaded. + * + * @param connectionString the connectionString value to set + * @return the StorageEndpointProperties object itself. + */ + public StorageEndpointProperties withConnectionString(String connectionString) { + this.connectionString = connectionString; + return this; + } + + /** + * Get the name of the root container where you upload files. The container need not exist but should be creatable using the connectionString specified. + * + * @return the containerName value + */ + public String containerName() { + return this.containerName; + } + + /** + * Set the name of the root container where you upload files. The container need not exist but should be creatable using the connectionString specified. + * + * @param containerName the containerName value to set + * @return the StorageEndpointProperties object itself. + */ + public StorageEndpointProperties withContainerName(String containerName) { + this.containerName = containerName; + return this; + } + + /** + * Get specifies authentication type being used for connecting to the storage account. Possible values include: 'keyBased', 'identityBased'. + * + * @return the authenticationType value + */ + public AuthenticationType authenticationType() { + return this.authenticationType; + } + + /** + * Set specifies authentication type being used for connecting to the storage account. Possible values include: 'keyBased', 'identityBased'. + * + * @param authenticationType the authenticationType value to set + * @return the StorageEndpointProperties object itself. + */ + public StorageEndpointProperties withAuthenticationType(AuthenticationType authenticationType) { + this.authenticationType = authenticationType; + return this; + } + +} diff --git a/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/TagsResource.java b/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/TagsResource.java new file mode 100644 index 0000000000000..551d58b99e7d1 --- /dev/null +++ b/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/TagsResource.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.iothub.v2020_03_01; + +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * A container holding only the Tags for a resource, allowing the user to + * update the tags on an IoT Hub instance. + */ +public class TagsResource { + /** + * Resource tags. + */ + @JsonProperty(value = "tags") + private Map tags; + + /** + * Get resource tags. + * + * @return the tags value + */ + public Map tags() { + return this.tags; + } + + /** + * Set resource tags. + * + * @param tags the tags value to set + * @return the TagsResource object itself. + */ + public TagsResource withTags(Map tags) { + this.tags = tags; + return this; + } + +} diff --git a/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/TestAllRoutesInput.java b/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/TestAllRoutesInput.java new file mode 100644 index 0000000000000..91cc1b9935e80 --- /dev/null +++ b/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/TestAllRoutesInput.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.iothub.v2020_03_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Input for testing all routes. + */ +public class TestAllRoutesInput { + /** + * Routing source. Possible values include: 'Invalid', 'DeviceMessages', + * 'TwinChangeEvents', 'DeviceLifecycleEvents', 'DeviceJobLifecycleEvents'. + */ + @JsonProperty(value = "routingSource") + private RoutingSource routingSource; + + /** + * Routing message. + */ + @JsonProperty(value = "message") + private RoutingMessage message; + + /** + * Routing Twin Reference. + */ + @JsonProperty(value = "twin") + private RoutingTwin twin; + + /** + * Get routing source. Possible values include: 'Invalid', 'DeviceMessages', 'TwinChangeEvents', 'DeviceLifecycleEvents', 'DeviceJobLifecycleEvents'. + * + * @return the routingSource value + */ + public RoutingSource routingSource() { + return this.routingSource; + } + + /** + * Set routing source. Possible values include: 'Invalid', 'DeviceMessages', 'TwinChangeEvents', 'DeviceLifecycleEvents', 'DeviceJobLifecycleEvents'. + * + * @param routingSource the routingSource value to set + * @return the TestAllRoutesInput object itself. + */ + public TestAllRoutesInput withRoutingSource(RoutingSource routingSource) { + this.routingSource = routingSource; + return this; + } + + /** + * Get routing message. + * + * @return the message value + */ + public RoutingMessage message() { + return this.message; + } + + /** + * Set routing message. + * + * @param message the message value to set + * @return the TestAllRoutesInput object itself. + */ + public TestAllRoutesInput withMessage(RoutingMessage message) { + this.message = message; + return this; + } + + /** + * Get routing Twin Reference. + * + * @return the twin value + */ + public RoutingTwin twin() { + return this.twin; + } + + /** + * Set routing Twin Reference. + * + * @param twin the twin value to set + * @return the TestAllRoutesInput object itself. + */ + public TestAllRoutesInput withTwin(RoutingTwin twin) { + this.twin = twin; + return this; + } + +} diff --git a/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/TestAllRoutesResult.java b/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/TestAllRoutesResult.java new file mode 100644 index 0000000000000..b455d15b652f8 --- /dev/null +++ b/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/TestAllRoutesResult.java @@ -0,0 +1,26 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.iothub.v2020_03_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.iothub.v2020_03_01.implementation.DevicesManager; +import com.microsoft.azure.management.iothub.v2020_03_01.implementation.TestAllRoutesResultInner; +import java.util.List; + +/** + * Type representing TestAllRoutesResult. + */ +public interface TestAllRoutesResult extends HasInner, HasManager { + /** + * @return the routes value. + */ + List routes(); + +} diff --git a/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/TestResultStatus.java b/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/TestResultStatus.java new file mode 100644 index 0000000000000..9c941784d837e --- /dev/null +++ b/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/TestResultStatus.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.iothub.v2020_03_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for TestResultStatus. + */ +public final class TestResultStatus extends ExpandableStringEnum { + /** Static value undefined for TestResultStatus. */ + public static final TestResultStatus UNDEFINED = fromString("undefined"); + + /** Static value false for TestResultStatus. */ + public static final TestResultStatus FALSE = fromString("false"); + + /** Static value true for TestResultStatus. */ + public static final TestResultStatus TRUE = fromString("true"); + + /** + * Creates or finds a TestResultStatus from its string representation. + * @param name a name to look for + * @return the corresponding TestResultStatus + */ + @JsonCreator + public static TestResultStatus fromString(String name) { + return fromString(name, TestResultStatus.class); + } + + /** + * @return known TestResultStatus values + */ + public static Collection values() { + return values(TestResultStatus.class); + } +} diff --git a/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/TestRouteInput.java b/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/TestRouteInput.java new file mode 100644 index 0000000000000..335590c3291e5 --- /dev/null +++ b/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/TestRouteInput.java @@ -0,0 +1,95 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.iothub.v2020_03_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Input for testing route. + */ +public class TestRouteInput { + /** + * Routing message. + */ + @JsonProperty(value = "message") + private RoutingMessage message; + + /** + * Route properties. + */ + @JsonProperty(value = "route", required = true) + private RouteProperties route; + + /** + * Routing Twin Reference. + */ + @JsonProperty(value = "twin") + private RoutingTwin twin; + + /** + * Get routing message. + * + * @return the message value + */ + public RoutingMessage message() { + return this.message; + } + + /** + * Set routing message. + * + * @param message the message value to set + * @return the TestRouteInput object itself. + */ + public TestRouteInput withMessage(RoutingMessage message) { + this.message = message; + return this; + } + + /** + * Get route properties. + * + * @return the route value + */ + public RouteProperties route() { + return this.route; + } + + /** + * Set route properties. + * + * @param route the route value to set + * @return the TestRouteInput object itself. + */ + public TestRouteInput withRoute(RouteProperties route) { + this.route = route; + return this; + } + + /** + * Get routing Twin Reference. + * + * @return the twin value + */ + public RoutingTwin twin() { + return this.twin; + } + + /** + * Set routing Twin Reference. + * + * @param twin the twin value to set + * @return the TestRouteInput object itself. + */ + public TestRouteInput withTwin(RoutingTwin twin) { + this.twin = twin; + return this; + } + +} diff --git a/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/TestRouteResult.java b/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/TestRouteResult.java new file mode 100644 index 0000000000000..4e52c2e46e4e4 --- /dev/null +++ b/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/TestRouteResult.java @@ -0,0 +1,30 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.iothub.v2020_03_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.iothub.v2020_03_01.implementation.DevicesManager; +import com.microsoft.azure.management.iothub.v2020_03_01.implementation.TestRouteResultInner; + +/** + * Type representing TestRouteResult. + */ +public interface TestRouteResult extends HasInner, HasManager { + /** + * @return the details value. + */ + TestRouteResultDetails details(); + + /** + * @return the result value. + */ + TestResultStatus result(); + +} diff --git a/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/TestRouteResultDetails.java b/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/TestRouteResultDetails.java new file mode 100644 index 0000000000000..0e4ad45ff33ca --- /dev/null +++ b/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/TestRouteResultDetails.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.iothub.v2020_03_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Detailed result of testing a route. + */ +public class TestRouteResultDetails { + /** + * JSON-serialized list of route compilation errors. + */ + @JsonProperty(value = "compilationErrors") + private List compilationErrors; + + /** + * Get jSON-serialized list of route compilation errors. + * + * @return the compilationErrors value + */ + public List compilationErrors() { + return this.compilationErrors; + } + + /** + * Set jSON-serialized list of route compilation errors. + * + * @param compilationErrors the compilationErrors value to set + * @return the TestRouteResultDetails object itself. + */ + public TestRouteResultDetails withCompilationErrors(List compilationErrors) { + this.compilationErrors = compilationErrors; + return this; + } + +} diff --git a/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/UserSubscriptionQuota.java b/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/UserSubscriptionQuota.java new file mode 100644 index 0000000000000..f476070a79e2b --- /dev/null +++ b/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/UserSubscriptionQuota.java @@ -0,0 +1,50 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.iothub.v2020_03_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.iothub.v2020_03_01.implementation.DevicesManager; +import com.microsoft.azure.management.iothub.v2020_03_01.implementation.UserSubscriptionQuotaInner; + +/** + * Type representing UserSubscriptionQuota. + */ +public interface UserSubscriptionQuota extends HasInner, HasManager { + /** + * @return the currentValue value. + */ + Integer currentValue(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the limit value. + */ + Integer limit(); + + /** + * @return the name value. + */ + Name name(); + + /** + * @return the type value. + */ + String type(); + + /** + * @return the unit value. + */ + String unit(); + +} diff --git a/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/implementation/CertificateDescriptionImpl.java b/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/implementation/CertificateDescriptionImpl.java new file mode 100644 index 0000000000000..7252c19dabb8c --- /dev/null +++ b/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/implementation/CertificateDescriptionImpl.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.iothub.v2020_03_01.implementation; + +import com.microsoft.azure.management.iothub.v2020_03_01.CertificateDescription; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import com.microsoft.azure.management.iothub.v2020_03_01.CertificateProperties; + +class CertificateDescriptionImpl extends CreatableUpdatableImpl implements CertificateDescription, CertificateDescription.Definition, CertificateDescription.Update { + private final DevicesManager manager; + private String resourceGroupName; + private String resourceName; + private String certificateName; + private String cifMatch; + private String ccertificate; + private String uifMatch; + private String ucertificate; + + CertificateDescriptionImpl(String name, DevicesManager manager) { + super(name, new CertificateDescriptionInner()); + this.manager = manager; + // Set resource name + this.certificateName = name; + // + } + + CertificateDescriptionImpl(CertificateDescriptionInner inner, DevicesManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.certificateName = inner.name(); + // set resource ancestor and positional variables + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.resourceName = IdParsingUtils.getValueFromIdByName(inner.id(), "IotHubs"); + this.certificateName = IdParsingUtils.getValueFromIdByName(inner.id(), "certificates"); + // + } + + @Override + public DevicesManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + CertificatesInner client = this.manager().inner().certificates(); + return client.createOrUpdateAsync(this.resourceGroupName, this.resourceName, this.certificateName, this.cifMatch, this.ccertificate) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + CertificatesInner client = this.manager().inner().certificates(); + return client.createOrUpdateAsync(this.resourceGroupName, this.resourceName, this.certificateName, this.uifMatch, this.ucertificate) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + CertificatesInner client = this.manager().inner().certificates(); + return client.getAsync(this.resourceGroupName, this.resourceName, this.certificateName); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public String etag() { + return this.inner().etag(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public CertificateProperties properties() { + return this.inner().properties(); + } + + @Override + public String type() { + return this.inner().type(); + } + + @Override + public CertificateDescriptionImpl withExistingIotHub(String resourceGroupName, String resourceName) { + this.resourceGroupName = resourceGroupName; + this.resourceName = resourceName; + return this; + } + + @Override + public CertificateDescriptionImpl withIfMatch(String ifMatch) { + if (isInCreateMode()) { + this.cifMatch = ifMatch; + } else { + this.uifMatch = ifMatch; + } + return this; + } + + @Override + public CertificateDescriptionImpl withCertificate(String certificate) { + if (isInCreateMode()) { + this.ccertificate = certificate; + } else { + this.ucertificate = certificate; + } + return this; + } + +} diff --git a/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/implementation/CertificateDescriptionInner.java b/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/implementation/CertificateDescriptionInner.java new file mode 100644 index 0000000000000..439120d5e7abd --- /dev/null +++ b/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/implementation/CertificateDescriptionInner.java @@ -0,0 +1,60 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.iothub.v2020_03_01.implementation; + +import com.microsoft.azure.management.iothub.v2020_03_01.CertificateProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.azure.ProxyResource; + +/** + * The X509 Certificate. + */ +public class CertificateDescriptionInner extends ProxyResource { + /** + * The properties property. + */ + @JsonProperty(value = "properties") + private CertificateProperties properties; + + /** + * The entity tag. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /** + * Get the properties value. + * + * @return the properties value + */ + public CertificateProperties properties() { + return this.properties; + } + + /** + * Set the properties value. + * + * @param properties the properties value to set + * @return the CertificateDescriptionInner object itself. + */ + public CertificateDescriptionInner withProperties(CertificateProperties properties) { + this.properties = properties; + return this; + } + + /** + * Get the entity tag. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + +} diff --git a/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/implementation/CertificateListDescriptionImpl.java b/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/implementation/CertificateListDescriptionImpl.java new file mode 100644 index 0000000000000..e3ce29a9b973f --- /dev/null +++ b/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/implementation/CertificateListDescriptionImpl.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.iothub.v2020_03_01.implementation; + +import com.microsoft.azure.management.iothub.v2020_03_01.CertificateListDescription; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import java.util.List; + +class CertificateListDescriptionImpl extends WrapperImpl implements CertificateListDescription { + private final DevicesManager manager; + CertificateListDescriptionImpl(CertificateListDescriptionInner inner, DevicesManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public DevicesManager manager() { + return this.manager; + } + + @Override + public List value() { + return this.inner().value(); + } + +} diff --git a/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/implementation/CertificateListDescriptionInner.java b/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/implementation/CertificateListDescriptionInner.java new file mode 100644 index 0000000000000..5870b9da3f66e --- /dev/null +++ b/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/implementation/CertificateListDescriptionInner.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.iothub.v2020_03_01.implementation; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The JSON-serialized array of Certificate objects. + */ +public class CertificateListDescriptionInner { + /** + * The array of Certificate objects. + */ + @JsonProperty(value = "value") + private List value; + + /** + * Get the array of Certificate objects. + * + * @return the value value + */ + public List value() { + return this.value; + } + + /** + * Set the array of Certificate objects. + * + * @param value the value value to set + * @return the CertificateListDescriptionInner object itself. + */ + public CertificateListDescriptionInner withValue(List value) { + this.value = value; + return this; + } + +} diff --git a/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/implementation/CertificateWithNonceDescriptionImpl.java b/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/implementation/CertificateWithNonceDescriptionImpl.java new file mode 100644 index 0000000000000..c68183727e796 --- /dev/null +++ b/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/implementation/CertificateWithNonceDescriptionImpl.java @@ -0,0 +1,52 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.iothub.v2020_03_01.implementation; + +import com.microsoft.azure.management.iothub.v2020_03_01.CertificateWithNonceDescription; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.iothub.v2020_03_01.CertificatePropertiesWithNonce; + +class CertificateWithNonceDescriptionImpl extends WrapperImpl implements CertificateWithNonceDescription { + private final DevicesManager manager; + CertificateWithNonceDescriptionImpl(CertificateWithNonceDescriptionInner inner, DevicesManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public DevicesManager manager() { + return this.manager; + } + + @Override + public String etag() { + return this.inner().etag(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public CertificatePropertiesWithNonce properties() { + return this.inner().properties(); + } + + @Override + public String type() { + return this.inner().type(); + } + +} diff --git a/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/implementation/CertificateWithNonceDescriptionInner.java b/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/implementation/CertificateWithNonceDescriptionInner.java new file mode 100644 index 0000000000000..1e26a96b1bcf6 --- /dev/null +++ b/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/implementation/CertificateWithNonceDescriptionInner.java @@ -0,0 +1,60 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.iothub.v2020_03_01.implementation; + +import com.microsoft.azure.management.iothub.v2020_03_01.CertificatePropertiesWithNonce; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.azure.ProxyResource; + +/** + * The X509 Certificate. + */ +public class CertificateWithNonceDescriptionInner extends ProxyResource { + /** + * The properties property. + */ + @JsonProperty(value = "properties") + private CertificatePropertiesWithNonce properties; + + /** + * The entity tag. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /** + * Get the properties value. + * + * @return the properties value + */ + public CertificatePropertiesWithNonce properties() { + return this.properties; + } + + /** + * Set the properties value. + * + * @param properties the properties value to set + * @return the CertificateWithNonceDescriptionInner object itself. + */ + public CertificateWithNonceDescriptionInner withProperties(CertificatePropertiesWithNonce properties) { + this.properties = properties; + return this; + } + + /** + * Get the entity tag. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + +} diff --git a/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/implementation/CertificatesImpl.java b/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/implementation/CertificatesImpl.java new file mode 100644 index 0000000000000..46476731a71a4 --- /dev/null +++ b/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/implementation/CertificatesImpl.java @@ -0,0 +1,104 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * + */ + +package com.microsoft.azure.management.iothub.v2020_03_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.iothub.v2020_03_01.Certificates; +import rx.Completable; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.management.iothub.v2020_03_01.CertificateListDescription; +import com.microsoft.azure.management.iothub.v2020_03_01.CertificateWithNonceDescription; +import com.microsoft.azure.management.iothub.v2020_03_01.CertificateDescription; + +class CertificatesImpl extends WrapperImpl implements Certificates { + private final DevicesManager manager; + + CertificatesImpl(DevicesManager manager) { + super(manager.inner().certificates()); + this.manager = manager; + } + + public DevicesManager manager() { + return this.manager; + } + + @Override + public CertificateDescriptionImpl define(String name) { + return wrapModel(name); + } + + private CertificateDescriptionImpl wrapModel(CertificateDescriptionInner inner) { + return new CertificateDescriptionImpl(inner, manager()); + } + + private CertificateDescriptionImpl wrapModel(String name) { + return new CertificateDescriptionImpl(name, this.manager()); + } + + @Override + public Observable listByIotHubAsync(String resourceGroupName, String resourceName) { + CertificatesInner client = this.inner(); + return client.listByIotHubAsync(resourceGroupName, resourceName) + .map(new Func1() { + @Override + public CertificateListDescription call(CertificateListDescriptionInner inner) { + return new CertificateListDescriptionImpl(inner, manager()); + } + }); + } + + @Override + public Observable generateVerificationCodeAsync(String resourceGroupName, String resourceName, String certificateName, String ifMatch) { + CertificatesInner client = this.inner(); + return client.generateVerificationCodeAsync(resourceGroupName, resourceName, certificateName, ifMatch) + .map(new Func1() { + @Override + public CertificateWithNonceDescription call(CertificateWithNonceDescriptionInner inner) { + return new CertificateWithNonceDescriptionImpl(inner, manager()); + } + }); + } + + @Override + public Observable verifyAsync(String resourceGroupName, String resourceName, String certificateName, String ifMatch) { + CertificatesInner client = this.inner(); + return client.verifyAsync(resourceGroupName, resourceName, certificateName, ifMatch) + .map(new Func1() { + @Override + public CertificateDescription call(CertificateDescriptionInner inner) { + return new CertificateDescriptionImpl(inner, manager()); + } + }); + } + + @Override + public Observable getAsync(String resourceGroupName, String resourceName, String certificateName) { + CertificatesInner client = this.inner(); + return client.getAsync(resourceGroupName, resourceName, certificateName) + .flatMap(new Func1>() { + @Override + public Observable call(CertificateDescriptionInner inner) { + if (inner == null) { + return Observable.empty(); + } else { + return Observable.just((CertificateDescription)wrapModel(inner)); + } + } + }); + } + + @Override + public Completable deleteAsync(String resourceGroupName, String resourceName, String certificateName, String ifMatch) { + CertificatesInner client = this.inner(); + return client.deleteAsync(resourceGroupName, resourceName, certificateName, ifMatch).toCompletable(); + } + +} diff --git a/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/implementation/CertificatesInner.java b/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/implementation/CertificatesInner.java new file mode 100644 index 0000000000000..53390a69695bc --- /dev/null +++ b/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/implementation/CertificatesInner.java @@ -0,0 +1,893 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.iothub.v2020_03_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.management.iothub.v2020_03_01.CertificateBodyDescription; +import com.microsoft.azure.management.iothub.v2020_03_01.CertificateVerificationDescription; +import com.microsoft.azure.management.iothub.v2020_03_01.ErrorDetailsInnerException; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.Path; +import retrofit2.http.POST; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Certificates. + */ +public class CertificatesInner { + /** The Retrofit service to perform REST calls. */ + private CertificatesService service; + /** The service client containing this operation class. */ + private IotHubClientImpl client; + + /** + * Initializes an instance of CertificatesInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public CertificatesInner(Retrofit retrofit, IotHubClientImpl client) { + this.service = retrofit.create(CertificatesService.class); + this.client = client; + } + + /** + * The interface defining all the services for Certificates to be + * used by Retrofit to perform actually REST calls. + */ + interface CertificatesService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.iothub.v2020_03_01.Certificates listByIotHub" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}/certificates") + Observable> listByIotHub(@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.iothub.v2020_03_01.Certificates get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}/certificates/{certificateName}") + Observable> get(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("resourceName") String resourceName, @Path("certificateName") String certificateName, @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.iothub.v2020_03_01.Certificates createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}/certificates/{certificateName}") + Observable> createOrUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("resourceName") String resourceName, @Path("certificateName") String certificateName, @Query("api-version") String apiVersion, @Header("If-Match") String ifMatch, @Header("accept-language") String acceptLanguage, @Body CertificateBodyDescription certificateDescription, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.iothub.v2020_03_01.Certificates delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}/certificates/{certificateName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("resourceName") String resourceName, @Path("certificateName") String certificateName, @Query("api-version") String apiVersion, @Header("If-Match") String ifMatch, @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.iothub.v2020_03_01.Certificates generateVerificationCode" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}/certificates/{certificateName}/generateVerificationCode") + Observable> generateVerificationCode(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("resourceName") String resourceName, @Path("certificateName") String certificateName, @Query("api-version") String apiVersion, @Header("If-Match") String ifMatch, @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.iothub.v2020_03_01.Certificates verify" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}/certificates/{certificateName}/verify") + Observable> verify(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("resourceName") String resourceName, @Path("certificateName") String certificateName, @Query("api-version") String apiVersion, @Header("If-Match") String ifMatch, @Header("accept-language") String acceptLanguage, @Body CertificateVerificationDescription certificateVerificationBody, @Header("User-Agent") String userAgent); + + } + + /** + * Get the certificate list. + * Returns the list of certificates. + * + * @param resourceGroupName The name of the resource group that contains the IoT hub. + * @param resourceName The name of the IoT hub. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorDetailsInnerException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the CertificateListDescriptionInner object if successful. + */ + public CertificateListDescriptionInner listByIotHub(String resourceGroupName, String resourceName) { + return listByIotHubWithServiceResponseAsync(resourceGroupName, resourceName).toBlocking().single().body(); + } + + /** + * Get the certificate list. + * Returns the list of certificates. + * + * @param resourceGroupName The name of the resource group that contains the IoT hub. + * @param resourceName The name of the IoT hub. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture listByIotHubAsync(String resourceGroupName, String resourceName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(listByIotHubWithServiceResponseAsync(resourceGroupName, resourceName), serviceCallback); + } + + /** + * Get the certificate list. + * Returns the list of certificates. + * + * @param resourceGroupName The name of the resource group that contains the IoT hub. + * @param resourceName The name of the IoT hub. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the CertificateListDescriptionInner object + */ + public Observable listByIotHubAsync(String resourceGroupName, String resourceName) { + return listByIotHubWithServiceResponseAsync(resourceGroupName, resourceName).map(new Func1, CertificateListDescriptionInner>() { + @Override + public CertificateListDescriptionInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get the certificate list. + * Returns the list of certificates. + * + * @param resourceGroupName The name of the resource group that contains the IoT hub. + * @param resourceName The name of the IoT hub. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the CertificateListDescriptionInner object + */ + public Observable> listByIotHubWithServiceResponseAsync(String resourceGroupName, String resourceName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (resourceName == null) { + throw new IllegalArgumentException("Parameter resourceName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.listByIotHub(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 = listByIotHubDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse listByIotHubDelegate(Response response) throws ErrorDetailsInnerException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorDetailsInnerException.class) + .build(response); + } + + /** + * Get the certificate. + * Returns the certificate. + * + * @param resourceGroupName The name of the resource group that contains the IoT hub. + * @param resourceName The name of the IoT hub. + * @param certificateName The name of the certificate + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorDetailsInnerException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the CertificateDescriptionInner object if successful. + */ + public CertificateDescriptionInner get(String resourceGroupName, String resourceName, String certificateName) { + return getWithServiceResponseAsync(resourceGroupName, resourceName, certificateName).toBlocking().single().body(); + } + + /** + * Get the certificate. + * Returns the certificate. + * + * @param resourceGroupName The name of the resource group that contains the IoT hub. + * @param resourceName The name of the IoT hub. + * @param certificateName The name of the certificate + * @param serviceCallback 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 certificateName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, resourceName, certificateName), serviceCallback); + } + + /** + * Get the certificate. + * Returns the certificate. + * + * @param resourceGroupName The name of the resource group that contains the IoT hub. + * @param resourceName The name of the IoT hub. + * @param certificateName The name of the certificate + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the CertificateDescriptionInner object + */ + public Observable getAsync(String resourceGroupName, String resourceName, String certificateName) { + return getWithServiceResponseAsync(resourceGroupName, resourceName, certificateName).map(new Func1, CertificateDescriptionInner>() { + @Override + public CertificateDescriptionInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get the certificate. + * Returns the certificate. + * + * @param resourceGroupName The name of the resource group that contains the IoT hub. + * @param resourceName The name of the IoT hub. + * @param certificateName The name of the certificate + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the CertificateDescriptionInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String resourceName, String certificateName) { + 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 (certificateName == null) { + throw new IllegalArgumentException("Parameter certificateName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.get(this.client.subscriptionId(), resourceGroupName, resourceName, certificateName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws ErrorDetailsInnerException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorDetailsInnerException.class) + .build(response); + } + + /** + * Upload the certificate to the IoT hub. + * Adds new or replaces existing certificate. + * + * @param resourceGroupName The name of the resource group that contains the IoT hub. + * @param resourceName The name of the IoT hub. + * @param certificateName The name of the certificate + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorDetailsInnerException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the CertificateDescriptionInner object if successful. + */ + public CertificateDescriptionInner createOrUpdate(String resourceGroupName, String resourceName, String certificateName) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, resourceName, certificateName).toBlocking().single().body(); + } + + /** + * Upload the certificate to the IoT hub. + * Adds new or replaces existing certificate. + * + * @param resourceGroupName The name of the resource group that contains the IoT hub. + * @param resourceName The name of the IoT hub. + * @param certificateName The name of the certificate + * @param serviceCallback 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 certificateName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, resourceName, certificateName), serviceCallback); + } + + /** + * Upload the certificate to the IoT hub. + * Adds new or replaces existing certificate. + * + * @param resourceGroupName The name of the resource group that contains the IoT hub. + * @param resourceName The name of the IoT hub. + * @param certificateName The name of the certificate + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the CertificateDescriptionInner object + */ + public Observable createOrUpdateAsync(String resourceGroupName, String resourceName, String certificateName) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, resourceName, certificateName).map(new Func1, CertificateDescriptionInner>() { + @Override + public CertificateDescriptionInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Upload the certificate to the IoT hub. + * Adds new or replaces existing certificate. + * + * @param resourceGroupName The name of the resource group that contains the IoT hub. + * @param resourceName The name of the IoT hub. + * @param certificateName The name of the certificate + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the CertificateDescriptionInner object + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String resourceName, String certificateName) { + 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 (certificateName == null) { + throw new IllegalArgumentException("Parameter certificateName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final String ifMatch = null; + final String certificate = null; + CertificateBodyDescription certificateDescription = new CertificateBodyDescription(); + certificateDescription.withCertificate(null); + return service.createOrUpdate(this.client.subscriptionId(), resourceGroupName, resourceName, certificateName, this.client.apiVersion(), ifMatch, this.client.acceptLanguage(), certificateDescription, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = createOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Upload the certificate to the IoT hub. + * Adds new or replaces existing certificate. + * + * @param resourceGroupName The name of the resource group that contains the IoT hub. + * @param resourceName The name of the IoT hub. + * @param certificateName The name of the certificate + * @param ifMatch ETag of the Certificate. Do not specify for creating a brand new certificate. Required to update an existing certificate. + * @param certificate base-64 representation of the X509 leaf certificate .cer file or just .pem file content. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorDetailsInnerException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the CertificateDescriptionInner object if successful. + */ + public CertificateDescriptionInner createOrUpdate(String resourceGroupName, String resourceName, String certificateName, String ifMatch, String certificate) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, resourceName, certificateName, ifMatch, certificate).toBlocking().single().body(); + } + + /** + * Upload the certificate to the IoT hub. + * Adds new or replaces existing certificate. + * + * @param resourceGroupName The name of the resource group that contains the IoT hub. + * @param resourceName The name of the IoT hub. + * @param certificateName The name of the certificate + * @param ifMatch ETag of the Certificate. Do not specify for creating a brand new certificate. Required to update an existing certificate. + * @param certificate base-64 representation of the X509 leaf certificate .cer file or just .pem file content. + * @param serviceCallback 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 certificateName, String ifMatch, String certificate, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, resourceName, certificateName, ifMatch, certificate), serviceCallback); + } + + /** + * Upload the certificate to the IoT hub. + * Adds new or replaces existing certificate. + * + * @param resourceGroupName The name of the resource group that contains the IoT hub. + * @param resourceName The name of the IoT hub. + * @param certificateName The name of the certificate + * @param ifMatch ETag of the Certificate. Do not specify for creating a brand new certificate. Required to update an existing certificate. + * @param certificate base-64 representation of the X509 leaf certificate .cer file or just .pem file content. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the CertificateDescriptionInner object + */ + public Observable createOrUpdateAsync(String resourceGroupName, String resourceName, String certificateName, String ifMatch, String certificate) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, resourceName, certificateName, ifMatch, certificate).map(new Func1, CertificateDescriptionInner>() { + @Override + public CertificateDescriptionInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Upload the certificate to the IoT hub. + * Adds new or replaces existing certificate. + * + * @param resourceGroupName The name of the resource group that contains the IoT hub. + * @param resourceName The name of the IoT hub. + * @param certificateName The name of the certificate + * @param ifMatch ETag of the Certificate. Do not specify for creating a brand new certificate. Required to update an existing certificate. + * @param certificate base-64 representation of the X509 leaf certificate .cer file or just .pem file content. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the CertificateDescriptionInner object + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String resourceName, String certificateName, String ifMatch, String certificate) { + 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 (certificateName == null) { + throw new IllegalArgumentException("Parameter certificateName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + CertificateBodyDescription certificateDescription = new CertificateBodyDescription(); + certificateDescription.withCertificate(certificate); + return service.createOrUpdate(this.client.subscriptionId(), resourceGroupName, resourceName, certificateName, this.client.apiVersion(), ifMatch, this.client.acceptLanguage(), certificateDescription, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = createOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse createOrUpdateDelegate(Response response) throws ErrorDetailsInnerException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(ErrorDetailsInnerException.class) + .build(response); + } + + /** + * Delete an X509 certificate. + * Deletes an existing X509 certificate or does nothing if it does not exist. + * + * @param resourceGroupName The name of the resource group that contains the IoT hub. + * @param resourceName The name of the IoT hub. + * @param certificateName The name of the certificate + * @param ifMatch ETag of the Certificate. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorDetailsInnerException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String resourceName, String certificateName, String ifMatch) { + deleteWithServiceResponseAsync(resourceGroupName, resourceName, certificateName, ifMatch).toBlocking().single().body(); + } + + /** + * Delete an X509 certificate. + * Deletes an existing X509 certificate or does nothing if it does not exist. + * + * @param resourceGroupName The name of the resource group that contains the IoT hub. + * @param resourceName The name of the IoT hub. + * @param certificateName The name of the certificate + * @param ifMatch ETag of the Certificate. + * @param serviceCallback 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 certificateName, String ifMatch, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, resourceName, certificateName, ifMatch), serviceCallback); + } + + /** + * Delete an X509 certificate. + * Deletes an existing X509 certificate or does nothing if it does not exist. + * + * @param resourceGroupName The name of the resource group that contains the IoT hub. + * @param resourceName The name of the IoT hub. + * @param certificateName The name of the certificate + * @param ifMatch ETag of the Certificate. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable deleteAsync(String resourceGroupName, String resourceName, String certificateName, String ifMatch) { + return deleteWithServiceResponseAsync(resourceGroupName, resourceName, certificateName, ifMatch).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Delete an X509 certificate. + * Deletes an existing X509 certificate or does nothing if it does not exist. + * + * @param resourceGroupName The name of the resource group that contains the IoT hub. + * @param resourceName The name of the IoT hub. + * @param certificateName The name of the certificate + * @param ifMatch ETag of the Certificate. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String resourceName, String certificateName, String ifMatch) { + 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 (certificateName == null) { + throw new IllegalArgumentException("Parameter certificateName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (ifMatch == null) { + throw new IllegalArgumentException("Parameter ifMatch is required and cannot be null."); + } + return service.delete(this.client.subscriptionId(), resourceGroupName, resourceName, certificateName, this.client.apiVersion(), ifMatch, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = deleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse deleteDelegate(Response response) throws ErrorDetailsInnerException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(ErrorDetailsInnerException.class) + .build(response); + } + + /** + * Generate verification code for proof of possession flow. + * Generates verification code for proof of possession flow. The verification code will be used to generate a leaf certificate. + * + * @param resourceGroupName The name of the resource group that contains the IoT hub. + * @param resourceName The name of the IoT hub. + * @param certificateName The name of the certificate + * @param ifMatch ETag of the Certificate. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorDetailsInnerException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the CertificateWithNonceDescriptionInner object if successful. + */ + public CertificateWithNonceDescriptionInner generateVerificationCode(String resourceGroupName, String resourceName, String certificateName, String ifMatch) { + return generateVerificationCodeWithServiceResponseAsync(resourceGroupName, resourceName, certificateName, ifMatch).toBlocking().single().body(); + } + + /** + * Generate verification code for proof of possession flow. + * Generates verification code for proof of possession flow. The verification code will be used to generate a leaf certificate. + * + * @param resourceGroupName The name of the resource group that contains the IoT hub. + * @param resourceName The name of the IoT hub. + * @param certificateName The name of the certificate + * @param ifMatch ETag of the Certificate. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture generateVerificationCodeAsync(String resourceGroupName, String resourceName, String certificateName, String ifMatch, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(generateVerificationCodeWithServiceResponseAsync(resourceGroupName, resourceName, certificateName, ifMatch), serviceCallback); + } + + /** + * Generate verification code for proof of possession flow. + * Generates verification code for proof of possession flow. The verification code will be used to generate a leaf certificate. + * + * @param resourceGroupName The name of the resource group that contains the IoT hub. + * @param resourceName The name of the IoT hub. + * @param certificateName The name of the certificate + * @param ifMatch ETag of the Certificate. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the CertificateWithNonceDescriptionInner object + */ + public Observable generateVerificationCodeAsync(String resourceGroupName, String resourceName, String certificateName, String ifMatch) { + return generateVerificationCodeWithServiceResponseAsync(resourceGroupName, resourceName, certificateName, ifMatch).map(new Func1, CertificateWithNonceDescriptionInner>() { + @Override + public CertificateWithNonceDescriptionInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Generate verification code for proof of possession flow. + * Generates verification code for proof of possession flow. The verification code will be used to generate a leaf certificate. + * + * @param resourceGroupName The name of the resource group that contains the IoT hub. + * @param resourceName The name of the IoT hub. + * @param certificateName The name of the certificate + * @param ifMatch ETag of the Certificate. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the CertificateWithNonceDescriptionInner object + */ + public Observable> generateVerificationCodeWithServiceResponseAsync(String resourceGroupName, String resourceName, String certificateName, String ifMatch) { + 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 (certificateName == null) { + throw new IllegalArgumentException("Parameter certificateName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (ifMatch == null) { + throw new IllegalArgumentException("Parameter ifMatch is required and cannot be null."); + } + return service.generateVerificationCode(this.client.subscriptionId(), resourceGroupName, resourceName, certificateName, this.client.apiVersion(), ifMatch, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = generateVerificationCodeDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse generateVerificationCodeDelegate(Response response) throws ErrorDetailsInnerException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorDetailsInnerException.class) + .build(response); + } + + /** + * Verify certificate's private key possession. + * Verifies the certificate's private key possession by providing the leaf cert issued by the verifying pre uploaded certificate. + * + * @param resourceGroupName The name of the resource group that contains the IoT hub. + * @param resourceName The name of the IoT hub. + * @param certificateName The name of the certificate + * @param ifMatch ETag of the Certificate. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorDetailsInnerException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the CertificateDescriptionInner object if successful. + */ + public CertificateDescriptionInner verify(String resourceGroupName, String resourceName, String certificateName, String ifMatch) { + return verifyWithServiceResponseAsync(resourceGroupName, resourceName, certificateName, ifMatch).toBlocking().single().body(); + } + + /** + * Verify certificate's private key possession. + * Verifies the certificate's private key possession by providing the leaf cert issued by the verifying pre uploaded certificate. + * + * @param resourceGroupName The name of the resource group that contains the IoT hub. + * @param resourceName The name of the IoT hub. + * @param certificateName The name of the certificate + * @param ifMatch ETag of the Certificate. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture verifyAsync(String resourceGroupName, String resourceName, String certificateName, String ifMatch, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(verifyWithServiceResponseAsync(resourceGroupName, resourceName, certificateName, ifMatch), serviceCallback); + } + + /** + * Verify certificate's private key possession. + * Verifies the certificate's private key possession by providing the leaf cert issued by the verifying pre uploaded certificate. + * + * @param resourceGroupName The name of the resource group that contains the IoT hub. + * @param resourceName The name of the IoT hub. + * @param certificateName The name of the certificate + * @param ifMatch ETag of the Certificate. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the CertificateDescriptionInner object + */ + public Observable verifyAsync(String resourceGroupName, String resourceName, String certificateName, String ifMatch) { + return verifyWithServiceResponseAsync(resourceGroupName, resourceName, certificateName, ifMatch).map(new Func1, CertificateDescriptionInner>() { + @Override + public CertificateDescriptionInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Verify certificate's private key possession. + * Verifies the certificate's private key possession by providing the leaf cert issued by the verifying pre uploaded certificate. + * + * @param resourceGroupName The name of the resource group that contains the IoT hub. + * @param resourceName The name of the IoT hub. + * @param certificateName The name of the certificate + * @param ifMatch ETag of the Certificate. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the CertificateDescriptionInner object + */ + public Observable> verifyWithServiceResponseAsync(String resourceGroupName, String resourceName, String certificateName, String ifMatch) { + 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 (certificateName == null) { + throw new IllegalArgumentException("Parameter certificateName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (ifMatch == null) { + throw new IllegalArgumentException("Parameter ifMatch is required and cannot be null."); + } + final String certificate = null; + CertificateVerificationDescription certificateVerificationBody = new CertificateVerificationDescription(); + certificateVerificationBody.withCertificate(null); + return service.verify(this.client.subscriptionId(), resourceGroupName, resourceName, certificateName, this.client.apiVersion(), ifMatch, this.client.acceptLanguage(), certificateVerificationBody, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = verifyDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Verify certificate's private key possession. + * Verifies the certificate's private key possession by providing the leaf cert issued by the verifying pre uploaded certificate. + * + * @param resourceGroupName The name of the resource group that contains the IoT hub. + * @param resourceName The name of the IoT hub. + * @param certificateName The name of the certificate + * @param ifMatch ETag of the Certificate. + * @param certificate base-64 representation of X509 certificate .cer file or just .pem file content. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorDetailsInnerException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the CertificateDescriptionInner object if successful. + */ + public CertificateDescriptionInner verify(String resourceGroupName, String resourceName, String certificateName, String ifMatch, String certificate) { + return verifyWithServiceResponseAsync(resourceGroupName, resourceName, certificateName, ifMatch, certificate).toBlocking().single().body(); + } + + /** + * Verify certificate's private key possession. + * Verifies the certificate's private key possession by providing the leaf cert issued by the verifying pre uploaded certificate. + * + * @param resourceGroupName The name of the resource group that contains the IoT hub. + * @param resourceName The name of the IoT hub. + * @param certificateName The name of the certificate + * @param ifMatch ETag of the Certificate. + * @param certificate base-64 representation of X509 certificate .cer file or just .pem file content. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture verifyAsync(String resourceGroupName, String resourceName, String certificateName, String ifMatch, String certificate, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(verifyWithServiceResponseAsync(resourceGroupName, resourceName, certificateName, ifMatch, certificate), serviceCallback); + } + + /** + * Verify certificate's private key possession. + * Verifies the certificate's private key possession by providing the leaf cert issued by the verifying pre uploaded certificate. + * + * @param resourceGroupName The name of the resource group that contains the IoT hub. + * @param resourceName The name of the IoT hub. + * @param certificateName The name of the certificate + * @param ifMatch ETag of the Certificate. + * @param certificate base-64 representation of X509 certificate .cer file or just .pem file content. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the CertificateDescriptionInner object + */ + public Observable verifyAsync(String resourceGroupName, String resourceName, String certificateName, String ifMatch, String certificate) { + return verifyWithServiceResponseAsync(resourceGroupName, resourceName, certificateName, ifMatch, certificate).map(new Func1, CertificateDescriptionInner>() { + @Override + public CertificateDescriptionInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Verify certificate's private key possession. + * Verifies the certificate's private key possession by providing the leaf cert issued by the verifying pre uploaded certificate. + * + * @param resourceGroupName The name of the resource group that contains the IoT hub. + * @param resourceName The name of the IoT hub. + * @param certificateName The name of the certificate + * @param ifMatch ETag of the Certificate. + * @param certificate base-64 representation of X509 certificate .cer file or just .pem file content. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the CertificateDescriptionInner object + */ + public Observable> verifyWithServiceResponseAsync(String resourceGroupName, String resourceName, String certificateName, String ifMatch, String certificate) { + 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 (certificateName == null) { + throw new IllegalArgumentException("Parameter certificateName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (ifMatch == null) { + throw new IllegalArgumentException("Parameter ifMatch is required and cannot be null."); + } + CertificateVerificationDescription certificateVerificationBody = new CertificateVerificationDescription(); + certificateVerificationBody.withCertificate(certificate); + return service.verify(this.client.subscriptionId(), resourceGroupName, resourceName, certificateName, this.client.apiVersion(), ifMatch, this.client.acceptLanguage(), certificateVerificationBody, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = verifyDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse verifyDelegate(Response response) throws ErrorDetailsInnerException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorDetailsInnerException.class) + .build(response); + } + +} diff --git a/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/implementation/DevicesManager.java b/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/implementation/DevicesManager.java new file mode 100644 index 0000000000000..ec6d58d7afdab --- /dev/null +++ b/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/implementation/DevicesManager.java @@ -0,0 +1,171 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.iothub.v2020_03_01.implementation; + +import com.microsoft.azure.AzureEnvironment; +import com.microsoft.azure.AzureResponseBuilder; +import com.microsoft.azure.credentials.AzureTokenCredentials; +import com.microsoft.azure.management.apigeneration.Beta; +import com.microsoft.azure.management.apigeneration.Beta.SinceVersion; +import com.microsoft.azure.arm.resources.AzureConfigurable; +import com.microsoft.azure.serializer.AzureJacksonAdapter; +import com.microsoft.rest.RestClient; +import com.microsoft.azure.management.iothub.v2020_03_01.Operations; +import com.microsoft.azure.management.iothub.v2020_03_01.IotHubResources; +import com.microsoft.azure.management.iothub.v2020_03_01.ResourceProviderCommons; +import com.microsoft.azure.management.iothub.v2020_03_01.Certificates; +import com.microsoft.azure.management.iothub.v2020_03_01.IotHubs; +import com.microsoft.azure.management.iothub.v2020_03_01.PrivateLinkResources; +import com.microsoft.azure.management.iothub.v2020_03_01.PrivateEndpointConnections; +import com.microsoft.azure.arm.resources.implementation.AzureConfigurableCoreImpl; +import com.microsoft.azure.arm.resources.implementation.ManagerCore; + +/** + * Entry point to Azure Devices resource management. + */ +public final class DevicesManager extends ManagerCore { + private Operations operations; + private IotHubResources iotHubResources; + private ResourceProviderCommons resourceProviderCommons; + private Certificates certificates; + private IotHubs iotHubs; + private PrivateLinkResources privateLinkResources; + private PrivateEndpointConnections privateEndpointConnections; + /** + * Get a Configurable instance that can be used to create DevicesManager with optional configuration. + * + * @return the instance allowing configurations + */ + public static Configurable configure() { + return new DevicesManager.ConfigurableImpl(); + } + /** + * Creates an instance of DevicesManager that exposes Devices resource management API entry points. + * + * @param credentials the credentials to use + * @param subscriptionId the subscription UUID + * @return the DevicesManager + */ + public static DevicesManager authenticate(AzureTokenCredentials credentials, String subscriptionId) { + return new DevicesManager(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 DevicesManager that exposes Devices resource management API entry points. + * + * @param restClient the RestClient to be used for API calls. + * @param subscriptionId the subscription UUID + * @return the DevicesManager + */ + public static DevicesManager authenticate(RestClient restClient, String subscriptionId) { + return new DevicesManager(restClient, subscriptionId); + } + /** + * The interface allowing configurations to be set. + */ + public interface Configurable extends AzureConfigurable { + /** + * Creates an instance of DevicesManager that exposes Devices management API entry points. + * + * @param credentials the credentials to use + * @param subscriptionId the subscription UUID + * @return the interface exposing Devices management API entry points that work across subscriptions + */ + DevicesManager authenticate(AzureTokenCredentials credentials, String subscriptionId); + } + + /** + * @return Entry point to manage Operations. + */ + public Operations operations() { + if (this.operations == null) { + this.operations = new OperationsImpl(this); + } + return this.operations; + } + + /** + * @return Entry point to manage IotHubResources. + */ + public IotHubResources iotHubResources() { + if (this.iotHubResources == null) { + this.iotHubResources = new IotHubResourcesImpl(this); + } + return this.iotHubResources; + } + + /** + * @return Entry point to manage ResourceProviderCommons. + */ + public ResourceProviderCommons resourceProviderCommons() { + if (this.resourceProviderCommons == null) { + this.resourceProviderCommons = new ResourceProviderCommonsImpl(this); + } + return this.resourceProviderCommons; + } + + /** + * @return Entry point to manage Certificates. + */ + public Certificates certificates() { + if (this.certificates == null) { + this.certificates = new CertificatesImpl(this); + } + return this.certificates; + } + + /** + * @return Entry point to manage IotHubs. + */ + public IotHubs iotHubs() { + if (this.iotHubs == null) { + this.iotHubs = new IotHubsImpl(this); + } + return this.iotHubs; + } + + /** + * @return Entry point to manage PrivateLinkResources. + */ + public PrivateLinkResources privateLinkResources() { + if (this.privateLinkResources == null) { + this.privateLinkResources = new PrivateLinkResourcesImpl(this); + } + return this.privateLinkResources; + } + + /** + * @return Entry point to manage PrivateEndpointConnections. + */ + public PrivateEndpointConnections privateEndpointConnections() { + if (this.privateEndpointConnections == null) { + this.privateEndpointConnections = new PrivateEndpointConnectionsImpl(this); + } + return this.privateEndpointConnections; + } + + /** + * The implementation for Configurable interface. + */ + private static final class ConfigurableImpl extends AzureConfigurableCoreImpl implements Configurable { + public DevicesManager authenticate(AzureTokenCredentials credentials, String subscriptionId) { + return DevicesManager.authenticate(buildRestClient(credentials), subscriptionId); + } + } + private DevicesManager(RestClient restClient, String subscriptionId) { + super( + restClient, + subscriptionId, + new IotHubClientImpl(restClient).withSubscriptionId(subscriptionId)); + } +} diff --git a/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/implementation/EndpointHealthDataImpl.java b/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/implementation/EndpointHealthDataImpl.java new file mode 100644 index 0000000000000..5474fc3b1e9c4 --- /dev/null +++ b/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/implementation/EndpointHealthDataImpl.java @@ -0,0 +1,37 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.iothub.v2020_03_01.implementation; + +import com.microsoft.azure.management.iothub.v2020_03_01.EndpointHealthData; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.iothub.v2020_03_01.EndpointHealthStatus; + +class EndpointHealthDataImpl extends WrapperImpl implements EndpointHealthData { + private final DevicesManager manager; + EndpointHealthDataImpl(EndpointHealthDataInner inner, DevicesManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public DevicesManager manager() { + return this.manager; + } + + @Override + public String endpointId() { + return this.inner().endpointId(); + } + + @Override + public EndpointHealthStatus healthStatus() { + return this.inner().healthStatus(); + } + +} diff --git a/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/implementation/EndpointHealthDataInner.java b/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/implementation/EndpointHealthDataInner.java new file mode 100644 index 0000000000000..1e81412d11223 --- /dev/null +++ b/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/implementation/EndpointHealthDataInner.java @@ -0,0 +1,81 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.iothub.v2020_03_01.implementation; + +import com.microsoft.azure.management.iothub.v2020_03_01.EndpointHealthStatus; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The health data for an endpoint. + */ +public class EndpointHealthDataInner { + /** + * Id of the endpoint. + */ + @JsonProperty(value = "endpointId") + private String endpointId; + + /** + * Health statuses have following meanings. The 'healthy' status shows that + * the endpoint is accepting messages as expected. The 'unhealthy' status + * shows that the endpoint is not accepting messages as expected and IoT + * Hub is retrying to send data to this endpoint. The status of an + * unhealthy endpoint will be updated to healthy when IoT Hub has + * established an eventually consistent state of health. The 'dead' status + * shows that the endpoint is not accepting messages, after IoT Hub retried + * sending messages for the retrial period. See IoT Hub metrics to identify + * errors and monitor issues with endpoints. The 'unknown' status shows + * that the IoT Hub has not established a connection with the endpoint. No + * messages have been delivered to or rejected from this endpoint. Possible + * values include: 'unknown', 'healthy', 'unhealthy', 'dead'. + */ + @JsonProperty(value = "healthStatus") + private EndpointHealthStatus healthStatus; + + /** + * Get id of the endpoint. + * + * @return the endpointId value + */ + public String endpointId() { + return this.endpointId; + } + + /** + * Set id of the endpoint. + * + * @param endpointId the endpointId value to set + * @return the EndpointHealthDataInner object itself. + */ + public EndpointHealthDataInner withEndpointId(String endpointId) { + this.endpointId = endpointId; + return this; + } + + /** + * Get health statuses have following meanings. The 'healthy' status shows that the endpoint is accepting messages as expected. The 'unhealthy' status shows that the endpoint is not accepting messages as expected and IoT Hub is retrying to send data to this endpoint. The status of an unhealthy endpoint will be updated to healthy when IoT Hub has established an eventually consistent state of health. The 'dead' status shows that the endpoint is not accepting messages, after IoT Hub retried sending messages for the retrial period. See IoT Hub metrics to identify errors and monitor issues with endpoints. The 'unknown' status shows that the IoT Hub has not established a connection with the endpoint. No messages have been delivered to or rejected from this endpoint. Possible values include: 'unknown', 'healthy', 'unhealthy', 'dead'. + * + * @return the healthStatus value + */ + public EndpointHealthStatus healthStatus() { + return this.healthStatus; + } + + /** + * Set health statuses have following meanings. The 'healthy' status shows that the endpoint is accepting messages as expected. The 'unhealthy' status shows that the endpoint is not accepting messages as expected and IoT Hub is retrying to send data to this endpoint. The status of an unhealthy endpoint will be updated to healthy when IoT Hub has established an eventually consistent state of health. The 'dead' status shows that the endpoint is not accepting messages, after IoT Hub retried sending messages for the retrial period. See IoT Hub metrics to identify errors and monitor issues with endpoints. The 'unknown' status shows that the IoT Hub has not established a connection with the endpoint. No messages have been delivered to or rejected from this endpoint. Possible values include: 'unknown', 'healthy', 'unhealthy', 'dead'. + * + * @param healthStatus the healthStatus value to set + * @return the EndpointHealthDataInner object itself. + */ + public EndpointHealthDataInner withHealthStatus(EndpointHealthStatus healthStatus) { + this.healthStatus = healthStatus; + return this; + } + +} diff --git a/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/implementation/ErrorDetailsInner.java b/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/implementation/ErrorDetailsInner.java new file mode 100644 index 0000000000000..0c59f9422caba --- /dev/null +++ b/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/implementation/ErrorDetailsInner.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.iothub.v2020_03_01.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Error details. + */ +public class ErrorDetailsInner { + /** + * The error code. + */ + @JsonProperty(value = "code", access = JsonProperty.Access.WRITE_ONLY) + private String code; + + /** + * The HTTP status code. + */ + @JsonProperty(value = "httpStatusCode", access = JsonProperty.Access.WRITE_ONLY) + private String httpStatusCode; + + /** + * The error message. + */ + @JsonProperty(value = "message", access = JsonProperty.Access.WRITE_ONLY) + private String message; + + /** + * The error details. + */ + @JsonProperty(value = "details", access = JsonProperty.Access.WRITE_ONLY) + private String details; + + /** + * Get the error code. + * + * @return the code value + */ + public String code() { + return this.code; + } + + /** + * Get the HTTP status code. + * + * @return the httpStatusCode value + */ + public String httpStatusCode() { + return this.httpStatusCode; + } + + /** + * Get the error message. + * + * @return the message value + */ + public String message() { + return this.message; + } + + /** + * Get the error details. + * + * @return the details value + */ + public String details() { + return this.details; + } + +} diff --git a/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/implementation/ErrorDetailsInnerException.java b/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/implementation/ErrorDetailsInnerException.java new file mode 100644 index 0000000000000..01a054b535758 --- /dev/null +++ b/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/implementation/ErrorDetailsInnerException.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.iothub.v2020_03_01.implementation; + +import com.microsoft.rest.RestException; +import okhttp3.ResponseBody; +import retrofit2.Response; + +/** + * Exception thrown for an invalid response with ErrorDetailsInner information. + */ +public class ErrorDetailsInnerException extends RestException { + /** + * Initializes a new instance of the ErrorDetailsInnerException class. + * + * @param message the exception message or the response content if a message is not available + * @param response the HTTP response + */ + public ErrorDetailsInnerException(final String message, final Response response) { + super(message, response); + } + + /** + * Initializes a new instance of the ErrorDetailsInnerException class. + * + * @param message the exception message or the response content if a message is not available + * @param response the HTTP response + * @param body the deserialized response body + */ + public ErrorDetailsInnerException(final String message, final Response response, final ErrorDetailsInner body) { + super(message, response, body); + } + + @Override + public ErrorDetailsInner body() { + return (ErrorDetailsInner) super.body(); + } +} diff --git a/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/implementation/EventHubConsumerGroupInfoImpl.java b/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/implementation/EventHubConsumerGroupInfoImpl.java new file mode 100644 index 0000000000000..a220895a3373e --- /dev/null +++ b/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/implementation/EventHubConsumerGroupInfoImpl.java @@ -0,0 +1,108 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.iothub.v2020_03_01.implementation; + +import com.microsoft.azure.management.iothub.v2020_03_01.EventHubConsumerGroupInfo; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import java.util.Map; + +class EventHubConsumerGroupInfoImpl extends CreatableUpdatableImpl implements EventHubConsumerGroupInfo, EventHubConsumerGroupInfo.Definition, EventHubConsumerGroupInfo.Update { + private final DevicesManager manager; + private String resourceGroupName; + private String resourceName; + private String eventHubEndpointName; + private String name; + + EventHubConsumerGroupInfoImpl(String name, DevicesManager manager) { + super(name, new EventHubConsumerGroupInfoInner()); + this.manager = manager; + // Set resource name + this.name = name; + // + } + + EventHubConsumerGroupInfoImpl(EventHubConsumerGroupInfoInner inner, DevicesManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.name = inner.name(); + // set resource ancestor and positional variables + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.resourceName = IdParsingUtils.getValueFromIdByName(inner.id(), "IotHubs"); + this.eventHubEndpointName = IdParsingUtils.getValueFromIdByName(inner.id(), "eventHubEndpoints"); + this.name = IdParsingUtils.getValueFromIdByName(inner.id(), "ConsumerGroups"); + // + } + + @Override + public DevicesManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + IotHubResourcesInner client = this.manager().inner().iotHubResources(); + return client.createEventHubConsumerGroupAsync(this.resourceGroupName, this.resourceName, this.eventHubEndpointName, this.name) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + IotHubResourcesInner client = this.manager().inner().iotHubResources(); + return client.createEventHubConsumerGroupAsync(this.resourceGroupName, this.resourceName, this.eventHubEndpointName, this.name) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + IotHubResourcesInner client = this.manager().inner().iotHubResources(); + return client.getEventHubConsumerGroupAsync(this.resourceGroupName, this.resourceName, this.eventHubEndpointName, this.name); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public String etag() { + return this.inner().etag(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public Map properties() { + return this.inner().properties(); + } + + @Override + public String type() { + return this.inner().type(); + } + + @Override + public EventHubConsumerGroupInfoImpl withExistingEventHubEndpoint(String resourceGroupName, String resourceName, String eventHubEndpointName) { + this.resourceGroupName = resourceGroupName; + this.resourceName = resourceName; + this.eventHubEndpointName = eventHubEndpointName; + return this; + } + +} diff --git a/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/implementation/EventHubConsumerGroupInfoInner.java b/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/implementation/EventHubConsumerGroupInfoInner.java new file mode 100644 index 0000000000000..8061de35714d1 --- /dev/null +++ b/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/implementation/EventHubConsumerGroupInfoInner.java @@ -0,0 +1,60 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.iothub.v2020_03_01.implementation; + +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.azure.ProxyResource; + +/** + * The properties of the EventHubConsumerGroupInfo object. + */ +public class EventHubConsumerGroupInfoInner extends ProxyResource { + /** + * The tags. + */ + @JsonProperty(value = "properties") + private Map properties; + + /** + * The etag. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /** + * Get the tags. + * + * @return the properties value + */ + public Map properties() { + return this.properties; + } + + /** + * Set the tags. + * + * @param properties the properties value to set + * @return the EventHubConsumerGroupInfoInner object itself. + */ + public EventHubConsumerGroupInfoInner withProperties(Map properties) { + this.properties = properties; + return this; + } + + /** + * Get the etag. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + +} diff --git a/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/implementation/GroupIdInformationImpl.java b/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/implementation/GroupIdInformationImpl.java new file mode 100644 index 0000000000000..0d7886b27c9e0 --- /dev/null +++ b/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/implementation/GroupIdInformationImpl.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.iothub.v2020_03_01.implementation; + +import com.microsoft.azure.management.iothub.v2020_03_01.GroupIdInformation; +import com.microsoft.azure.arm.model.implementation.IndexableRefreshableWrapperImpl; +import rx.Observable; +import com.microsoft.azure.management.iothub.v2020_03_01.GroupIdInformationProperties; + +class GroupIdInformationImpl extends IndexableRefreshableWrapperImpl implements GroupIdInformation { + private final DevicesManager manager; + private String resourceGroupName; + private String resourceName; + private String groupId; + + GroupIdInformationImpl(GroupIdInformationInner inner, DevicesManager manager) { + super(null, inner); + this.manager = manager; + // set resource ancestor and positional variables + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.resourceName = IdParsingUtils.getValueFromIdByName(inner.id(), "iotHubs"); + this.groupId = IdParsingUtils.getValueFromIdByName(inner.id(), "privateLinkResources"); + } + + @Override + public DevicesManager manager() { + return this.manager; + } + + @Override + protected Observable getInnerAsync() { + PrivateLinkResourcesInner client = this.manager().inner().privateLinkResources(); + return client.getAsync(this.resourceGroupName, this.resourceName, this.groupId); + } + + + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public GroupIdInformationProperties properties() { + return this.inner().properties(); + } + + @Override + public String type() { + return this.inner().type(); + } + +} diff --git a/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/implementation/GroupIdInformationInner.java b/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/implementation/GroupIdInformationInner.java new file mode 100644 index 0000000000000..dc4fcefd40f96 --- /dev/null +++ b/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/implementation/GroupIdInformationInner.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.iothub.v2020_03_01.implementation; + +import com.microsoft.azure.management.iothub.v2020_03_01.GroupIdInformationProperties; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The group information for creating a private endpoint on an IotHub. + */ +public class GroupIdInformationInner { + /** + * The resource identifier. + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + 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; + + /** + * The properties property. + */ + @JsonProperty(value = "properties", required = true) + private GroupIdInformationProperties properties; + + /** + * Get the resource identifier. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * 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; + } + + /** + * Get the properties value. + * + * @return the properties value + */ + public GroupIdInformationProperties properties() { + return this.properties; + } + + /** + * Set the properties value. + * + * @param properties the properties value to set + * @return the GroupIdInformationInner object itself. + */ + public GroupIdInformationInner withProperties(GroupIdInformationProperties properties) { + this.properties = properties; + return this; + } + +} diff --git a/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/implementation/IdParsingUtils.java b/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/implementation/IdParsingUtils.java new file mode 100644 index 0000000000000..e88f323b0456b --- /dev/null +++ b/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/implementation/IdParsingUtils.java @@ -0,0 +1,57 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.iothub.v2020_03_01.implementation; +import java.util.Arrays; +import java.util.Iterator; + +class IdParsingUtils { + public static String getValueFromIdByName(String id, String name) { + if (id == null) { + return null; + } + Iterable iterable = Arrays.asList(id.split("/")); + Iterator itr = iterable.iterator(); + while (itr.hasNext()) { + String part = itr.next(); + if (part != null && part.trim() != "") { + if (part.equalsIgnoreCase(name)) { + if (itr.hasNext()) { + return itr.next(); + } else { + return null; + } + } + } + } + return null; + } + + public static String getValueFromIdByPosition(String id, int pos) { + if (id == null) { + return null; + } + Iterable iterable = Arrays.asList(id.split("/")); + Iterator itr = iterable.iterator(); + int index = 0; + while (itr.hasNext()) { + String part = itr.next(); + if (part != null && part.trim() != "") { + if (index == pos) { + if (itr.hasNext()) { + return itr.next(); + } else { + return null; + } + } + } + index++; + } + return null; + } +} diff --git a/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/implementation/IotHubClientImpl.java b/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/implementation/IotHubClientImpl.java new file mode 100644 index 0000000000000..d513ee121aeff --- /dev/null +++ b/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/implementation/IotHubClientImpl.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.iothub.v2020_03_01.implementation; + +import com.microsoft.azure.AzureClient; +import com.microsoft.azure.AzureServiceClient; +import com.microsoft.rest.credentials.ServiceClientCredentials; +import com.microsoft.rest.RestClient; + +/** + * Initializes a new instance of the IotHubClientImpl class. + */ +public class IotHubClientImpl extends AzureServiceClient { + /** the {@link AzureClient} used for long running operations. */ + private AzureClient azureClient; + + /** + * Gets the {@link AzureClient} used for long running operations. + * @return the azure client; + */ + public AzureClient getAzureClient() { + return this.azureClient; + } + + /** The subscription identifier. */ + private String subscriptionId; + + /** + * Gets The subscription identifier. + * + * @return the subscriptionId value. + */ + public String subscriptionId() { + return this.subscriptionId; + } + + /** + * Sets The subscription identifier. + * + * @param subscriptionId the subscriptionId value. + * @return the service client itself + */ + public IotHubClientImpl withSubscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; + return this; + } + + /** The version of the API. */ + private String apiVersion; + + /** + * Gets The version of the 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 IotHubClientImpl 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 IotHubClientImpl 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 IotHubClientImpl withGenerateClientRequestId(boolean generateClientRequestId) { + this.generateClientRequestId = generateClientRequestId; + return this; + } + + /** + * The OperationsInner object to access its operations. + */ + private OperationsInner operations; + + /** + * Gets the OperationsInner object to access its operations. + * @return the OperationsInner object. + */ + public OperationsInner operations() { + return this.operations; + } + + /** + * The IotHubResourcesInner object to access its operations. + */ + private IotHubResourcesInner iotHubResources; + + /** + * Gets the IotHubResourcesInner object to access its operations. + * @return the IotHubResourcesInner object. + */ + public IotHubResourcesInner iotHubResources() { + return this.iotHubResources; + } + + /** + * The ResourceProviderCommonsInner object to access its operations. + */ + private ResourceProviderCommonsInner resourceProviderCommons; + + /** + * Gets the ResourceProviderCommonsInner object to access its operations. + * @return the ResourceProviderCommonsInner object. + */ + public ResourceProviderCommonsInner resourceProviderCommons() { + return this.resourceProviderCommons; + } + + /** + * The CertificatesInner object to access its operations. + */ + private CertificatesInner certificates; + + /** + * Gets the CertificatesInner object to access its operations. + * @return the CertificatesInner object. + */ + public CertificatesInner certificates() { + return this.certificates; + } + + /** + * The IotHubsInner object to access its operations. + */ + private IotHubsInner iotHubs; + + /** + * Gets the IotHubsInner object to access its operations. + * @return the IotHubsInner object. + */ + public IotHubsInner iotHubs() { + return this.iotHubs; + } + + /** + * The PrivateLinkResourcesInner object to access its operations. + */ + private PrivateLinkResourcesInner privateLinkResources; + + /** + * Gets the PrivateLinkResourcesInner object to access its operations. + * @return the PrivateLinkResourcesInner object. + */ + public PrivateLinkResourcesInner privateLinkResources() { + return this.privateLinkResources; + } + + /** + * The PrivateEndpointConnectionsInner object to access its operations. + */ + private PrivateEndpointConnectionsInner privateEndpointConnections; + + /** + * Gets the PrivateEndpointConnectionsInner object to access its operations. + * @return the PrivateEndpointConnectionsInner object. + */ + public PrivateEndpointConnectionsInner privateEndpointConnections() { + return this.privateEndpointConnections; + } + + /** + * Initializes an instance of IotHubClient client. + * + * @param credentials the management credentials for Azure + */ + public IotHubClientImpl(ServiceClientCredentials credentials) { + this("https://management.azure.com", credentials); + } + + /** + * Initializes an instance of IotHubClient client. + * + * @param baseUrl the base URL of the host + * @param credentials the management credentials for Azure + */ + public IotHubClientImpl(String baseUrl, ServiceClientCredentials credentials) { + super(baseUrl, credentials); + initialize(); + } + + /** + * Initializes an instance of IotHubClient client. + * + * @param restClient the REST client to connect to Azure. + */ + public IotHubClientImpl(RestClient restClient) { + super(restClient); + initialize(); + } + + protected void initialize() { + this.apiVersion = "2020-03-01"; + this.acceptLanguage = "en-US"; + this.longRunningOperationRetryTimeout = 30; + this.generateClientRequestId = true; + this.operations = new OperationsInner(restClient().retrofit(), this); + this.iotHubResources = new IotHubResourcesInner(restClient().retrofit(), this); + this.resourceProviderCommons = new ResourceProviderCommonsInner(restClient().retrofit(), this); + this.certificates = new CertificatesInner(restClient().retrofit(), this); + this.iotHubs = new IotHubsInner(restClient().retrofit(), this); + this.privateLinkResources = new PrivateLinkResourcesInner(restClient().retrofit(), this); + this.privateEndpointConnections = new PrivateEndpointConnectionsInner(restClient().retrofit(), this); + this.azureClient = new AzureClient(this); + } + + /** + * Gets the User-Agent header for the client. + * + * @return the user agent string. + */ + @Override + public String userAgent() { + return String.format("%s (%s, %s, auto-generated)", super.userAgent(), "IotHubClient", "2020-03-01"); + } +} diff --git a/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/implementation/IotHubDescriptionImpl.java b/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/implementation/IotHubDescriptionImpl.java new file mode 100644 index 0000000000000..612c2a5cae1f5 --- /dev/null +++ b/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/implementation/IotHubDescriptionImpl.java @@ -0,0 +1,93 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.iothub.v2020_03_01.implementation; + +import com.microsoft.azure.arm.resources.models.implementation.GroupableResourceCoreImpl; +import com.microsoft.azure.management.iothub.v2020_03_01.IotHubDescription; +import rx.Observable; +import com.microsoft.azure.management.iothub.v2020_03_01.IotHubProperties; +import com.microsoft.azure.management.iothub.v2020_03_01.IotHubSkuInfo; + +class IotHubDescriptionImpl extends GroupableResourceCoreImpl implements IotHubDescription, IotHubDescription.Definition, IotHubDescription.Update { + private String cifMatch; + private String uifMatch; + IotHubDescriptionImpl(String name, IotHubDescriptionInner inner, DevicesManager manager) { + super(name, inner, manager); + } + + @Override + public Observable createResourceAsync() { + IotHubResourcesInner client = this.manager().inner().iotHubResources(); + return client.createOrUpdateAsync(this.resourceGroupName(), this.name(), this.inner(), this.cifMatch) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + IotHubResourcesInner client = this.manager().inner().iotHubResources(); + return client.createOrUpdateAsync(this.resourceGroupName(), this.name(), this.inner(), this.uifMatch) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + IotHubResourcesInner client = this.manager().inner().iotHubResources(); + return client.getByResourceGroupAsync(this.resourceGroupName(), this.name()); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public String etag() { + return this.inner().etag(); + } + + @Override + public IotHubProperties properties() { + return this.inner().properties(); + } + + @Override + public IotHubSkuInfo sku() { + return this.inner().sku(); + } + + @Override + public IotHubDescriptionImpl withSku(IotHubSkuInfo sku) { + this.inner().withSku(sku); + return this; + } + + @Override + public IotHubDescriptionImpl withIfMatch(String ifMatch) { + if (isInCreateMode()) { + this.cifMatch = ifMatch; + } else { + this.uifMatch = ifMatch; + } + return this; + } + + @Override + public IotHubDescriptionImpl withEtag(String etag) { + this.inner().withEtag(etag); + return this; + } + + @Override + public IotHubDescriptionImpl withProperties(IotHubProperties properties) { + this.inner().withProperties(properties); + return this; + } + +} diff --git a/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/implementation/IotHubDescriptionInner.java b/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/implementation/IotHubDescriptionInner.java new file mode 100644 index 0000000000000..5ce01e37f1199 --- /dev/null +++ b/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/implementation/IotHubDescriptionInner.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.iothub.v2020_03_01.implementation; + +import com.microsoft.azure.management.iothub.v2020_03_01.IotHubProperties; +import com.microsoft.azure.management.iothub.v2020_03_01.IotHubSkuInfo; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.azure.Resource; + +/** + * The description of the IoT hub. + */ +public class IotHubDescriptionInner extends Resource { + /** + * The Etag field is *not* required. If it is provided in the response + * body, it must also be provided as a header per the normal ETag + * convention. + */ + @JsonProperty(value = "etag") + private String etag; + + /** + * IotHub properties. + */ + @JsonProperty(value = "properties") + private IotHubProperties properties; + + /** + * IotHub SKU info. + */ + @JsonProperty(value = "sku", required = true) + private IotHubSkuInfo sku; + + /** + * Get the Etag field is *not* required. If it is provided in the response body, it must also be provided as a header per the normal ETag convention. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + + /** + * Set the Etag field is *not* required. If it is provided in the response body, it must also be provided as a header per the normal ETag convention. + * + * @param etag the etag value to set + * @return the IotHubDescriptionInner object itself. + */ + public IotHubDescriptionInner withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Get iotHub properties. + * + * @return the properties value + */ + public IotHubProperties properties() { + return this.properties; + } + + /** + * Set iotHub properties. + * + * @param properties the properties value to set + * @return the IotHubDescriptionInner object itself. + */ + public IotHubDescriptionInner withProperties(IotHubProperties properties) { + this.properties = properties; + return this; + } + + /** + * Get iotHub SKU info. + * + * @return the sku value + */ + public IotHubSkuInfo sku() { + return this.sku; + } + + /** + * Set iotHub SKU info. + * + * @param sku the sku value to set + * @return the IotHubDescriptionInner object itself. + */ + public IotHubDescriptionInner withSku(IotHubSkuInfo sku) { + this.sku = sku; + return this; + } + +} diff --git a/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/implementation/IotHubNameAvailabilityInfoImpl.java b/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/implementation/IotHubNameAvailabilityInfoImpl.java new file mode 100644 index 0000000000000..b48d5b1b3c2d7 --- /dev/null +++ b/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/implementation/IotHubNameAvailabilityInfoImpl.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.iothub.v2020_03_01.implementation; + +import com.microsoft.azure.management.iothub.v2020_03_01.IotHubNameAvailabilityInfo; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.iothub.v2020_03_01.IotHubNameUnavailabilityReason; + +class IotHubNameAvailabilityInfoImpl extends WrapperImpl implements IotHubNameAvailabilityInfo { + private final DevicesManager manager; + IotHubNameAvailabilityInfoImpl(IotHubNameAvailabilityInfoInner inner, DevicesManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public DevicesManager manager() { + return this.manager; + } + + @Override + public String message() { + return this.inner().message(); + } + + @Override + public Boolean nameAvailable() { + return this.inner().nameAvailable(); + } + + @Override + public IotHubNameUnavailabilityReason reason() { + return this.inner().reason(); + } + +} diff --git a/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/implementation/IotHubNameAvailabilityInfoInner.java b/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/implementation/IotHubNameAvailabilityInfoInner.java new file mode 100644 index 0000000000000..66d8b1d2a86b6 --- /dev/null +++ b/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/implementation/IotHubNameAvailabilityInfoInner.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.iothub.v2020_03_01.implementation; + +import com.microsoft.azure.management.iothub.v2020_03_01.IotHubNameUnavailabilityReason; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The properties indicating whether a given IoT hub name is available. + */ +public class IotHubNameAvailabilityInfoInner { + /** + * The value which indicates whether the provided name is available. + */ + @JsonProperty(value = "nameAvailable", access = JsonProperty.Access.WRITE_ONLY) + private Boolean nameAvailable; + + /** + * The reason for unavailability. Possible values include: 'Invalid', + * 'AlreadyExists'. + */ + @JsonProperty(value = "reason", access = JsonProperty.Access.WRITE_ONLY) + private IotHubNameUnavailabilityReason reason; + + /** + * The detailed reason message. + */ + @JsonProperty(value = "message") + private String message; + + /** + * Get the value which indicates whether the provided name is available. + * + * @return the nameAvailable value + */ + public Boolean nameAvailable() { + return this.nameAvailable; + } + + /** + * Get the reason for unavailability. Possible values include: 'Invalid', 'AlreadyExists'. + * + * @return the reason value + */ + public IotHubNameUnavailabilityReason reason() { + return this.reason; + } + + /** + * Get the detailed reason message. + * + * @return the message value + */ + public String message() { + return this.message; + } + + /** + * Set the detailed reason message. + * + * @param message the message value to set + * @return the IotHubNameAvailabilityInfoInner object itself. + */ + public IotHubNameAvailabilityInfoInner withMessage(String message) { + this.message = message; + return this; + } + +} diff --git a/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/implementation/IotHubQuotaMetricInfoImpl.java b/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/implementation/IotHubQuotaMetricInfoImpl.java new file mode 100644 index 0000000000000..6c16f49058c17 --- /dev/null +++ b/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/implementation/IotHubQuotaMetricInfoImpl.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.iothub.v2020_03_01.implementation; + +import com.microsoft.azure.management.iothub.v2020_03_01.IotHubQuotaMetricInfo; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import rx.Observable; + +class IotHubQuotaMetricInfoImpl extends WrapperImpl implements IotHubQuotaMetricInfo { + private final DevicesManager manager; + + IotHubQuotaMetricInfoImpl(IotHubQuotaMetricInfoInner inner, DevicesManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public DevicesManager manager() { + return this.manager; + } + + + + @Override + public Long currentValue() { + return this.inner().currentValue(); + } + + @Override + public Long maxValue() { + return this.inner().maxValue(); + } + + @Override + public String name() { + return this.inner().name(); + } + +} diff --git a/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/implementation/IotHubQuotaMetricInfoInner.java b/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/implementation/IotHubQuotaMetricInfoInner.java new file mode 100644 index 0000000000000..6d87c94184498 --- /dev/null +++ b/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/implementation/IotHubQuotaMetricInfoInner.java @@ -0,0 +1,62 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.iothub.v2020_03_01.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Quota metrics properties. + */ +public class IotHubQuotaMetricInfoInner { + /** + * The name of the quota metric. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /** + * The current value for the quota metric. + */ + @JsonProperty(value = "currentValue", access = JsonProperty.Access.WRITE_ONLY) + private Long currentValue; + + /** + * The maximum value of the quota metric. + */ + @JsonProperty(value = "maxValue", access = JsonProperty.Access.WRITE_ONLY) + private Long maxValue; + + /** + * Get the name of the quota metric. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Get the current value for the quota metric. + * + * @return the currentValue value + */ + public Long currentValue() { + return this.currentValue; + } + + /** + * Get the maximum value of the quota metric. + * + * @return the maxValue value + */ + public Long maxValue() { + return this.maxValue; + } + +} diff --git a/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/implementation/IotHubResourcesImpl.java b/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/implementation/IotHubResourcesImpl.java new file mode 100644 index 0000000000000..604aee90ee730 --- /dev/null +++ b/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/implementation/IotHubResourcesImpl.java @@ -0,0 +1,391 @@ +/** + * Copyright (c) Microsoft Corporation. All rights 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.iothub.v2020_03_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.iothub.v2020_03_01.IotHubResources; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.management.iothub.v2020_03_01.IotHubDescription; +import com.microsoft.azure.Page; +import rx.Completable; +import com.microsoft.azure.management.iothub.v2020_03_01.EndpointHealthData; +import com.microsoft.azure.management.iothub.v2020_03_01.SharedAccessSignatureAuthorizationRule; +import com.microsoft.azure.management.iothub.v2020_03_01.JobResponse; +import com.microsoft.azure.management.iothub.v2020_03_01.IotHubNameAvailabilityInfo; +import com.microsoft.azure.management.iothub.v2020_03_01.ExportDevicesRequest; +import com.microsoft.azure.management.iothub.v2020_03_01.ImportDevicesRequest; +import com.microsoft.azure.management.iothub.v2020_03_01.RegistryStatistics; +import com.microsoft.azure.management.iothub.v2020_03_01.IotHubSkuDescription; +import com.microsoft.azure.management.iothub.v2020_03_01.EventHubConsumerGroupInfo; +import com.microsoft.azure.management.iothub.v2020_03_01.IotHubQuotaMetricInfo; +import com.microsoft.azure.management.iothub.v2020_03_01.TestAllRoutesResult; +import com.microsoft.azure.management.iothub.v2020_03_01.TestRouteResult; +import com.microsoft.azure.management.iothub.v2020_03_01.TestAllRoutesInput; +import com.microsoft.azure.management.iothub.v2020_03_01.TestRouteInput; + +class IotHubResourcesImpl extends WrapperImpl implements IotHubResources { + private final DevicesManager manager; + + IotHubResourcesImpl(DevicesManager manager) { + super(manager.inner().iotHubResources()); + this.manager = manager; + } + + public DevicesManager manager() { + return this.manager; + } + + @Override + public IotHubDescriptionImpl defineIotHub(String name) { + return wrapIotHubModel(name); + } + + @Override + public EventHubConsumerGroupInfoImpl defineConsumerGroup(String name) { + return wrapConsumerGroupModel(name); + } + + private IotHubDescriptionImpl wrapIotHubModel(String name) { + return new IotHubDescriptionImpl(name, new IotHubDescriptionInner(), this.manager()); + } + + private EventHubConsumerGroupInfoImpl wrapConsumerGroupModel(String name) { + return new EventHubConsumerGroupInfoImpl(name, this.manager()); + } + + private IotHubDescriptionImpl wrapIotHubDescriptionModel(IotHubDescriptionInner inner) { + return new IotHubDescriptionImpl(inner.name(), inner, manager()); + } + + private IotHubSkuDescriptionImpl wrapIotHubSkuDescriptionModel(IotHubSkuDescriptionInner inner) { + return new IotHubSkuDescriptionImpl(inner, manager()); + } + + private EventHubConsumerGroupInfoImpl wrapEventHubConsumerGroupInfoModel(EventHubConsumerGroupInfoInner inner) { + return new EventHubConsumerGroupInfoImpl(inner, manager()); + } + + private JobResponseImpl wrapJobResponseModel(JobResponseInner inner) { + return new JobResponseImpl(inner, manager()); + } + + private IotHubQuotaMetricInfoImpl wrapIotHubQuotaMetricInfoModel(IotHubQuotaMetricInfoInner inner) { + return new IotHubQuotaMetricInfoImpl(inner, manager()); + } + + private Observable getIotHubDescriptionInnerUsingIotHubResourcesInnerAsync(String resourceGroupName, String name) { + IotHubResourcesInner client = this.inner(); + return client.getByResourceGroupAsync(resourceGroupName, name); + } + + private Observable getEventHubConsumerGroupInfoInnerUsingIotHubResourcesInnerAsync(String id) { + String resourceGroupName = IdParsingUtils.getValueFromIdByName(id, "resourceGroups"); + String resourceName = IdParsingUtils.getValueFromIdByName(id, "IotHubs"); + String eventHubEndpointName = IdParsingUtils.getValueFromIdByName(id, "eventHubEndpoints"); + String name = IdParsingUtils.getValueFromIdByName(id, "ConsumerGroups"); + IotHubResourcesInner client = this.inner(); + return client.getEventHubConsumerGroupAsync(resourceGroupName, resourceName, eventHubEndpointName, name); + } + + private Observable getJobResponseInnerUsingIotHubResourcesInnerAsync(String id) { + String resourceGroupName = IdParsingUtils.getValueFromIdByName(id, "resourceGroups"); + String resourceName = IdParsingUtils.getValueFromIdByName(id, "IotHubs"); + String jobId = IdParsingUtils.getValueFromIdByName(id, "jobs"); + IotHubResourcesInner client = this.inner(); + return client.getJobAsync(resourceGroupName, resourceName, jobId); + } + + @Override + public Observable getByResourceGroupAsync(String resourceGroupName, String name) { + return this.getIotHubDescriptionInnerUsingIotHubResourcesInnerAsync(resourceGroupName, name).flatMap(new Func1> () { + @Override + public Observable call(IotHubDescriptionInner inner) { + if (inner == null) { + return Observable.empty(); + } else { + return Observable.just((IotHubDescription)wrapIotHubDescriptionModel(inner)); + } + } + }); + } + + @Override + public Observable listByResourceGroupAsync(String resourceGroupName) { + IotHubResourcesInner 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 IotHubDescription call(IotHubDescriptionInner inner) { + return wrapIotHubDescriptionModel(inner); + } + }); + } + + @Override + public Observable listAsync() { + IotHubResourcesInner client = this.inner(); + return client.listAsync() + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public IotHubDescription call(IotHubDescriptionInner inner) { + return wrapIotHubDescriptionModel(inner); + } + }); + } + + @Override + public Completable deleteAsync(String resourceGroupName, String name) { + return this.inner().deleteAsync(resourceGroupName, name).toCompletable(); + } + + @Override + public Observable getEndpointHealthAsync(final String resourceGroupName, final String iotHubName) { + IotHubResourcesInner client = this.inner(); + return client.getEndpointHealthAsync(resourceGroupName, iotHubName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public EndpointHealthData call(EndpointHealthDataInner inner) { + return new EndpointHealthDataImpl(inner, manager()); + } + }); + } + + @Override + public Observable listKeysAsync(final String resourceGroupName, final String resourceName) { + IotHubResourcesInner client = this.inner(); + return client.listKeysAsync(resourceGroupName, resourceName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public SharedAccessSignatureAuthorizationRule call(SharedAccessSignatureAuthorizationRuleInner inner) { + return new SharedAccessSignatureAuthorizationRuleImpl(inner, manager()); + } + }); + } + + @Override + public Observable exportDevicesAsync(String resourceGroupName, String resourceName, ExportDevicesRequest exportDevicesParameters) { + IotHubResourcesInner client = this.inner(); + return client.exportDevicesAsync(resourceGroupName, resourceName, exportDevicesParameters) + .map(new Func1() { + @Override + public JobResponse call(JobResponseInner inner) { + return new JobResponseImpl(inner, manager()); + } + }); + } + + @Override + public Observable importDevicesAsync(String resourceGroupName, String resourceName, ImportDevicesRequest importDevicesParameters) { + IotHubResourcesInner client = this.inner(); + return client.importDevicesAsync(resourceGroupName, resourceName, importDevicesParameters) + .map(new Func1() { + @Override + public JobResponse call(JobResponseInner inner) { + return new JobResponseImpl(inner, manager()); + } + }); + } + + @Override + public Observable checkNameAvailabilityAsync(String name) { + IotHubResourcesInner client = this.inner(); + return client.checkNameAvailabilityAsync(name) + .map(new Func1() { + @Override + public IotHubNameAvailabilityInfo call(IotHubNameAvailabilityInfoInner inner) { + return new IotHubNameAvailabilityInfoImpl(inner, manager()); + } + }); + } + + @Override + public Observable getStatsAsync(String resourceGroupName, String resourceName) { + IotHubResourcesInner client = this.inner(); + return client.getStatsAsync(resourceGroupName, resourceName) + .map(new Func1() { + @Override + public RegistryStatistics call(RegistryStatisticsInner inner) { + return new RegistryStatisticsImpl(inner, manager()); + } + }); + } + + @Override + public Observable getValidSkusAsync(final String resourceGroupName, final String resourceName) { + IotHubResourcesInner client = this.inner(); + return client.getValidSkusAsync(resourceGroupName, resourceName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public IotHubSkuDescription call(IotHubSkuDescriptionInner inner) { + return wrapIotHubSkuDescriptionModel(inner); + } + }); + } + + @Override + public Observable getEventHubConsumerGroupAsync(String resourceGroupName, String resourceName, String eventHubEndpointName, String name) { + IotHubResourcesInner client = this.inner(); + return client.getEventHubConsumerGroupAsync(resourceGroupName, resourceName, eventHubEndpointName, name) + .flatMap(new Func1>() { + @Override + public Observable call(EventHubConsumerGroupInfoInner inner) { + if (inner == null) { + return Observable.empty(); + } else { + return Observable.just((EventHubConsumerGroupInfo)wrapEventHubConsumerGroupInfoModel(inner)); + } + } + }); + } + + @Override + public Observable listEventHubConsumerGroupsAsync(final String resourceGroupName, final String resourceName, final String eventHubEndpointName) { + IotHubResourcesInner client = this.inner(); + return client.listEventHubConsumerGroupsAsync(resourceGroupName, resourceName, eventHubEndpointName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public EventHubConsumerGroupInfo call(EventHubConsumerGroupInfoInner inner) { + return wrapEventHubConsumerGroupInfoModel(inner); + } + }); + } + + @Override + public Completable deleteEventHubConsumerGroupAsync(String resourceGroupName, String resourceName, String eventHubEndpointName, String name) { + IotHubResourcesInner client = this.inner(); + return client.deleteEventHubConsumerGroupAsync(resourceGroupName, resourceName, eventHubEndpointName, name).toCompletable(); + } + + @Override + public Observable getJobAsync(String resourceGroupName, String resourceName, String jobId) { + IotHubResourcesInner client = this.inner(); + return client.getJobAsync(resourceGroupName, resourceName, jobId) + .flatMap(new Func1>() { + @Override + public Observable call(JobResponseInner inner) { + if (inner == null) { + return Observable.empty(); + } else { + return Observable.just((JobResponse)wrapJobResponseModel(inner)); + } + } + }); + } + + @Override + public Observable listJobsAsync(final String resourceGroupName, final String resourceName) { + IotHubResourcesInner client = this.inner(); + return client.listJobsAsync(resourceGroupName, resourceName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public JobResponse call(JobResponseInner inner) { + return wrapJobResponseModel(inner); + } + }); + } + + @Override + public Observable getQuotaMetricsAsync(final String resourceGroupName, final String resourceName) { + IotHubResourcesInner client = this.inner(); + return client.getQuotaMetricsAsync(resourceGroupName, resourceName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public IotHubQuotaMetricInfo call(IotHubQuotaMetricInfoInner inner) { + return wrapIotHubQuotaMetricInfoModel(inner); + } + }); + } + + @Override + public Observable testAllRoutesAsync(String iotHubName, String resourceGroupName, TestAllRoutesInput input) { + IotHubResourcesInner client = this.inner(); + return client.testAllRoutesAsync(iotHubName, resourceGroupName, input) + .map(new Func1() { + @Override + public TestAllRoutesResult call(TestAllRoutesResultInner inner) { + return new TestAllRoutesResultImpl(inner, manager()); + } + }); + } + + @Override + public Observable testRouteAsync(String iotHubName, String resourceGroupName, TestRouteInput input) { + IotHubResourcesInner client = this.inner(); + return client.testRouteAsync(iotHubName, resourceGroupName, input) + .map(new Func1() { + @Override + public TestRouteResult call(TestRouteResultInner inner) { + return new TestRouteResultImpl(inner, manager()); + } + }); + } + + @Override + public Observable getKeysForKeyNameAsync(String resourceGroupName, String resourceName, String keyName) { + IotHubResourcesInner client = this.inner(); + return client.getKeysForKeyNameAsync(resourceGroupName, resourceName, keyName) + .map(new Func1() { + @Override + public SharedAccessSignatureAuthorizationRule call(SharedAccessSignatureAuthorizationRuleInner inner) { + return new SharedAccessSignatureAuthorizationRuleImpl(inner, manager()); + } + }); + } + +} diff --git a/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/implementation/IotHubResourcesInner.java b/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/implementation/IotHubResourcesInner.java new file mode 100644 index 0000000000000..3871e0e3a2cfc --- /dev/null +++ b/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/implementation/IotHubResourcesInner.java @@ -0,0 +1,4178 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.iothub.v2020_03_01.implementation; + +import com.microsoft.azure.arm.collection.InnerSupportsGet; +import com.microsoft.azure.arm.collection.InnerSupportsDelete; +import com.microsoft.azure.arm.collection.InnerSupportsListing; +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.iothub.v2020_03_01.ErrorDetailsInnerException; +import com.microsoft.azure.management.iothub.v2020_03_01.ExportDevicesRequest; +import com.microsoft.azure.management.iothub.v2020_03_01.ImportDevicesRequest; +import com.microsoft.azure.management.iothub.v2020_03_01.OperationInputs; +import com.microsoft.azure.management.iothub.v2020_03_01.TagsResource; +import com.microsoft.azure.management.iothub.v2020_03_01.TestAllRoutesInput; +import com.microsoft.azure.management.iothub.v2020_03_01.TestRouteInput; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import java.util.Map; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.PATCH; +import retrofit2.http.Path; +import retrofit2.http.POST; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in IotHubResources. + */ +public class IotHubResourcesInner implements InnerSupportsGet, InnerSupportsDelete, InnerSupportsListing { + /** The Retrofit service to perform REST calls. */ + private IotHubResourcesService service; + /** The service client containing this operation class. */ + private IotHubClientImpl client; + + /** + * Initializes an instance of IotHubResourcesInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public IotHubResourcesInner(Retrofit retrofit, IotHubClientImpl client) { + this.service = retrofit.create(IotHubResourcesService.class); + this.client = client; + } + + /** + * The interface defining all the services for IotHubResources to be + * used by Retrofit to perform actually REST calls. + */ + interface IotHubResourcesService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.iothub.v2020_03_01.IotHubResources getByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{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.iothub.v2020_03_01.IotHubResources createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}") + Observable> createOrUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("resourceName") String resourceName, @Query("api-version") String apiVersion, @Body IotHubDescriptionInner iotHubDescription, @Header("If-Match") String ifMatch, @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.iothub.v2020_03_01.IotHubResources beginCreateOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}") + Observable> beginCreateOrUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("resourceName") String resourceName, @Query("api-version") String apiVersion, @Body IotHubDescriptionInner iotHubDescription, @Header("If-Match") String ifMatch, @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.iothub.v2020_03_01.IotHubResources update" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}") + Observable> update(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("resourceName") String resourceName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body TagsResource iotHubTags, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.iothub.v2020_03_01.IotHubResources beginUpdate" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}") + Observable> beginUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("resourceName") String resourceName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body TagsResource iotHubTags, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.iothub.v2020_03_01.IotHubResources delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{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.iothub.v2020_03_01.IotHubResources beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{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.iothub.v2020_03_01.IotHubResources list" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.Devices/IotHubs") + 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.iothub.v2020_03_01.IotHubResources listByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs") + 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.iothub.v2020_03_01.IotHubResources getStats" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}/IotHubStats") + Observable> getStats(@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.iothub.v2020_03_01.IotHubResources getValidSkus" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}/skus") + Observable> getValidSkus(@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.iothub.v2020_03_01.IotHubResources listEventHubConsumerGroups" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}/eventHubEndpoints/{eventHubEndpointName}/ConsumerGroups") + Observable> listEventHubConsumerGroups(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("resourceName") String resourceName, @Path("eventHubEndpointName") String eventHubEndpointName, @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.iothub.v2020_03_01.IotHubResources getEventHubConsumerGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}/eventHubEndpoints/{eventHubEndpointName}/ConsumerGroups/{name}") + Observable> getEventHubConsumerGroup(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("resourceName") String resourceName, @Path("eventHubEndpointName") String eventHubEndpointName, @Path("name") String name, @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.iothub.v2020_03_01.IotHubResources createEventHubConsumerGroup" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}/eventHubEndpoints/{eventHubEndpointName}/ConsumerGroups/{name}") + Observable> createEventHubConsumerGroup(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("resourceName") String resourceName, @Path("eventHubEndpointName") String eventHubEndpointName, @Path("name") String name, @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.iothub.v2020_03_01.IotHubResources deleteEventHubConsumerGroup" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}/eventHubEndpoints/{eventHubEndpointName}/ConsumerGroups/{name}", method = "DELETE", hasBody = true) + Observable> deleteEventHubConsumerGroup(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("resourceName") String resourceName, @Path("eventHubEndpointName") String eventHubEndpointName, @Path("name") String name, @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.iothub.v2020_03_01.IotHubResources listJobs" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}/jobs") + Observable> listJobs(@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.iothub.v2020_03_01.IotHubResources getJob" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}/jobs/{jobId}") + Observable> getJob(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("resourceName") String resourceName, @Path("jobId") String jobId, @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.iothub.v2020_03_01.IotHubResources getQuotaMetrics" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}/quotaMetrics") + Observable> getQuotaMetrics(@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.iothub.v2020_03_01.IotHubResources getEndpointHealth" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{iotHubName}/routingEndpointsHealth") + Observable> getEndpointHealth(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("iotHubName") String iotHubName, @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.iothub.v2020_03_01.IotHubResources checkNameAvailability" }) + @POST("subscriptions/{subscriptionId}/providers/Microsoft.Devices/checkNameAvailability") + Observable> checkNameAvailability(@Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body OperationInputs operationInputs, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.iothub.v2020_03_01.IotHubResources testAllRoutes" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{iotHubName}/routing/routes/$testall") + Observable> testAllRoutes(@Path("iotHubName") String iotHubName, @Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Body TestAllRoutesInput input, @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.iothub.v2020_03_01.IotHubResources testRoute" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{iotHubName}/routing/routes/$testnew") + Observable> testRoute(@Path("iotHubName") String iotHubName, @Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Body TestRouteInput input, @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.iothub.v2020_03_01.IotHubResources listKeys" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}/listkeys") + Observable> listKeys(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("resourceName") String resourceName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.iothub.v2020_03_01.IotHubResources getKeysForKeyName" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}/IotHubKeys/{keyName}/listkeys") + Observable> getKeysForKeyName(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("resourceName") String resourceName, @Path("keyName") String keyName, @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.iothub.v2020_03_01.IotHubResources exportDevices" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}/exportDevices") + Observable> exportDevices(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("resourceName") String resourceName, @Query("api-version") String apiVersion, @Body ExportDevicesRequest exportDevicesParameters, @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.iothub.v2020_03_01.IotHubResources importDevices" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}/importDevices") + Observable> importDevices(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("resourceName") String resourceName, @Query("api-version") String apiVersion, @Body ImportDevicesRequest importDevicesParameters, @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.iothub.v2020_03_01.IotHubResources 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.iothub.v2020_03_01.IotHubResources listByResourceGroupNext" }) + @GET + Observable> listByResourceGroupNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.iothub.v2020_03_01.IotHubResources getValidSkusNext" }) + @GET + Observable> getValidSkusNext(@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.iothub.v2020_03_01.IotHubResources listEventHubConsumerGroupsNext" }) + @GET + Observable> listEventHubConsumerGroupsNext(@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.iothub.v2020_03_01.IotHubResources listJobsNext" }) + @GET + Observable> listJobsNext(@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.iothub.v2020_03_01.IotHubResources getQuotaMetricsNext" }) + @GET + Observable> getQuotaMetricsNext(@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.iothub.v2020_03_01.IotHubResources getEndpointHealthNext" }) + @GET + Observable> getEndpointHealthNext(@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.iothub.v2020_03_01.IotHubResources listKeysNext" }) + @GET + Observable> listKeysNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Get the non-security related metadata of an IoT hub. + * Get the non-security related metadata of an IoT hub. + * + * @param resourceGroupName The name of the resource group that contains the IoT hub. + * @param resourceName The name of the IoT hub. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorDetailsInnerException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the IotHubDescriptionInner object if successful. + */ + public IotHubDescriptionInner getByResourceGroup(String resourceGroupName, String resourceName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, resourceName).toBlocking().single().body(); + } + + /** + * Get the non-security related metadata of an IoT hub. + * Get the non-security related metadata of an IoT hub. + * + * @param resourceGroupName The name of the resource group that contains the IoT hub. + * @param resourceName The name of the IoT hub. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getByResourceGroupAsync(String resourceGroupName, String resourceName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getByResourceGroupWithServiceResponseAsync(resourceGroupName, resourceName), serviceCallback); + } + + /** + * Get the non-security related metadata of an IoT hub. + * Get the non-security related metadata of an IoT hub. + * + * @param resourceGroupName The name of the resource group that contains the IoT hub. + * @param resourceName The name of the IoT hub. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the IotHubDescriptionInner object + */ + public Observable getByResourceGroupAsync(String resourceGroupName, String resourceName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, resourceName).map(new Func1, IotHubDescriptionInner>() { + @Override + public IotHubDescriptionInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get the non-security related metadata of an IoT hub. + * Get the non-security related metadata of an IoT hub. + * + * @param resourceGroupName The name of the resource group that contains the IoT hub. + * @param resourceName The name of the IoT hub. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the IotHubDescriptionInner object + */ + public Observable> getByResourceGroupWithServiceResponseAsync(String resourceGroupName, String resourceName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (resourceName == null) { + throw new IllegalArgumentException("Parameter resourceName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.getByResourceGroup(this.client.subscriptionId(), resourceGroupName, resourceName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getByResourceGroupDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getByResourceGroupDelegate(Response response) throws ErrorDetailsInnerException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorDetailsInnerException.class) + .build(response); + } + + /** + * Create or update the metadata of an IoT hub. + * Create or update the metadata of an Iot hub. The usual pattern to modify a property is to retrieve the IoT hub metadata and security metadata, and then combine them with the modified values in a new body to update the IoT hub. + * + * @param resourceGroupName The name of the resource group that contains the IoT hub. + * @param resourceName The name of the IoT hub. + * @param iotHubDescription The IoT hub metadata and security metadata. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorDetailsInnerException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the IotHubDescriptionInner object if successful. + */ + public IotHubDescriptionInner createOrUpdate(String resourceGroupName, String resourceName, IotHubDescriptionInner iotHubDescription) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, resourceName, iotHubDescription).toBlocking().last().body(); + } + + /** + * Create or update the metadata of an IoT hub. + * Create or update the metadata of an Iot hub. The usual pattern to modify a property is to retrieve the IoT hub metadata and security metadata, and then combine them with the modified values in a new body to update the IoT hub. + * + * @param resourceGroupName The name of the resource group that contains the IoT hub. + * @param resourceName The name of the IoT hub. + * @param iotHubDescription The IoT hub metadata 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, IotHubDescriptionInner iotHubDescription, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, resourceName, iotHubDescription), serviceCallback); + } + + /** + * Create or update the metadata of an IoT hub. + * Create or update the metadata of an Iot hub. The usual pattern to modify a property is to retrieve the IoT hub metadata and security metadata, and then combine them with the modified values in a new body to update the IoT hub. + * + * @param resourceGroupName The name of the resource group that contains the IoT hub. + * @param resourceName The name of the IoT hub. + * @param iotHubDescription The IoT hub metadata and security metadata. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createOrUpdateAsync(String resourceGroupName, String resourceName, IotHubDescriptionInner iotHubDescription) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, resourceName, iotHubDescription).map(new Func1, IotHubDescriptionInner>() { + @Override + public IotHubDescriptionInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create or update the metadata of an IoT hub. + * Create or update the metadata of an Iot hub. The usual pattern to modify a property is to retrieve the IoT hub metadata and security metadata, and then combine them with the modified values in a new body to update the IoT hub. + * + * @param resourceGroupName The name of the resource group that contains the IoT hub. + * @param resourceName The name of the IoT hub. + * @param iotHubDescription The IoT hub metadata and security metadata. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String resourceName, IotHubDescriptionInner iotHubDescription) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (resourceName == null) { + throw new IllegalArgumentException("Parameter resourceName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (iotHubDescription == null) { + throw new IllegalArgumentException("Parameter iotHubDescription is required and cannot be null."); + } + Validator.validate(iotHubDescription); + final String ifMatch = null; + Observable> observable = service.createOrUpdate(this.client.subscriptionId(), resourceGroupName, resourceName, this.client.apiVersion(), iotHubDescription, ifMatch, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + /** + * Create or update the metadata of an IoT hub. + * Create or update the metadata of an Iot hub. The usual pattern to modify a property is to retrieve the IoT hub metadata and security metadata, and then combine them with the modified values in a new body to update the IoT hub. + * + * @param resourceGroupName The name of the resource group that contains the IoT hub. + * @param resourceName The name of the IoT hub. + * @param iotHubDescription The IoT hub metadata and security metadata. + * @param ifMatch ETag of the IoT Hub. Do not specify for creating a brand new IoT Hub. Required to update an existing IoT Hub. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorDetailsInnerException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the IotHubDescriptionInner object if successful. + */ + public IotHubDescriptionInner createOrUpdate(String resourceGroupName, String resourceName, IotHubDescriptionInner iotHubDescription, String ifMatch) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, resourceName, iotHubDescription, ifMatch).toBlocking().last().body(); + } + + /** + * Create or update the metadata of an IoT hub. + * Create or update the metadata of an Iot hub. The usual pattern to modify a property is to retrieve the IoT hub metadata and security metadata, and then combine them with the modified values in a new body to update the IoT hub. + * + * @param resourceGroupName The name of the resource group that contains the IoT hub. + * @param resourceName The name of the IoT hub. + * @param iotHubDescription The IoT hub metadata and security metadata. + * @param ifMatch ETag of the IoT Hub. Do not specify for creating a brand new IoT Hub. Required to update an existing IoT Hub. + * @param serviceCallback 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, IotHubDescriptionInner iotHubDescription, String ifMatch, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, resourceName, iotHubDescription, ifMatch), serviceCallback); + } + + /** + * Create or update the metadata of an IoT hub. + * Create or update the metadata of an Iot hub. The usual pattern to modify a property is to retrieve the IoT hub metadata and security metadata, and then combine them with the modified values in a new body to update the IoT hub. + * + * @param resourceGroupName The name of the resource group that contains the IoT hub. + * @param resourceName The name of the IoT hub. + * @param iotHubDescription The IoT hub metadata and security metadata. + * @param ifMatch ETag of the IoT Hub. Do not specify for creating a brand new IoT Hub. Required to update an existing IoT Hub. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createOrUpdateAsync(String resourceGroupName, String resourceName, IotHubDescriptionInner iotHubDescription, String ifMatch) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, resourceName, iotHubDescription, ifMatch).map(new Func1, IotHubDescriptionInner>() { + @Override + public IotHubDescriptionInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create or update the metadata of an IoT hub. + * Create or update the metadata of an Iot hub. The usual pattern to modify a property is to retrieve the IoT hub metadata and security metadata, and then combine them with the modified values in a new body to update the IoT hub. + * + * @param resourceGroupName The name of the resource group that contains the IoT hub. + * @param resourceName The name of the IoT hub. + * @param iotHubDescription The IoT hub metadata and security metadata. + * @param ifMatch ETag of the IoT Hub. Do not specify for creating a brand new IoT Hub. Required to update an existing IoT Hub. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String resourceName, IotHubDescriptionInner iotHubDescription, String ifMatch) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (resourceName == null) { + throw new IllegalArgumentException("Parameter resourceName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (iotHubDescription == null) { + throw new IllegalArgumentException("Parameter iotHubDescription is required and cannot be null."); + } + Validator.validate(iotHubDescription); + Observable> observable = service.createOrUpdate(this.client.subscriptionId(), resourceGroupName, resourceName, this.client.apiVersion(), iotHubDescription, ifMatch, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Create or update the metadata of an IoT hub. + * Create or update the metadata of an Iot hub. The usual pattern to modify a property is to retrieve the IoT hub metadata and security metadata, and then combine them with the modified values in a new body to update the IoT hub. + * + * @param resourceGroupName The name of the resource group that contains the IoT hub. + * @param resourceName The name of the IoT hub. + * @param iotHubDescription The IoT hub metadata and security metadata. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorDetailsInnerException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the IotHubDescriptionInner object if successful. + */ + public IotHubDescriptionInner beginCreateOrUpdate(String resourceGroupName, String resourceName, IotHubDescriptionInner iotHubDescription) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, resourceName, iotHubDescription).toBlocking().single().body(); + } + + /** + * Create or update the metadata of an IoT hub. + * Create or update the metadata of an Iot hub. The usual pattern to modify a property is to retrieve the IoT hub metadata and security metadata, and then combine them with the modified values in a new body to update the IoT hub. + * + * @param resourceGroupName The name of the resource group that contains the IoT hub. + * @param resourceName The name of the IoT hub. + * @param iotHubDescription The IoT hub metadata 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, IotHubDescriptionInner iotHubDescription, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, resourceName, iotHubDescription), serviceCallback); + } + + /** + * Create or update the metadata of an IoT hub. + * Create or update the metadata of an Iot hub. The usual pattern to modify a property is to retrieve the IoT hub metadata and security metadata, and then combine them with the modified values in a new body to update the IoT hub. + * + * @param resourceGroupName The name of the resource group that contains the IoT hub. + * @param resourceName The name of the IoT hub. + * @param iotHubDescription The IoT hub metadata and security metadata. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the IotHubDescriptionInner object + */ + public Observable beginCreateOrUpdateAsync(String resourceGroupName, String resourceName, IotHubDescriptionInner iotHubDescription) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, resourceName, iotHubDescription).map(new Func1, IotHubDescriptionInner>() { + @Override + public IotHubDescriptionInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create or update the metadata of an IoT hub. + * Create or update the metadata of an Iot hub. The usual pattern to modify a property is to retrieve the IoT hub metadata and security metadata, and then combine them with the modified values in a new body to update the IoT hub. + * + * @param resourceGroupName The name of the resource group that contains the IoT hub. + * @param resourceName The name of the IoT hub. + * @param iotHubDescription The IoT hub metadata and security metadata. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the IotHubDescriptionInner object + */ + public Observable> beginCreateOrUpdateWithServiceResponseAsync(String resourceGroupName, String resourceName, IotHubDescriptionInner iotHubDescription) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (resourceName == null) { + throw new IllegalArgumentException("Parameter resourceName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (iotHubDescription == null) { + throw new IllegalArgumentException("Parameter iotHubDescription is required and cannot be null."); + } + Validator.validate(iotHubDescription); + final String ifMatch = null; + return service.beginCreateOrUpdate(this.client.subscriptionId(), resourceGroupName, resourceName, this.client.apiVersion(), iotHubDescription, ifMatch, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Create or update the metadata of an IoT hub. + * Create or update the metadata of an Iot hub. The usual pattern to modify a property is to retrieve the IoT hub metadata and security metadata, and then combine them with the modified values in a new body to update the IoT hub. + * + * @param resourceGroupName The name of the resource group that contains the IoT hub. + * @param resourceName The name of the IoT hub. + * @param iotHubDescription The IoT hub metadata and security metadata. + * @param ifMatch ETag of the IoT Hub. Do not specify for creating a brand new IoT Hub. Required to update an existing IoT Hub. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorDetailsInnerException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the IotHubDescriptionInner object if successful. + */ + public IotHubDescriptionInner beginCreateOrUpdate(String resourceGroupName, String resourceName, IotHubDescriptionInner iotHubDescription, String ifMatch) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, resourceName, iotHubDescription, ifMatch).toBlocking().single().body(); + } + + /** + * Create or update the metadata of an IoT hub. + * Create or update the metadata of an Iot hub. The usual pattern to modify a property is to retrieve the IoT hub metadata and security metadata, and then combine them with the modified values in a new body to update the IoT hub. + * + * @param resourceGroupName The name of the resource group that contains the IoT hub. + * @param resourceName The name of the IoT hub. + * @param iotHubDescription The IoT hub metadata and security metadata. + * @param ifMatch ETag of the IoT Hub. Do not specify for creating a brand new IoT Hub. Required to update an existing IoT Hub. + * @param serviceCallback 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, IotHubDescriptionInner iotHubDescription, String ifMatch, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, resourceName, iotHubDescription, ifMatch), serviceCallback); + } + + /** + * Create or update the metadata of an IoT hub. + * Create or update the metadata of an Iot hub. The usual pattern to modify a property is to retrieve the IoT hub metadata and security metadata, and then combine them with the modified values in a new body to update the IoT hub. + * + * @param resourceGroupName The name of the resource group that contains the IoT hub. + * @param resourceName The name of the IoT hub. + * @param iotHubDescription The IoT hub metadata and security metadata. + * @param ifMatch ETag of the IoT Hub. Do not specify for creating a brand new IoT Hub. Required to update an existing IoT Hub. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the IotHubDescriptionInner object + */ + public Observable beginCreateOrUpdateAsync(String resourceGroupName, String resourceName, IotHubDescriptionInner iotHubDescription, String ifMatch) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, resourceName, iotHubDescription, ifMatch).map(new Func1, IotHubDescriptionInner>() { + @Override + public IotHubDescriptionInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create or update the metadata of an IoT hub. + * Create or update the metadata of an Iot hub. The usual pattern to modify a property is to retrieve the IoT hub metadata and security metadata, and then combine them with the modified values in a new body to update the IoT hub. + * + * @param resourceGroupName The name of the resource group that contains the IoT hub. + * @param resourceName The name of the IoT hub. + * @param iotHubDescription The IoT hub metadata and security metadata. + * @param ifMatch ETag of the IoT Hub. Do not specify for creating a brand new IoT Hub. Required to update an existing IoT Hub. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the IotHubDescriptionInner object + */ + public Observable> beginCreateOrUpdateWithServiceResponseAsync(String resourceGroupName, String resourceName, IotHubDescriptionInner iotHubDescription, String ifMatch) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (resourceName == null) { + throw new IllegalArgumentException("Parameter resourceName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (iotHubDescription == null) { + throw new IllegalArgumentException("Parameter iotHubDescription is required and cannot be null."); + } + Validator.validate(iotHubDescription); + return service.beginCreateOrUpdate(this.client.subscriptionId(), resourceGroupName, resourceName, this.client.apiVersion(), iotHubDescription, ifMatch, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateOrUpdateDelegate(Response response) throws ErrorDetailsInnerException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(ErrorDetailsInnerException.class) + .build(response); + } + + /** + * Update an existing IoT Hubs tags. + * Update an existing IoT Hub tags. to update other fields use the CreateOrUpdate method. + * + * @param resourceGroupName Resource group identifier. + * @param resourceName Name of iot hub to update. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the IotHubDescriptionInner object if successful. + */ + public IotHubDescriptionInner update(String resourceGroupName, String resourceName) { + return updateWithServiceResponseAsync(resourceGroupName, resourceName).toBlocking().last().body(); + } + + /** + * Update an existing IoT Hubs tags. + * Update an existing IoT Hub tags. to update other fields use the CreateOrUpdate method. + * + * @param resourceGroupName Resource group identifier. + * @param resourceName Name of iot hub to update. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateAsync(String resourceGroupName, String resourceName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, resourceName), serviceCallback); + } + + /** + * Update an existing IoT Hubs tags. + * Update an existing IoT Hub tags. to update other fields use the CreateOrUpdate method. + * + * @param resourceGroupName Resource group identifier. + * @param resourceName Name of iot hub to update. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable updateAsync(String resourceGroupName, String resourceName) { + return updateWithServiceResponseAsync(resourceGroupName, resourceName).map(new Func1, IotHubDescriptionInner>() { + @Override + public IotHubDescriptionInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Update an existing IoT Hubs tags. + * Update an existing IoT Hub tags. to update other fields use the CreateOrUpdate method. + * + * @param resourceGroupName Resource group identifier. + * @param resourceName Name of iot hub to update. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> updateWithServiceResponseAsync(String resourceGroupName, String resourceName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (resourceName == null) { + throw new IllegalArgumentException("Parameter resourceName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final Map tags = null; + TagsResource iotHubTags = new TagsResource(); + iotHubTags.withTags(null); + Observable> observable = service.update(this.client.subscriptionId(), resourceGroupName, resourceName, this.client.apiVersion(), this.client.acceptLanguage(), iotHubTags, this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + /** + * Update an existing IoT Hubs tags. + * Update an existing IoT Hub tags. to update other fields use the CreateOrUpdate method. + * + * @param resourceGroupName Resource group identifier. + * @param resourceName Name of iot hub to update. + * @param tags Resource tags + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the IotHubDescriptionInner object if successful. + */ + public IotHubDescriptionInner update(String resourceGroupName, String resourceName, Map tags) { + return updateWithServiceResponseAsync(resourceGroupName, resourceName, tags).toBlocking().last().body(); + } + + /** + * Update an existing IoT Hubs tags. + * Update an existing IoT Hub tags. to update other fields use the CreateOrUpdate method. + * + * @param resourceGroupName Resource group identifier. + * @param resourceName Name of iot hub to update. + * @param tags Resource tags + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateAsync(String resourceGroupName, String resourceName, Map tags, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, resourceName, tags), serviceCallback); + } + + /** + * Update an existing IoT Hubs tags. + * Update an existing IoT Hub tags. to update other fields use the CreateOrUpdate method. + * + * @param resourceGroupName Resource group identifier. + * @param resourceName Name of iot hub to update. + * @param tags Resource tags + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable updateAsync(String resourceGroupName, String resourceName, Map tags) { + return updateWithServiceResponseAsync(resourceGroupName, resourceName, tags).map(new Func1, IotHubDescriptionInner>() { + @Override + public IotHubDescriptionInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Update an existing IoT Hubs tags. + * Update an existing IoT Hub tags. to update other fields use the CreateOrUpdate method. + * + * @param resourceGroupName Resource group identifier. + * @param resourceName Name of iot hub to update. + * @param tags Resource tags + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> updateWithServiceResponseAsync(String resourceGroupName, String resourceName, Map tags) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (resourceName == null) { + throw new IllegalArgumentException("Parameter resourceName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(tags); + TagsResource iotHubTags = new TagsResource(); + iotHubTags.withTags(tags); + Observable> observable = service.update(this.client.subscriptionId(), resourceGroupName, resourceName, this.client.apiVersion(), this.client.acceptLanguage(), iotHubTags, this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Update an existing IoT Hubs tags. + * Update an existing IoT Hub tags. to update other fields use the CreateOrUpdate method. + * + * @param resourceGroupName Resource group identifier. + * @param resourceName Name of iot hub to update. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the IotHubDescriptionInner object if successful. + */ + public IotHubDescriptionInner beginUpdate(String resourceGroupName, String resourceName) { + return beginUpdateWithServiceResponseAsync(resourceGroupName, resourceName).toBlocking().single().body(); + } + + /** + * Update an existing IoT Hubs tags. + * Update an existing IoT Hub tags. to update other fields use the CreateOrUpdate method. + * + * @param resourceGroupName Resource group identifier. + * @param resourceName Name of iot hub to update. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginUpdateAsync(String resourceGroupName, String resourceName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateWithServiceResponseAsync(resourceGroupName, resourceName), serviceCallback); + } + + /** + * Update an existing IoT Hubs tags. + * Update an existing IoT Hub tags. to update other fields use the CreateOrUpdate method. + * + * @param resourceGroupName Resource group identifier. + * @param resourceName Name of iot hub to update. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the IotHubDescriptionInner object + */ + public Observable beginUpdateAsync(String resourceGroupName, String resourceName) { + return beginUpdateWithServiceResponseAsync(resourceGroupName, resourceName).map(new Func1, IotHubDescriptionInner>() { + @Override + public IotHubDescriptionInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Update an existing IoT Hubs tags. + * Update an existing IoT Hub tags. to update other fields use the CreateOrUpdate method. + * + * @param resourceGroupName Resource group identifier. + * @param resourceName Name of iot hub to update. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the IotHubDescriptionInner object + */ + public Observable> beginUpdateWithServiceResponseAsync(String resourceGroupName, String resourceName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (resourceName == null) { + throw new IllegalArgumentException("Parameter resourceName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final Map tags = null; + TagsResource iotHubTags = new TagsResource(); + iotHubTags.withTags(null); + return service.beginUpdate(this.client.subscriptionId(), resourceGroupName, resourceName, this.client.apiVersion(), this.client.acceptLanguage(), iotHubTags, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Update an existing IoT Hubs tags. + * Update an existing IoT Hub tags. to update other fields use the CreateOrUpdate method. + * + * @param resourceGroupName Resource group identifier. + * @param resourceName Name of iot hub to update. + * @param tags Resource tags + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the IotHubDescriptionInner object if successful. + */ + public IotHubDescriptionInner beginUpdate(String resourceGroupName, String resourceName, Map tags) { + return beginUpdateWithServiceResponseAsync(resourceGroupName, resourceName, tags).toBlocking().single().body(); + } + + /** + * Update an existing IoT Hubs tags. + * Update an existing IoT Hub tags. to update other fields use the CreateOrUpdate method. + * + * @param resourceGroupName Resource group identifier. + * @param resourceName Name of iot hub to update. + * @param tags Resource tags + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginUpdateAsync(String resourceGroupName, String resourceName, Map tags, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateWithServiceResponseAsync(resourceGroupName, resourceName, tags), serviceCallback); + } + + /** + * Update an existing IoT Hubs tags. + * Update an existing IoT Hub tags. to update other fields use the CreateOrUpdate method. + * + * @param resourceGroupName Resource group identifier. + * @param resourceName Name of iot hub to update. + * @param tags Resource tags + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the IotHubDescriptionInner object + */ + public Observable beginUpdateAsync(String resourceGroupName, String resourceName, Map tags) { + return beginUpdateWithServiceResponseAsync(resourceGroupName, resourceName, tags).map(new Func1, IotHubDescriptionInner>() { + @Override + public IotHubDescriptionInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Update an existing IoT Hubs tags. + * Update an existing IoT Hub tags. to update other fields use the CreateOrUpdate method. + * + * @param resourceGroupName Resource group identifier. + * @param resourceName Name of iot hub to update. + * @param tags Resource tags + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the IotHubDescriptionInner object + */ + public Observable> beginUpdateWithServiceResponseAsync(String resourceGroupName, String resourceName, Map tags) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (resourceName == null) { + throw new IllegalArgumentException("Parameter resourceName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(tags); + TagsResource iotHubTags = new TagsResource(); + iotHubTags.withTags(tags); + return service.beginUpdate(this.client.subscriptionId(), resourceGroupName, resourceName, this.client.apiVersion(), this.client.acceptLanguage(), iotHubTags, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Delete an IoT hub. + * Delete an IoT hub. + * + * @param resourceGroupName The name of the resource group that contains the IoT hub. + * @param resourceName The name of the IoT hub. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorDetailsInnerException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Object object if successful. + */ + public Object delete(String resourceGroupName, String resourceName) { + return deleteWithServiceResponseAsync(resourceGroupName, resourceName).toBlocking().last().body(); + } + + /** + * Delete an IoT hub. + * Delete an IoT hub. + * + * @param resourceGroupName The name of the resource group that contains the IoT hub. + * @param resourceName The name of the IoT hub. + * @param serviceCallback 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 an IoT hub. + * Delete an IoT hub. + * + * @param resourceGroupName The name of the resource group that contains the IoT hub. + * @param resourceName The name of the IoT hub. + * @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, Object>() { + @Override + public Object call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Delete an IoT hub. + * Delete an IoT hub. + * + * @param resourceGroupName The name of the resource group that contains the IoT hub. + * @param resourceName The name of the IoT hub. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String resourceName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (resourceName == null) { + throw new IllegalArgumentException("Parameter resourceName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Observable> observable = service.delete(this.client.subscriptionId(), resourceGroupName, resourceName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Delete an IoT hub. + * Delete an IoT hub. + * + * @param resourceGroupName The name of the resource group that contains the IoT hub. + * @param resourceName The name of the IoT hub. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorDetailsInnerException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Object object if successful. + */ + public Object beginDelete(String resourceGroupName, String resourceName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, resourceName).toBlocking().single().body(); + } + + /** + * Delete an IoT hub. + * Delete an IoT hub. + * + * @param resourceGroupName The name of the resource group that contains the IoT hub. + * @param resourceName The name of the IoT hub. + * @param serviceCallback 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 an IoT hub. + * Delete an IoT hub. + * + * @param resourceGroupName The name of the resource group that contains the IoT hub. + * @param resourceName The name of the IoT hub. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Object object + */ + public Observable beginDeleteAsync(String resourceGroupName, String resourceName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, resourceName).map(new Func1, Object>() { + @Override + public Object call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Delete an IoT hub. + * Delete an IoT hub. + * + * @param resourceGroupName The name of the resource group that contains the IoT hub. + * @param resourceName The name of the IoT hub. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Object 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."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.beginDelete(this.client.subscriptionId(), resourceGroupName, resourceName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteDelegate(Response response) throws ErrorDetailsInnerException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .register(404, new TypeToken() { }.getType()) + .registerError(ErrorDetailsInnerException.class) + .build(response); + } + + /** + * Get all the IoT hubs in a subscription. + * Get all the IoT hubs in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorDetailsInnerException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<IotHubDescriptionInner> 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 IoT hubs in a subscription. + * Get all the IoT hubs 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 IoT hubs in a subscription. + * Get all the IoT hubs in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<IotHubDescriptionInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Get all the IoT hubs in a subscription. + * Get all the IoT hubs in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<IotHubDescriptionInner> 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 IoT hubs in a subscription. + * Get all the IoT hubs in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<IotHubDescriptionInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync() { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.list(this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws ErrorDetailsInnerException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorDetailsInnerException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorDetailsInnerException.class) + .build(response); + } + + /** + * Get all the IoT hubs in a resource group. + * Get all the IoT hubs in a resource group. + * + * @param resourceGroupName The name of the resource group that contains the IoT hub. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorDetailsInnerException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<IotHubDescriptionInner> 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 IoT hubs in a resource group. + * Get all the IoT hubs in a resource group. + * + * @param resourceGroupName The name of the resource group that contains the IoT hub. + * @param serviceCallback 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 IoT hubs in a resource group. + * Get all the IoT hubs in a resource group. + * + * @param resourceGroupName The name of the resource group that contains the IoT hub. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<IotHubDescriptionInner> 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 IoT hubs in a resource group. + * Get all the IoT hubs in a resource group. + * + * @param resourceGroupName The name of the resource group that contains the IoT hub. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<IotHubDescriptionInner> 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 IoT hubs in a resource group. + * Get all the IoT hubs in a resource group. + * + ServiceResponse> * @param resourceGroupName The name of the resource group that contains the IoT hub. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<IotHubDescriptionInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupSinglePageAsync(final String resourceGroupName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.listByResourceGroup(this.client.subscriptionId(), resourceGroupName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupDelegate(Response response) throws ErrorDetailsInnerException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorDetailsInnerException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorDetailsInnerException.class) + .build(response); + } + + /** + * Get the statistics from an IoT hub. + * Get the statistics from an IoT hub. + * + * @param resourceGroupName The name of the resource group that contains the IoT hub. + * @param resourceName The name of the IoT hub. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorDetailsInnerException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the RegistryStatisticsInner object if successful. + */ + public RegistryStatisticsInner getStats(String resourceGroupName, String resourceName) { + return getStatsWithServiceResponseAsync(resourceGroupName, resourceName).toBlocking().single().body(); + } + + /** + * Get the statistics from an IoT hub. + * Get the statistics from an IoT hub. + * + * @param resourceGroupName The name of the resource group that contains the IoT hub. + * @param resourceName The name of the IoT hub. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getStatsAsync(String resourceGroupName, String resourceName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getStatsWithServiceResponseAsync(resourceGroupName, resourceName), serviceCallback); + } + + /** + * Get the statistics from an IoT hub. + * Get the statistics from an IoT hub. + * + * @param resourceGroupName The name of the resource group that contains the IoT hub. + * @param resourceName The name of the IoT hub. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the RegistryStatisticsInner object + */ + public Observable getStatsAsync(String resourceGroupName, String resourceName) { + return getStatsWithServiceResponseAsync(resourceGroupName, resourceName).map(new Func1, RegistryStatisticsInner>() { + @Override + public RegistryStatisticsInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get the statistics from an IoT hub. + * Get the statistics from an IoT hub. + * + * @param resourceGroupName The name of the resource group that contains the IoT hub. + * @param resourceName The name of the IoT hub. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the RegistryStatisticsInner object + */ + public Observable> getStatsWithServiceResponseAsync(String resourceGroupName, String resourceName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (resourceName == null) { + throw new IllegalArgumentException("Parameter resourceName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.getStats(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 = getStatsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getStatsDelegate(Response response) throws ErrorDetailsInnerException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorDetailsInnerException.class) + .build(response); + } + + /** + * Get the list of valid SKUs for an IoT hub. + * Get the list of valid SKUs for an IoT hub. + * + * @param resourceGroupName The name of the resource group that contains the IoT hub. + * @param resourceName The name of the IoT hub. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorDetailsInnerException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<IotHubSkuDescriptionInner> object if successful. + */ + public PagedList getValidSkus(final String resourceGroupName, final String resourceName) { + ServiceResponse> response = getValidSkusSinglePageAsync(resourceGroupName, resourceName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return getValidSkusNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Get the list of valid SKUs for an IoT hub. + * Get the list of valid SKUs for an IoT hub. + * + * @param resourceGroupName The name of the resource group that contains the IoT hub. + * @param resourceName The name of the IoT hub. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> getValidSkusAsync(final String resourceGroupName, final String resourceName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + getValidSkusSinglePageAsync(resourceGroupName, resourceName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return getValidSkusNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Get the list of valid SKUs for an IoT hub. + * Get the list of valid SKUs for an IoT hub. + * + * @param resourceGroupName The name of the resource group that contains the IoT hub. + * @param resourceName The name of the IoT hub. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<IotHubSkuDescriptionInner> object + */ + public Observable> getValidSkusAsync(final String resourceGroupName, final String resourceName) { + return getValidSkusWithServiceResponseAsync(resourceGroupName, resourceName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Get the list of valid SKUs for an IoT hub. + * Get the list of valid SKUs for an IoT hub. + * + * @param resourceGroupName The name of the resource group that contains the IoT hub. + * @param resourceName The name of the IoT hub. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<IotHubSkuDescriptionInner> object + */ + public Observable>> getValidSkusWithServiceResponseAsync(final String resourceGroupName, final String resourceName) { + return getValidSkusSinglePageAsync(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(getValidSkusNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Get the list of valid SKUs for an IoT hub. + * Get the list of valid SKUs for an IoT hub. + * + ServiceResponse> * @param resourceGroupName The name of the resource group that contains the IoT hub. + ServiceResponse> * @param resourceName The name of the IoT hub. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<IotHubSkuDescriptionInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> getValidSkusSinglePageAsync(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."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.getValidSkus(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 = getValidSkusDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> getValidSkusDelegate(Response response) throws ErrorDetailsInnerException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorDetailsInnerException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorDetailsInnerException.class) + .build(response); + } + + /** + * Get a list of the consumer groups in the Event Hub-compatible device-to-cloud endpoint in an IoT hub. + * Get a list of the consumer groups in the Event Hub-compatible device-to-cloud endpoint in an IoT hub. + * + * @param resourceGroupName The name of the resource group that contains the IoT hub. + * @param resourceName The name of the IoT hub. + * @param eventHubEndpointName The name of the Event Hub-compatible endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorDetailsInnerException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<EventHubConsumerGroupInfoInner> object if successful. + */ + public PagedList listEventHubConsumerGroups(final String resourceGroupName, final String resourceName, final String eventHubEndpointName) { + ServiceResponse> response = listEventHubConsumerGroupsSinglePageAsync(resourceGroupName, resourceName, eventHubEndpointName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listEventHubConsumerGroupsNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Get a list of the consumer groups in the Event Hub-compatible device-to-cloud endpoint in an IoT hub. + * Get a list of the consumer groups in the Event Hub-compatible device-to-cloud endpoint in an IoT hub. + * + * @param resourceGroupName The name of the resource group that contains the IoT hub. + * @param resourceName The name of the IoT hub. + * @param eventHubEndpointName The name of the Event Hub-compatible endpoint. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listEventHubConsumerGroupsAsync(final String resourceGroupName, final String resourceName, final String eventHubEndpointName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listEventHubConsumerGroupsSinglePageAsync(resourceGroupName, resourceName, eventHubEndpointName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listEventHubConsumerGroupsNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Get a list of the consumer groups in the Event Hub-compatible device-to-cloud endpoint in an IoT hub. + * Get a list of the consumer groups in the Event Hub-compatible device-to-cloud endpoint in an IoT hub. + * + * @param resourceGroupName The name of the resource group that contains the IoT hub. + * @param resourceName The name of the IoT hub. + * @param eventHubEndpointName The name of the Event Hub-compatible endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<EventHubConsumerGroupInfoInner> object + */ + public Observable> listEventHubConsumerGroupsAsync(final String resourceGroupName, final String resourceName, final String eventHubEndpointName) { + return listEventHubConsumerGroupsWithServiceResponseAsync(resourceGroupName, resourceName, eventHubEndpointName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Get a list of the consumer groups in the Event Hub-compatible device-to-cloud endpoint in an IoT hub. + * Get a list of the consumer groups in the Event Hub-compatible device-to-cloud endpoint in an IoT hub. + * + * @param resourceGroupName The name of the resource group that contains the IoT hub. + * @param resourceName The name of the IoT hub. + * @param eventHubEndpointName The name of the Event Hub-compatible endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<EventHubConsumerGroupInfoInner> object + */ + public Observable>> listEventHubConsumerGroupsWithServiceResponseAsync(final String resourceGroupName, final String resourceName, final String eventHubEndpointName) { + return listEventHubConsumerGroupsSinglePageAsync(resourceGroupName, resourceName, eventHubEndpointName) + .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(listEventHubConsumerGroupsNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Get a list of the consumer groups in the Event Hub-compatible device-to-cloud endpoint in an IoT hub. + * Get a list of the consumer groups in the Event Hub-compatible device-to-cloud endpoint in an IoT hub. + * + ServiceResponse> * @param resourceGroupName The name of the resource group that contains the IoT hub. + ServiceResponse> * @param resourceName The name of the IoT hub. + ServiceResponse> * @param eventHubEndpointName The name of the Event Hub-compatible endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<EventHubConsumerGroupInfoInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listEventHubConsumerGroupsSinglePageAsync(final String resourceGroupName, final String resourceName, final String eventHubEndpointName) { + 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 (eventHubEndpointName == null) { + throw new IllegalArgumentException("Parameter eventHubEndpointName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.listEventHubConsumerGroups(this.client.subscriptionId(), resourceGroupName, resourceName, eventHubEndpointName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listEventHubConsumerGroupsDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listEventHubConsumerGroupsDelegate(Response response) throws ErrorDetailsInnerException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorDetailsInnerException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorDetailsInnerException.class) + .build(response); + } + + /** + * Get a consumer group from the Event Hub-compatible device-to-cloud endpoint for an IoT hub. + * Get a consumer group from the Event Hub-compatible device-to-cloud endpoint for an IoT hub. + * + * @param resourceGroupName The name of the resource group that contains the IoT hub. + * @param resourceName The name of the IoT hub. + * @param eventHubEndpointName The name of the Event Hub-compatible endpoint in the IoT hub. + * @param name The name of the consumer group to retrieve. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorDetailsInnerException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the EventHubConsumerGroupInfoInner object if successful. + */ + public EventHubConsumerGroupInfoInner getEventHubConsumerGroup(String resourceGroupName, String resourceName, String eventHubEndpointName, String name) { + return getEventHubConsumerGroupWithServiceResponseAsync(resourceGroupName, resourceName, eventHubEndpointName, name).toBlocking().single().body(); + } + + /** + * Get a consumer group from the Event Hub-compatible device-to-cloud endpoint for an IoT hub. + * Get a consumer group from the Event Hub-compatible device-to-cloud endpoint for an IoT hub. + * + * @param resourceGroupName The name of the resource group that contains the IoT hub. + * @param resourceName The name of the IoT hub. + * @param eventHubEndpointName The name of the Event Hub-compatible endpoint in the IoT hub. + * @param name The name of the consumer group to retrieve. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getEventHubConsumerGroupAsync(String resourceGroupName, String resourceName, String eventHubEndpointName, String name, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getEventHubConsumerGroupWithServiceResponseAsync(resourceGroupName, resourceName, eventHubEndpointName, name), serviceCallback); + } + + /** + * Get a consumer group from the Event Hub-compatible device-to-cloud endpoint for an IoT hub. + * Get a consumer group from the Event Hub-compatible device-to-cloud endpoint for an IoT hub. + * + * @param resourceGroupName The name of the resource group that contains the IoT hub. + * @param resourceName The name of the IoT hub. + * @param eventHubEndpointName The name of the Event Hub-compatible endpoint in the IoT hub. + * @param name The name of the consumer group to retrieve. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the EventHubConsumerGroupInfoInner object + */ + public Observable getEventHubConsumerGroupAsync(String resourceGroupName, String resourceName, String eventHubEndpointName, String name) { + return getEventHubConsumerGroupWithServiceResponseAsync(resourceGroupName, resourceName, eventHubEndpointName, name).map(new Func1, EventHubConsumerGroupInfoInner>() { + @Override + public EventHubConsumerGroupInfoInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get a consumer group from the Event Hub-compatible device-to-cloud endpoint for an IoT hub. + * Get a consumer group from the Event Hub-compatible device-to-cloud endpoint for an IoT hub. + * + * @param resourceGroupName The name of the resource group that contains the IoT hub. + * @param resourceName The name of the IoT hub. + * @param eventHubEndpointName The name of the Event Hub-compatible endpoint in the IoT hub. + * @param name The name of the consumer group to retrieve. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the EventHubConsumerGroupInfoInner object + */ + public Observable> getEventHubConsumerGroupWithServiceResponseAsync(String resourceGroupName, String resourceName, String eventHubEndpointName, String name) { + 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 (eventHubEndpointName == null) { + throw new IllegalArgumentException("Parameter eventHubEndpointName is required and cannot be null."); + } + if (name == null) { + throw new IllegalArgumentException("Parameter name is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.getEventHubConsumerGroup(this.client.subscriptionId(), resourceGroupName, resourceName, eventHubEndpointName, name, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getEventHubConsumerGroupDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getEventHubConsumerGroupDelegate(Response response) throws ErrorDetailsInnerException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorDetailsInnerException.class) + .build(response); + } + + /** + * Add a consumer group to an Event Hub-compatible endpoint in an IoT hub. + * Add a consumer group to an Event Hub-compatible endpoint in an IoT hub. + * + * @param resourceGroupName The name of the resource group that contains the IoT hub. + * @param resourceName The name of the IoT hub. + * @param eventHubEndpointName The name of the Event Hub-compatible endpoint in the IoT hub. + * @param name The name of the consumer group to add. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorDetailsInnerException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the EventHubConsumerGroupInfoInner object if successful. + */ + public EventHubConsumerGroupInfoInner createEventHubConsumerGroup(String resourceGroupName, String resourceName, String eventHubEndpointName, String name) { + return createEventHubConsumerGroupWithServiceResponseAsync(resourceGroupName, resourceName, eventHubEndpointName, name).toBlocking().single().body(); + } + + /** + * Add a consumer group to an Event Hub-compatible endpoint in an IoT hub. + * Add a consumer group to an Event Hub-compatible endpoint in an IoT hub. + * + * @param resourceGroupName The name of the resource group that contains the IoT hub. + * @param resourceName The name of the IoT hub. + * @param eventHubEndpointName The name of the Event Hub-compatible endpoint in the IoT hub. + * @param name The name of the consumer group to add. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createEventHubConsumerGroupAsync(String resourceGroupName, String resourceName, String eventHubEndpointName, String name, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createEventHubConsumerGroupWithServiceResponseAsync(resourceGroupName, resourceName, eventHubEndpointName, name), serviceCallback); + } + + /** + * Add a consumer group to an Event Hub-compatible endpoint in an IoT hub. + * Add a consumer group to an Event Hub-compatible endpoint in an IoT hub. + * + * @param resourceGroupName The name of the resource group that contains the IoT hub. + * @param resourceName The name of the IoT hub. + * @param eventHubEndpointName The name of the Event Hub-compatible endpoint in the IoT hub. + * @param name The name of the consumer group to add. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the EventHubConsumerGroupInfoInner object + */ + public Observable createEventHubConsumerGroupAsync(String resourceGroupName, String resourceName, String eventHubEndpointName, String name) { + return createEventHubConsumerGroupWithServiceResponseAsync(resourceGroupName, resourceName, eventHubEndpointName, name).map(new Func1, EventHubConsumerGroupInfoInner>() { + @Override + public EventHubConsumerGroupInfoInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Add a consumer group to an Event Hub-compatible endpoint in an IoT hub. + * Add a consumer group to an Event Hub-compatible endpoint in an IoT hub. + * + * @param resourceGroupName The name of the resource group that contains the IoT hub. + * @param resourceName The name of the IoT hub. + * @param eventHubEndpointName The name of the Event Hub-compatible endpoint in the IoT hub. + * @param name The name of the consumer group to add. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the EventHubConsumerGroupInfoInner object + */ + public Observable> createEventHubConsumerGroupWithServiceResponseAsync(String resourceGroupName, String resourceName, String eventHubEndpointName, String name) { + 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 (eventHubEndpointName == null) { + throw new IllegalArgumentException("Parameter eventHubEndpointName is required and cannot be null."); + } + if (name == null) { + throw new IllegalArgumentException("Parameter name is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.createEventHubConsumerGroup(this.client.subscriptionId(), resourceGroupName, resourceName, eventHubEndpointName, name, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = createEventHubConsumerGroupDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse createEventHubConsumerGroupDelegate(Response response) throws ErrorDetailsInnerException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorDetailsInnerException.class) + .build(response); + } + + /** + * Delete a consumer group from an Event Hub-compatible endpoint in an IoT hub. + * Delete a consumer group from an Event Hub-compatible endpoint in an IoT hub. + * + * @param resourceGroupName The name of the resource group that contains the IoT hub. + * @param resourceName The name of the IoT hub. + * @param eventHubEndpointName The name of the Event Hub-compatible endpoint in the IoT hub. + * @param name The name of the consumer group to delete. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorDetailsInnerException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void deleteEventHubConsumerGroup(String resourceGroupName, String resourceName, String eventHubEndpointName, String name) { + deleteEventHubConsumerGroupWithServiceResponseAsync(resourceGroupName, resourceName, eventHubEndpointName, name).toBlocking().single().body(); + } + + /** + * Delete a consumer group from an Event Hub-compatible endpoint in an IoT hub. + * Delete a consumer group from an Event Hub-compatible endpoint in an IoT hub. + * + * @param resourceGroupName The name of the resource group that contains the IoT hub. + * @param resourceName The name of the IoT hub. + * @param eventHubEndpointName The name of the Event Hub-compatible endpoint in the IoT hub. + * @param name The name of the consumer group to delete. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteEventHubConsumerGroupAsync(String resourceGroupName, String resourceName, String eventHubEndpointName, String name, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteEventHubConsumerGroupWithServiceResponseAsync(resourceGroupName, resourceName, eventHubEndpointName, name), serviceCallback); + } + + /** + * Delete a consumer group from an Event Hub-compatible endpoint in an IoT hub. + * Delete a consumer group from an Event Hub-compatible endpoint in an IoT hub. + * + * @param resourceGroupName The name of the resource group that contains the IoT hub. + * @param resourceName The name of the IoT hub. + * @param eventHubEndpointName The name of the Event Hub-compatible endpoint in the IoT hub. + * @param name The name of the consumer group to delete. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable deleteEventHubConsumerGroupAsync(String resourceGroupName, String resourceName, String eventHubEndpointName, String name) { + return deleteEventHubConsumerGroupWithServiceResponseAsync(resourceGroupName, resourceName, eventHubEndpointName, name).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Delete a consumer group from an Event Hub-compatible endpoint in an IoT hub. + * Delete a consumer group from an Event Hub-compatible endpoint in an IoT hub. + * + * @param resourceGroupName The name of the resource group that contains the IoT hub. + * @param resourceName The name of the IoT hub. + * @param eventHubEndpointName The name of the Event Hub-compatible endpoint in the IoT hub. + * @param name The name of the consumer group to delete. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> deleteEventHubConsumerGroupWithServiceResponseAsync(String resourceGroupName, String resourceName, String eventHubEndpointName, String name) { + 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 (eventHubEndpointName == null) { + throw new IllegalArgumentException("Parameter eventHubEndpointName is required and cannot be null."); + } + if (name == null) { + throw new IllegalArgumentException("Parameter name is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.deleteEventHubConsumerGroup(this.client.subscriptionId(), resourceGroupName, resourceName, eventHubEndpointName, name, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = deleteEventHubConsumerGroupDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse deleteEventHubConsumerGroupDelegate(Response response) throws ErrorDetailsInnerException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorDetailsInnerException.class) + .build(response); + } + + /** + * Get a list of all the jobs in an IoT hub. For more information, see: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry. + * Get a list of all the jobs in an IoT hub. For more information, see: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry. + * + * @param resourceGroupName The name of the resource group that contains the IoT hub. + * @param resourceName The name of the IoT hub. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorDetailsInnerException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<JobResponseInner> object if successful. + */ + public PagedList listJobs(final String resourceGroupName, final String resourceName) { + ServiceResponse> response = listJobsSinglePageAsync(resourceGroupName, resourceName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listJobsNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Get a list of all the jobs in an IoT hub. For more information, see: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry. + * Get a list of all the jobs in an IoT hub. For more information, see: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry. + * + * @param resourceGroupName The name of the resource group that contains the IoT hub. + * @param resourceName The name of the IoT hub. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listJobsAsync(final String resourceGroupName, final String resourceName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listJobsSinglePageAsync(resourceGroupName, resourceName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listJobsNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Get a list of all the jobs in an IoT hub. For more information, see: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry. + * Get a list of all the jobs in an IoT hub. For more information, see: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry. + * + * @param resourceGroupName The name of the resource group that contains the IoT hub. + * @param resourceName The name of the IoT hub. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<JobResponseInner> object + */ + public Observable> listJobsAsync(final String resourceGroupName, final String resourceName) { + return listJobsWithServiceResponseAsync(resourceGroupName, resourceName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Get a list of all the jobs in an IoT hub. For more information, see: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry. + * Get a list of all the jobs in an IoT hub. For more information, see: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry. + * + * @param resourceGroupName The name of the resource group that contains the IoT hub. + * @param resourceName The name of the IoT hub. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<JobResponseInner> object + */ + public Observable>> listJobsWithServiceResponseAsync(final String resourceGroupName, final String resourceName) { + return listJobsSinglePageAsync(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(listJobsNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Get a list of all the jobs in an IoT hub. For more information, see: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry. + * Get a list of all the jobs in an IoT hub. For more information, see: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry. + * + ServiceResponse> * @param resourceGroupName The name of the resource group that contains the IoT hub. + ServiceResponse> * @param resourceName The name of the IoT hub. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<JobResponseInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listJobsSinglePageAsync(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."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.listJobs(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 = listJobsDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listJobsDelegate(Response response) throws ErrorDetailsInnerException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorDetailsInnerException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorDetailsInnerException.class) + .build(response); + } + + /** + * Get the details of a job from an IoT hub. For more information, see: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry. + * Get the details of a job from an IoT hub. For more information, see: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry. + * + * @param resourceGroupName The name of the resource group that contains the IoT hub. + * @param resourceName The name of the IoT hub. + * @param jobId The job identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorDetailsInnerException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the JobResponseInner object if successful. + */ + public JobResponseInner getJob(String resourceGroupName, String resourceName, String jobId) { + return getJobWithServiceResponseAsync(resourceGroupName, resourceName, jobId).toBlocking().single().body(); + } + + /** + * Get the details of a job from an IoT hub. For more information, see: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry. + * Get the details of a job from an IoT hub. For more information, see: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry. + * + * @param resourceGroupName The name of the resource group that contains the IoT hub. + * @param resourceName The name of the IoT hub. + * @param jobId The job identifier. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getJobAsync(String resourceGroupName, String resourceName, String jobId, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getJobWithServiceResponseAsync(resourceGroupName, resourceName, jobId), serviceCallback); + } + + /** + * Get the details of a job from an IoT hub. For more information, see: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry. + * Get the details of a job from an IoT hub. For more information, see: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry. + * + * @param resourceGroupName The name of the resource group that contains the IoT hub. + * @param resourceName The name of the IoT hub. + * @param jobId The job identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the JobResponseInner object + */ + public Observable getJobAsync(String resourceGroupName, String resourceName, String jobId) { + return getJobWithServiceResponseAsync(resourceGroupName, resourceName, jobId).map(new Func1, JobResponseInner>() { + @Override + public JobResponseInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get the details of a job from an IoT hub. For more information, see: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry. + * Get the details of a job from an IoT hub. For more information, see: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry. + * + * @param resourceGroupName The name of the resource group that contains the IoT hub. + * @param resourceName The name of the IoT hub. + * @param jobId The job identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the JobResponseInner object + */ + public Observable> getJobWithServiceResponseAsync(String resourceGroupName, String resourceName, String jobId) { + 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 (jobId == null) { + throw new IllegalArgumentException("Parameter jobId is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.getJob(this.client.subscriptionId(), resourceGroupName, resourceName, jobId, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getJobDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getJobDelegate(Response response) throws ErrorDetailsInnerException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorDetailsInnerException.class) + .build(response); + } + + /** + * Get the quota metrics for an IoT hub. + * Get the quota metrics for an IoT hub. + * + * @param resourceGroupName The name of the resource group that contains the IoT hub. + * @param resourceName The name of the IoT hub. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorDetailsInnerException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<IotHubQuotaMetricInfoInner> object if successful. + */ + public PagedList getQuotaMetrics(final String resourceGroupName, final String resourceName) { + ServiceResponse> response = getQuotaMetricsSinglePageAsync(resourceGroupName, resourceName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return getQuotaMetricsNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Get the quota metrics for an IoT hub. + * Get the quota metrics for an IoT hub. + * + * @param resourceGroupName The name of the resource group that contains the IoT hub. + * @param resourceName The name of the IoT hub. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> getQuotaMetricsAsync(final String resourceGroupName, final String resourceName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + getQuotaMetricsSinglePageAsync(resourceGroupName, resourceName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return getQuotaMetricsNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Get the quota metrics for an IoT hub. + * Get the quota metrics for an IoT hub. + * + * @param resourceGroupName The name of the resource group that contains the IoT hub. + * @param resourceName The name of the IoT hub. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<IotHubQuotaMetricInfoInner> object + */ + public Observable> getQuotaMetricsAsync(final String resourceGroupName, final String resourceName) { + return getQuotaMetricsWithServiceResponseAsync(resourceGroupName, resourceName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Get the quota metrics for an IoT hub. + * Get the quota metrics for an IoT hub. + * + * @param resourceGroupName The name of the resource group that contains the IoT hub. + * @param resourceName The name of the IoT hub. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<IotHubQuotaMetricInfoInner> object + */ + public Observable>> getQuotaMetricsWithServiceResponseAsync(final String resourceGroupName, final String resourceName) { + return getQuotaMetricsSinglePageAsync(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(getQuotaMetricsNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Get the quota metrics for an IoT hub. + * Get the quota metrics for an IoT hub. + * + ServiceResponse> * @param resourceGroupName The name of the resource group that contains the IoT hub. + ServiceResponse> * @param resourceName The name of the IoT hub. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<IotHubQuotaMetricInfoInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> getQuotaMetricsSinglePageAsync(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."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.getQuotaMetrics(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 = getQuotaMetricsDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> getQuotaMetricsDelegate(Response response) throws ErrorDetailsInnerException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorDetailsInnerException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorDetailsInnerException.class) + .build(response); + } + + /** + * Get the health for routing endpoints. + * Get the health for routing endpoints. + * + * @param resourceGroupName the String value + * @param iotHubName the String value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorDetailsInnerException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<EndpointHealthDataInner> object if successful. + */ + public PagedList getEndpointHealth(final String resourceGroupName, final String iotHubName) { + ServiceResponse> response = getEndpointHealthSinglePageAsync(resourceGroupName, iotHubName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return getEndpointHealthNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Get the health for routing endpoints. + * Get the health for routing endpoints. + * + * @param resourceGroupName the String value + * @param iotHubName the String 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> getEndpointHealthAsync(final String resourceGroupName, final String iotHubName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + getEndpointHealthSinglePageAsync(resourceGroupName, iotHubName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return getEndpointHealthNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Get the health for routing endpoints. + * Get the health for routing endpoints. + * + * @param resourceGroupName the String value + * @param iotHubName the String value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<EndpointHealthDataInner> object + */ + public Observable> getEndpointHealthAsync(final String resourceGroupName, final String iotHubName) { + return getEndpointHealthWithServiceResponseAsync(resourceGroupName, iotHubName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Get the health for routing endpoints. + * Get the health for routing endpoints. + * + * @param resourceGroupName the String value + * @param iotHubName the String value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<EndpointHealthDataInner> object + */ + public Observable>> getEndpointHealthWithServiceResponseAsync(final String resourceGroupName, final String iotHubName) { + return getEndpointHealthSinglePageAsync(resourceGroupName, iotHubName) + .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(getEndpointHealthNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Get the health for routing endpoints. + * Get the health for routing endpoints. + * + ServiceResponse> * @param resourceGroupName the String value + ServiceResponse> * @param iotHubName the String value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<EndpointHealthDataInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> getEndpointHealthSinglePageAsync(final String resourceGroupName, final String iotHubName) { + 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 (iotHubName == null) { + throw new IllegalArgumentException("Parameter iotHubName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.getEndpointHealth(this.client.subscriptionId(), resourceGroupName, iotHubName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = getEndpointHealthDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> getEndpointHealthDelegate(Response response) throws ErrorDetailsInnerException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorDetailsInnerException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorDetailsInnerException.class) + .build(response); + } + + /** + * Check if an IoT hub name is available. + * Check if an IoT hub name is available. + * + * @param name The name of the IoT hub to check. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorDetailsInnerException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the IotHubNameAvailabilityInfoInner object if successful. + */ + public IotHubNameAvailabilityInfoInner checkNameAvailability(String name) { + return checkNameAvailabilityWithServiceResponseAsync(name).toBlocking().single().body(); + } + + /** + * Check if an IoT hub name is available. + * Check if an IoT hub name is available. + * + * @param name The name of the IoT hub to check. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture checkNameAvailabilityAsync(String name, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(checkNameAvailabilityWithServiceResponseAsync(name), serviceCallback); + } + + /** + * Check if an IoT hub name is available. + * Check if an IoT hub name is available. + * + * @param name The name of the IoT hub to check. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the IotHubNameAvailabilityInfoInner object + */ + public Observable checkNameAvailabilityAsync(String name) { + return checkNameAvailabilityWithServiceResponseAsync(name).map(new Func1, IotHubNameAvailabilityInfoInner>() { + @Override + public IotHubNameAvailabilityInfoInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Check if an IoT hub name is available. + * Check if an IoT hub name is available. + * + * @param name The name of the IoT hub to check. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the IotHubNameAvailabilityInfoInner object + */ + public Observable> checkNameAvailabilityWithServiceResponseAsync(String name) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (name == null) { + throw new IllegalArgumentException("Parameter name is required and cannot be null."); + } + OperationInputs operationInputs = new OperationInputs(); + operationInputs.withName(name); + return service.checkNameAvailability(this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), operationInputs, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = checkNameAvailabilityDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse checkNameAvailabilityDelegate(Response response) throws ErrorDetailsInnerException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorDetailsInnerException.class) + .build(response); + } + + /** + * Test all routes. + * Test all routes configured in this Iot Hub. + * + * @param iotHubName IotHub to be tested + * @param resourceGroupName resource group which Iot Hub belongs to + * @param input Input for testing all routes + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorDetailsInnerException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the TestAllRoutesResultInner object if successful. + */ + public TestAllRoutesResultInner testAllRoutes(String iotHubName, String resourceGroupName, TestAllRoutesInput input) { + return testAllRoutesWithServiceResponseAsync(iotHubName, resourceGroupName, input).toBlocking().single().body(); + } + + /** + * Test all routes. + * Test all routes configured in this Iot Hub. + * + * @param iotHubName IotHub to be tested + * @param resourceGroupName resource group which Iot Hub belongs to + * @param input Input for testing all routes + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture testAllRoutesAsync(String iotHubName, String resourceGroupName, TestAllRoutesInput input, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(testAllRoutesWithServiceResponseAsync(iotHubName, resourceGroupName, input), serviceCallback); + } + + /** + * Test all routes. + * Test all routes configured in this Iot Hub. + * + * @param iotHubName IotHub to be tested + * @param resourceGroupName resource group which Iot Hub belongs to + * @param input Input for testing all routes + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the TestAllRoutesResultInner object + */ + public Observable testAllRoutesAsync(String iotHubName, String resourceGroupName, TestAllRoutesInput input) { + return testAllRoutesWithServiceResponseAsync(iotHubName, resourceGroupName, input).map(new Func1, TestAllRoutesResultInner>() { + @Override + public TestAllRoutesResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Test all routes. + * Test all routes configured in this Iot Hub. + * + * @param iotHubName IotHub to be tested + * @param resourceGroupName resource group which Iot Hub belongs to + * @param input Input for testing all routes + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the TestAllRoutesResultInner object + */ + public Observable> testAllRoutesWithServiceResponseAsync(String iotHubName, String resourceGroupName, TestAllRoutesInput input) { + if (iotHubName == null) { + throw new IllegalArgumentException("Parameter iotHubName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (input == null) { + throw new IllegalArgumentException("Parameter input is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(input); + return service.testAllRoutes(iotHubName, this.client.subscriptionId(), resourceGroupName, input, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = testAllRoutesDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse testAllRoutesDelegate(Response response) throws ErrorDetailsInnerException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorDetailsInnerException.class) + .build(response); + } + + /** + * Test the new route. + * Test the new route for this Iot Hub. + * + * @param iotHubName IotHub to be tested + * @param resourceGroupName resource group which Iot Hub belongs to + * @param input Route that needs to be tested + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorDetailsInnerException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the TestRouteResultInner object if successful. + */ + public TestRouteResultInner testRoute(String iotHubName, String resourceGroupName, TestRouteInput input) { + return testRouteWithServiceResponseAsync(iotHubName, resourceGroupName, input).toBlocking().single().body(); + } + + /** + * Test the new route. + * Test the new route for this Iot Hub. + * + * @param iotHubName IotHub to be tested + * @param resourceGroupName resource group which Iot Hub belongs to + * @param input Route that needs to be tested + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture testRouteAsync(String iotHubName, String resourceGroupName, TestRouteInput input, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(testRouteWithServiceResponseAsync(iotHubName, resourceGroupName, input), serviceCallback); + } + + /** + * Test the new route. + * Test the new route for this Iot Hub. + * + * @param iotHubName IotHub to be tested + * @param resourceGroupName resource group which Iot Hub belongs to + * @param input Route that needs to be tested + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the TestRouteResultInner object + */ + public Observable testRouteAsync(String iotHubName, String resourceGroupName, TestRouteInput input) { + return testRouteWithServiceResponseAsync(iotHubName, resourceGroupName, input).map(new Func1, TestRouteResultInner>() { + @Override + public TestRouteResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Test the new route. + * Test the new route for this Iot Hub. + * + * @param iotHubName IotHub to be tested + * @param resourceGroupName resource group which Iot Hub belongs to + * @param input Route that needs to be tested + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the TestRouteResultInner object + */ + public Observable> testRouteWithServiceResponseAsync(String iotHubName, String resourceGroupName, TestRouteInput input) { + if (iotHubName == null) { + throw new IllegalArgumentException("Parameter iotHubName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (input == null) { + throw new IllegalArgumentException("Parameter input is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(input); + return service.testRoute(iotHubName, this.client.subscriptionId(), resourceGroupName, input, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = testRouteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse testRouteDelegate(Response response) throws ErrorDetailsInnerException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorDetailsInnerException.class) + .build(response); + } + + /** + * Get the security metadata for an IoT hub. For more information, see: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-security. + * Get the security metadata for an IoT hub. For more information, see: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-security. + * + * @param resourceGroupName The name of the resource group that contains the IoT hub. + * @param resourceName The name of the IoT hub. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorDetailsInnerException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<SharedAccessSignatureAuthorizationRuleInner> object if successful. + */ + public PagedList listKeys(final String resourceGroupName, final String resourceName) { + ServiceResponse> response = listKeysSinglePageAsync(resourceGroupName, resourceName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listKeysNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Get the security metadata for an IoT hub. For more information, see: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-security. + * Get the security metadata for an IoT hub. For more information, see: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-security. + * + * @param resourceGroupName The name of the resource group that contains the IoT hub. + * @param resourceName The name of the IoT hub. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listKeysAsync(final String resourceGroupName, final String resourceName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listKeysSinglePageAsync(resourceGroupName, resourceName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listKeysNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Get the security metadata for an IoT hub. For more information, see: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-security. + * Get the security metadata for an IoT hub. For more information, see: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-security. + * + * @param resourceGroupName The name of the resource group that contains the IoT hub. + * @param resourceName The name of the IoT hub. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<SharedAccessSignatureAuthorizationRuleInner> object + */ + public Observable> listKeysAsync(final String resourceGroupName, final String resourceName) { + return listKeysWithServiceResponseAsync(resourceGroupName, resourceName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Get the security metadata for an IoT hub. For more information, see: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-security. + * Get the security metadata for an IoT hub. For more information, see: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-security. + * + * @param resourceGroupName The name of the resource group that contains the IoT hub. + * @param resourceName The name of the IoT hub. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<SharedAccessSignatureAuthorizationRuleInner> object + */ + public Observable>> listKeysWithServiceResponseAsync(final String resourceGroupName, final String resourceName) { + return listKeysSinglePageAsync(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(listKeysNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Get the security metadata for an IoT hub. For more information, see: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-security. + * Get the security metadata for an IoT hub. For more information, see: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-security. + * + ServiceResponse> * @param resourceGroupName The name of the resource group that contains the IoT hub. + ServiceResponse> * @param resourceName The name of the IoT hub. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<SharedAccessSignatureAuthorizationRuleInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listKeysSinglePageAsync(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."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.listKeys(this.client.subscriptionId(), resourceGroupName, resourceName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listKeysDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listKeysDelegate(Response response) throws ErrorDetailsInnerException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorDetailsInnerException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorDetailsInnerException.class) + .build(response); + } + + /** + * Get a shared access policy by name from an IoT hub. For more information, see: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-security. + * Get a shared access policy by name from an IoT hub. For more information, see: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-security. + * + * @param resourceGroupName The name of the resource group that contains the IoT hub. + * @param resourceName The name of the IoT hub. + * @param keyName The name of the shared access policy. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorDetailsInnerException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the SharedAccessSignatureAuthorizationRuleInner object if successful. + */ + public SharedAccessSignatureAuthorizationRuleInner getKeysForKeyName(String resourceGroupName, String resourceName, String keyName) { + return getKeysForKeyNameWithServiceResponseAsync(resourceGroupName, resourceName, keyName).toBlocking().single().body(); + } + + /** + * Get a shared access policy by name from an IoT hub. For more information, see: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-security. + * Get a shared access policy by name from an IoT hub. For more information, see: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-security. + * + * @param resourceGroupName The name of the resource group that contains the IoT hub. + * @param resourceName The name of the IoT hub. + * @param keyName The name of the shared access policy. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getKeysForKeyNameAsync(String resourceGroupName, String resourceName, String keyName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getKeysForKeyNameWithServiceResponseAsync(resourceGroupName, resourceName, keyName), serviceCallback); + } + + /** + * Get a shared access policy by name from an IoT hub. For more information, see: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-security. + * Get a shared access policy by name from an IoT hub. For more information, see: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-security. + * + * @param resourceGroupName The name of the resource group that contains the IoT hub. + * @param resourceName The name of the IoT hub. + * @param keyName The name of the shared access policy. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SharedAccessSignatureAuthorizationRuleInner object + */ + public Observable getKeysForKeyNameAsync(String resourceGroupName, String resourceName, String keyName) { + return getKeysForKeyNameWithServiceResponseAsync(resourceGroupName, resourceName, keyName).map(new Func1, SharedAccessSignatureAuthorizationRuleInner>() { + @Override + public SharedAccessSignatureAuthorizationRuleInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get a shared access policy by name from an IoT hub. For more information, see: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-security. + * Get a shared access policy by name from an IoT hub. For more information, see: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-security. + * + * @param resourceGroupName The name of the resource group that contains the IoT hub. + * @param resourceName The name of the IoT hub. + * @param keyName The name of the shared access policy. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SharedAccessSignatureAuthorizationRuleInner object + */ + public Observable> getKeysForKeyNameWithServiceResponseAsync(String resourceGroupName, String resourceName, String keyName) { + 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 (keyName == null) { + throw new IllegalArgumentException("Parameter keyName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.getKeysForKeyName(this.client.subscriptionId(), resourceGroupName, resourceName, keyName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getKeysForKeyNameDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getKeysForKeyNameDelegate(Response response) throws ErrorDetailsInnerException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorDetailsInnerException.class) + .build(response); + } + + /** + * Exports all the device identities in the IoT hub identity registry to an Azure Storage blob container. For more information, see: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry#import-and-export-device-identities. + * Exports all the device identities in the IoT hub identity registry to an Azure Storage blob container. For more information, see: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry#import-and-export-device-identities. + * + * @param resourceGroupName The name of the resource group that contains the IoT hub. + * @param resourceName The name of the IoT hub. + * @param exportDevicesParameters The parameters that specify the export devices operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorDetailsInnerException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the JobResponseInner object if successful. + */ + public JobResponseInner exportDevices(String resourceGroupName, String resourceName, ExportDevicesRequest exportDevicesParameters) { + return exportDevicesWithServiceResponseAsync(resourceGroupName, resourceName, exportDevicesParameters).toBlocking().single().body(); + } + + /** + * Exports all the device identities in the IoT hub identity registry to an Azure Storage blob container. For more information, see: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry#import-and-export-device-identities. + * Exports all the device identities in the IoT hub identity registry to an Azure Storage blob container. For more information, see: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry#import-and-export-device-identities. + * + * @param resourceGroupName The name of the resource group that contains the IoT hub. + * @param resourceName The name of the IoT hub. + * @param exportDevicesParameters The parameters that specify the export devices operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture exportDevicesAsync(String resourceGroupName, String resourceName, ExportDevicesRequest exportDevicesParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(exportDevicesWithServiceResponseAsync(resourceGroupName, resourceName, exportDevicesParameters), serviceCallback); + } + + /** + * Exports all the device identities in the IoT hub identity registry to an Azure Storage blob container. For more information, see: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry#import-and-export-device-identities. + * Exports all the device identities in the IoT hub identity registry to an Azure Storage blob container. For more information, see: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry#import-and-export-device-identities. + * + * @param resourceGroupName The name of the resource group that contains the IoT hub. + * @param resourceName The name of the IoT hub. + * @param exportDevicesParameters The parameters that specify the export devices operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the JobResponseInner object + */ + public Observable exportDevicesAsync(String resourceGroupName, String resourceName, ExportDevicesRequest exportDevicesParameters) { + return exportDevicesWithServiceResponseAsync(resourceGroupName, resourceName, exportDevicesParameters).map(new Func1, JobResponseInner>() { + @Override + public JobResponseInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Exports all the device identities in the IoT hub identity registry to an Azure Storage blob container. For more information, see: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry#import-and-export-device-identities. + * Exports all the device identities in the IoT hub identity registry to an Azure Storage blob container. For more information, see: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry#import-and-export-device-identities. + * + * @param resourceGroupName The name of the resource group that contains the IoT hub. + * @param resourceName The name of the IoT hub. + * @param exportDevicesParameters The parameters that specify the export devices operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the JobResponseInner object + */ + public Observable> exportDevicesWithServiceResponseAsync(String resourceGroupName, String resourceName, ExportDevicesRequest exportDevicesParameters) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (resourceName == null) { + throw new IllegalArgumentException("Parameter resourceName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (exportDevicesParameters == null) { + throw new IllegalArgumentException("Parameter exportDevicesParameters is required and cannot be null."); + } + Validator.validate(exportDevicesParameters); + return service.exportDevices(this.client.subscriptionId(), resourceGroupName, resourceName, this.client.apiVersion(), exportDevicesParameters, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = exportDevicesDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse exportDevicesDelegate(Response response) throws ErrorDetailsInnerException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorDetailsInnerException.class) + .build(response); + } + + /** + * Import, update, or delete device identities in the IoT hub identity registry from a blob. For more information, see: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry#import-and-export-device-identities. + * Import, update, or delete device identities in the IoT hub identity registry from a blob. For more information, see: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry#import-and-export-device-identities. + * + * @param resourceGroupName The name of the resource group that contains the IoT hub. + * @param resourceName The name of the IoT hub. + * @param importDevicesParameters The parameters that specify the import devices operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorDetailsInnerException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the JobResponseInner object if successful. + */ + public JobResponseInner importDevices(String resourceGroupName, String resourceName, ImportDevicesRequest importDevicesParameters) { + return importDevicesWithServiceResponseAsync(resourceGroupName, resourceName, importDevicesParameters).toBlocking().single().body(); + } + + /** + * Import, update, or delete device identities in the IoT hub identity registry from a blob. For more information, see: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry#import-and-export-device-identities. + * Import, update, or delete device identities in the IoT hub identity registry from a blob. For more information, see: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry#import-and-export-device-identities. + * + * @param resourceGroupName The name of the resource group that contains the IoT hub. + * @param resourceName The name of the IoT hub. + * @param importDevicesParameters The parameters that specify the import devices operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture importDevicesAsync(String resourceGroupName, String resourceName, ImportDevicesRequest importDevicesParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(importDevicesWithServiceResponseAsync(resourceGroupName, resourceName, importDevicesParameters), serviceCallback); + } + + /** + * Import, update, or delete device identities in the IoT hub identity registry from a blob. For more information, see: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry#import-and-export-device-identities. + * Import, update, or delete device identities in the IoT hub identity registry from a blob. For more information, see: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry#import-and-export-device-identities. + * + * @param resourceGroupName The name of the resource group that contains the IoT hub. + * @param resourceName The name of the IoT hub. + * @param importDevicesParameters The parameters that specify the import devices operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the JobResponseInner object + */ + public Observable importDevicesAsync(String resourceGroupName, String resourceName, ImportDevicesRequest importDevicesParameters) { + return importDevicesWithServiceResponseAsync(resourceGroupName, resourceName, importDevicesParameters).map(new Func1, JobResponseInner>() { + @Override + public JobResponseInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Import, update, or delete device identities in the IoT hub identity registry from a blob. For more information, see: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry#import-and-export-device-identities. + * Import, update, or delete device identities in the IoT hub identity registry from a blob. For more information, see: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry#import-and-export-device-identities. + * + * @param resourceGroupName The name of the resource group that contains the IoT hub. + * @param resourceName The name of the IoT hub. + * @param importDevicesParameters The parameters that specify the import devices operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the JobResponseInner object + */ + public Observable> importDevicesWithServiceResponseAsync(String resourceGroupName, String resourceName, ImportDevicesRequest importDevicesParameters) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (resourceName == null) { + throw new IllegalArgumentException("Parameter resourceName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (importDevicesParameters == null) { + throw new IllegalArgumentException("Parameter importDevicesParameters is required and cannot be null."); + } + Validator.validate(importDevicesParameters); + return service.importDevices(this.client.subscriptionId(), resourceGroupName, resourceName, this.client.apiVersion(), importDevicesParameters, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = importDevicesDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse importDevicesDelegate(Response response) throws ErrorDetailsInnerException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorDetailsInnerException.class) + .build(response); + } + + /** + * Get all the IoT hubs in a subscription. + * Get all the IoT hubs in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorDetailsInnerException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<IotHubDescriptionInner> 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 IoT hubs in a subscription. + * Get all the IoT hubs 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 IoT hubs in a subscription. + * Get all the IoT hubs 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<IotHubDescriptionInner> 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 IoT hubs in a subscription. + * Get all the IoT hubs 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<IotHubDescriptionInner> 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 IoT hubs in a subscription. + * Get all the IoT hubs 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<IotHubDescriptionInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws ErrorDetailsInnerException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorDetailsInnerException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorDetailsInnerException.class) + .build(response); + } + + /** + * Get all the IoT hubs in a resource group. + * Get all the IoT hubs in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorDetailsInnerException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<IotHubDescriptionInner> 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 IoT hubs in a resource group. + * Get all the IoT hubs 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 IoT hubs in a resource group. + * Get all the IoT hubs 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<IotHubDescriptionInner> 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 IoT hubs in a resource group. + * Get all the IoT hubs 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<IotHubDescriptionInner> 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 IoT hubs in a resource group. + * Get all the IoT hubs 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<IotHubDescriptionInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listByResourceGroupNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupNextDelegate(Response response) throws ErrorDetailsInnerException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorDetailsInnerException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorDetailsInnerException.class) + .build(response); + } + + /** + * Get the list of valid SKUs for an IoT hub. + * Get the list of valid SKUs for an IoT hub. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorDetailsInnerException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<IotHubSkuDescriptionInner> object if successful. + */ + public PagedList getValidSkusNext(final String nextPageLink) { + ServiceResponse> response = getValidSkusNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return getValidSkusNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Get the list of valid SKUs for an IoT hub. + * Get the list of valid SKUs for an IoT hub. + * + * @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> getValidSkusNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + getValidSkusNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return getValidSkusNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Get the list of valid SKUs for an IoT hub. + * Get the list of valid SKUs for an IoT hub. + * + * @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<IotHubSkuDescriptionInner> object + */ + public Observable> getValidSkusNextAsync(final String nextPageLink) { + return getValidSkusNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Get the list of valid SKUs for an IoT hub. + * Get the list of valid SKUs for an IoT hub. + * + * @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<IotHubSkuDescriptionInner> object + */ + public Observable>> getValidSkusNextWithServiceResponseAsync(final String nextPageLink) { + return getValidSkusNextSinglePageAsync(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(getValidSkusNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Get the list of valid SKUs for an IoT hub. + * Get the list of valid SKUs for an IoT hub. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<IotHubSkuDescriptionInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> getValidSkusNextSinglePageAsync(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.getValidSkusNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = getValidSkusNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> getValidSkusNextDelegate(Response response) throws ErrorDetailsInnerException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorDetailsInnerException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorDetailsInnerException.class) + .build(response); + } + + /** + * Get a list of the consumer groups in the Event Hub-compatible device-to-cloud endpoint in an IoT hub. + * Get a list of the consumer groups in the Event Hub-compatible device-to-cloud endpoint in an IoT hub. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorDetailsInnerException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<EventHubConsumerGroupInfoInner> object if successful. + */ + public PagedList listEventHubConsumerGroupsNext(final String nextPageLink) { + ServiceResponse> response = listEventHubConsumerGroupsNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listEventHubConsumerGroupsNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Get a list of the consumer groups in the Event Hub-compatible device-to-cloud endpoint in an IoT hub. + * Get a list of the consumer groups in the Event Hub-compatible device-to-cloud endpoint in an IoT hub. + * + * @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> listEventHubConsumerGroupsNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listEventHubConsumerGroupsNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listEventHubConsumerGroupsNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Get a list of the consumer groups in the Event Hub-compatible device-to-cloud endpoint in an IoT hub. + * Get a list of the consumer groups in the Event Hub-compatible device-to-cloud endpoint in an IoT hub. + * + * @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<EventHubConsumerGroupInfoInner> object + */ + public Observable> listEventHubConsumerGroupsNextAsync(final String nextPageLink) { + return listEventHubConsumerGroupsNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Get a list of the consumer groups in the Event Hub-compatible device-to-cloud endpoint in an IoT hub. + * Get a list of the consumer groups in the Event Hub-compatible device-to-cloud endpoint in an IoT hub. + * + * @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<EventHubConsumerGroupInfoInner> object + */ + public Observable>> listEventHubConsumerGroupsNextWithServiceResponseAsync(final String nextPageLink) { + return listEventHubConsumerGroupsNextSinglePageAsync(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(listEventHubConsumerGroupsNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Get a list of the consumer groups in the Event Hub-compatible device-to-cloud endpoint in an IoT hub. + * Get a list of the consumer groups in the Event Hub-compatible device-to-cloud endpoint in an IoT hub. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<EventHubConsumerGroupInfoInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listEventHubConsumerGroupsNextSinglePageAsync(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.listEventHubConsumerGroupsNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listEventHubConsumerGroupsNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listEventHubConsumerGroupsNextDelegate(Response response) throws ErrorDetailsInnerException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorDetailsInnerException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorDetailsInnerException.class) + .build(response); + } + + /** + * Get a list of all the jobs in an IoT hub. For more information, see: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry. + * Get a list of all the jobs in an IoT hub. For more information, see: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorDetailsInnerException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<JobResponseInner> object if successful. + */ + public PagedList listJobsNext(final String nextPageLink) { + ServiceResponse> response = listJobsNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listJobsNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Get a list of all the jobs in an IoT hub. For more information, see: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry. + * Get a list of all the jobs in an IoT hub. For more information, see: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry. + * + * @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> listJobsNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listJobsNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listJobsNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Get a list of all the jobs in an IoT hub. For more information, see: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry. + * Get a list of all the jobs in an IoT hub. For more information, see: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry. + * + * @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<JobResponseInner> object + */ + public Observable> listJobsNextAsync(final String nextPageLink) { + return listJobsNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Get a list of all the jobs in an IoT hub. For more information, see: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry. + * Get a list of all the jobs in an IoT hub. For more information, see: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry. + * + * @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<JobResponseInner> object + */ + public Observable>> listJobsNextWithServiceResponseAsync(final String nextPageLink) { + return listJobsNextSinglePageAsync(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(listJobsNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Get a list of all the jobs in an IoT hub. For more information, see: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry. + * Get a list of all the jobs in an IoT hub. For more information, see: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<JobResponseInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listJobsNextSinglePageAsync(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.listJobsNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listJobsNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listJobsNextDelegate(Response response) throws ErrorDetailsInnerException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorDetailsInnerException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorDetailsInnerException.class) + .build(response); + } + + /** + * Get the quota metrics for an IoT hub. + * Get the quota metrics for an IoT hub. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorDetailsInnerException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<IotHubQuotaMetricInfoInner> object if successful. + */ + public PagedList getQuotaMetricsNext(final String nextPageLink) { + ServiceResponse> response = getQuotaMetricsNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return getQuotaMetricsNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Get the quota metrics for an IoT hub. + * Get the quota metrics for an IoT hub. + * + * @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> getQuotaMetricsNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + getQuotaMetricsNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return getQuotaMetricsNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Get the quota metrics for an IoT hub. + * Get the quota metrics for an IoT hub. + * + * @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<IotHubQuotaMetricInfoInner> object + */ + public Observable> getQuotaMetricsNextAsync(final String nextPageLink) { + return getQuotaMetricsNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Get the quota metrics for an IoT hub. + * Get the quota metrics for an IoT hub. + * + * @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<IotHubQuotaMetricInfoInner> object + */ + public Observable>> getQuotaMetricsNextWithServiceResponseAsync(final String nextPageLink) { + return getQuotaMetricsNextSinglePageAsync(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(getQuotaMetricsNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Get the quota metrics for an IoT hub. + * Get the quota metrics for an IoT hub. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<IotHubQuotaMetricInfoInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> getQuotaMetricsNextSinglePageAsync(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.getQuotaMetricsNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = getQuotaMetricsNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> getQuotaMetricsNextDelegate(Response response) throws ErrorDetailsInnerException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorDetailsInnerException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorDetailsInnerException.class) + .build(response); + } + + /** + * Get the health for routing endpoints. + * Get the health for routing endpoints. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorDetailsInnerException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<EndpointHealthDataInner> object if successful. + */ + public PagedList getEndpointHealthNext(final String nextPageLink) { + ServiceResponse> response = getEndpointHealthNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return getEndpointHealthNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Get the health for routing endpoints. + * Get the health for routing 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> getEndpointHealthNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + getEndpointHealthNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return getEndpointHealthNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Get the health for routing endpoints. + * Get the health for routing 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<EndpointHealthDataInner> object + */ + public Observable> getEndpointHealthNextAsync(final String nextPageLink) { + return getEndpointHealthNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Get the health for routing endpoints. + * Get the health for routing 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<EndpointHealthDataInner> object + */ + public Observable>> getEndpointHealthNextWithServiceResponseAsync(final String nextPageLink) { + return getEndpointHealthNextSinglePageAsync(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(getEndpointHealthNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Get the health for routing endpoints. + * Get the health for routing 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<EndpointHealthDataInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> getEndpointHealthNextSinglePageAsync(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.getEndpointHealthNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = getEndpointHealthNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> getEndpointHealthNextDelegate(Response response) throws ErrorDetailsInnerException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorDetailsInnerException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorDetailsInnerException.class) + .build(response); + } + + /** + * Get the security metadata for an IoT hub. For more information, see: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-security. + * Get the security metadata for an IoT hub. For more information, see: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-security. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorDetailsInnerException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<SharedAccessSignatureAuthorizationRuleInner> object if successful. + */ + public PagedList listKeysNext(final String nextPageLink) { + ServiceResponse> response = listKeysNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listKeysNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Get the security metadata for an IoT hub. For more information, see: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-security. + * Get the security metadata for an IoT hub. For more information, see: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-security. + * + * @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> listKeysNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listKeysNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listKeysNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Get the security metadata for an IoT hub. For more information, see: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-security. + * Get the security metadata for an IoT hub. For more information, see: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-security. + * + * @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<SharedAccessSignatureAuthorizationRuleInner> object + */ + public Observable> listKeysNextAsync(final String nextPageLink) { + return listKeysNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Get the security metadata for an IoT hub. For more information, see: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-security. + * Get the security metadata for an IoT hub. For more information, see: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-security. + * + * @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<SharedAccessSignatureAuthorizationRuleInner> object + */ + public Observable>> listKeysNextWithServiceResponseAsync(final String nextPageLink) { + return listKeysNextSinglePageAsync(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(listKeysNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Get the security metadata for an IoT hub. For more information, see: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-security. + * Get the security metadata for an IoT hub. For more information, see: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-security. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<SharedAccessSignatureAuthorizationRuleInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listKeysNextSinglePageAsync(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.listKeysNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listKeysNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listKeysNextDelegate(Response response) throws ErrorDetailsInnerException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorDetailsInnerException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorDetailsInnerException.class) + .build(response); + } + +} diff --git a/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/implementation/IotHubSkuDescriptionImpl.java b/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/implementation/IotHubSkuDescriptionImpl.java new file mode 100644 index 0000000000000..6d3d141048f32 --- /dev/null +++ b/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/implementation/IotHubSkuDescriptionImpl.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.iothub.v2020_03_01.implementation; + +import com.microsoft.azure.management.iothub.v2020_03_01.IotHubSkuDescription; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import rx.Observable; +import com.microsoft.azure.management.iothub.v2020_03_01.IotHubCapacity; +import com.microsoft.azure.management.iothub.v2020_03_01.IotHubSkuInfo; + +class IotHubSkuDescriptionImpl extends WrapperImpl implements IotHubSkuDescription { + private final DevicesManager manager; + + IotHubSkuDescriptionImpl(IotHubSkuDescriptionInner inner, DevicesManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public DevicesManager manager() { + return this.manager; + } + + + + @Override + public IotHubCapacity capacity() { + return this.inner().capacity(); + } + + @Override + public String resourceType() { + return this.inner().resourceType(); + } + + @Override + public IotHubSkuInfo sku() { + return this.inner().sku(); + } + +} diff --git a/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/implementation/IotHubSkuDescriptionInner.java b/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/implementation/IotHubSkuDescriptionInner.java new file mode 100644 index 0000000000000..292a512655329 --- /dev/null +++ b/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/implementation/IotHubSkuDescriptionInner.java @@ -0,0 +1,86 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.iothub.v2020_03_01.implementation; + +import com.microsoft.azure.management.iothub.v2020_03_01.IotHubSkuInfo; +import com.microsoft.azure.management.iothub.v2020_03_01.IotHubCapacity; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * SKU properties. + */ +public class IotHubSkuDescriptionInner { + /** + * The type of the resource. + */ + @JsonProperty(value = "resourceType", access = JsonProperty.Access.WRITE_ONLY) + private String resourceType; + + /** + * The type of the resource. + */ + @JsonProperty(value = "sku", required = true) + private IotHubSkuInfo sku; + + /** + * IotHub capacity. + */ + @JsonProperty(value = "capacity", required = true) + private IotHubCapacity capacity; + + /** + * Get the type of the resource. + * + * @return the resourceType value + */ + public String resourceType() { + return this.resourceType; + } + + /** + * Get the type of the resource. + * + * @return the sku value + */ + public IotHubSkuInfo sku() { + return this.sku; + } + + /** + * Set the type of the resource. + * + * @param sku the sku value to set + * @return the IotHubSkuDescriptionInner object itself. + */ + public IotHubSkuDescriptionInner withSku(IotHubSkuInfo sku) { + this.sku = sku; + return this; + } + + /** + * Get iotHub capacity. + * + * @return the capacity value + */ + public IotHubCapacity capacity() { + return this.capacity; + } + + /** + * Set iotHub capacity. + * + * @param capacity the capacity value to set + * @return the IotHubSkuDescriptionInner object itself. + */ + public IotHubSkuDescriptionInner withCapacity(IotHubCapacity capacity) { + this.capacity = capacity; + return this; + } + +} diff --git a/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/implementation/IotHubsImpl.java b/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/implementation/IotHubsImpl.java new file mode 100644 index 0000000000000..86b1f3de5dbb0 --- /dev/null +++ b/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/implementation/IotHubsImpl.java @@ -0,0 +1,34 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * abc + */ + +package com.microsoft.azure.management.iothub.v2020_03_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.iothub.v2020_03_01.IotHubs; +import rx.Completable; + +class IotHubsImpl extends WrapperImpl implements IotHubs { + private final DevicesManager manager; + + IotHubsImpl(DevicesManager manager) { + super(manager.inner().iotHubs()); + this.manager = manager; + } + + public DevicesManager manager() { + return this.manager; + } + + @Override + public Completable manualFailoverAsync(String iotHubName, String resourceGroupName, String failoverRegion) { + IotHubsInner client = this.inner(); + return client.manualFailoverAsync(iotHubName, resourceGroupName, failoverRegion).toCompletable(); + } + +} diff --git a/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/implementation/IotHubsInner.java b/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/implementation/IotHubsInner.java new file mode 100644 index 0000000000000..ae4815a68b517 --- /dev/null +++ b/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/implementation/IotHubsInner.java @@ -0,0 +1,246 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.iothub.v2020_03_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.management.iothub.v2020_03_01.ErrorDetailsInnerException; +import com.microsoft.azure.management.iothub.v2020_03_01.FailoverInput; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Path; +import retrofit2.http.POST; +import retrofit2.http.Query; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in IotHubs. + */ +public class IotHubsInner { + /** The Retrofit service to perform REST calls. */ + private IotHubsService service; + /** The service client containing this operation class. */ + private IotHubClientImpl client; + + /** + * Initializes an instance of IotHubsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public IotHubsInner(Retrofit retrofit, IotHubClientImpl client) { + this.service = retrofit.create(IotHubsService.class); + this.client = client; + } + + /** + * The interface defining all the services for IotHubs to be + * used by Retrofit to perform actually REST calls. + */ + interface IotHubsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.iothub.v2020_03_01.IotHubs manualFailover" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{iotHubName}/failover") + Observable> manualFailover(@Path("iotHubName") String iotHubName, @Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body FailoverInput failoverInput, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.iothub.v2020_03_01.IotHubs beginManualFailover" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{iotHubName}/failover") + Observable> beginManualFailover(@Path("iotHubName") String iotHubName, @Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body FailoverInput failoverInput, @Header("User-Agent") String userAgent); + + } + + /** + * Manually initiate a failover for the IoT Hub to its secondary region. + * Manually initiate a failover for the IoT Hub to its secondary region. To learn more, see https://aka.ms/manualfailover. + * + * @param iotHubName Name of the IoT hub to failover + * @param resourceGroupName Name of the resource group containing the IoT hub resource + * @param failoverRegion Region the hub will be failed over to + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorDetailsInnerException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void manualFailover(String iotHubName, String resourceGroupName, String failoverRegion) { + manualFailoverWithServiceResponseAsync(iotHubName, resourceGroupName, failoverRegion).toBlocking().last().body(); + } + + /** + * Manually initiate a failover for the IoT Hub to its secondary region. + * Manually initiate a failover for the IoT Hub to its secondary region. To learn more, see https://aka.ms/manualfailover. + * + * @param iotHubName Name of the IoT hub to failover + * @param resourceGroupName Name of the resource group containing the IoT hub resource + * @param failoverRegion Region the hub will be failed over to + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture manualFailoverAsync(String iotHubName, String resourceGroupName, String failoverRegion, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(manualFailoverWithServiceResponseAsync(iotHubName, resourceGroupName, failoverRegion), serviceCallback); + } + + /** + * Manually initiate a failover for the IoT Hub to its secondary region. + * Manually initiate a failover for the IoT Hub to its secondary region. To learn more, see https://aka.ms/manualfailover. + * + * @param iotHubName Name of the IoT hub to failover + * @param resourceGroupName Name of the resource group containing the IoT hub resource + * @param failoverRegion Region the hub will be failed over to + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable manualFailoverAsync(String iotHubName, String resourceGroupName, String failoverRegion) { + return manualFailoverWithServiceResponseAsync(iotHubName, resourceGroupName, failoverRegion).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Manually initiate a failover for the IoT Hub to its secondary region. + * Manually initiate a failover for the IoT Hub to its secondary region. To learn more, see https://aka.ms/manualfailover. + * + * @param iotHubName Name of the IoT hub to failover + * @param resourceGroupName Name of the resource group containing the IoT hub resource + * @param failoverRegion Region the hub will be failed over to + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> manualFailoverWithServiceResponseAsync(String iotHubName, String resourceGroupName, String failoverRegion) { + if (iotHubName == null) { + throw new IllegalArgumentException("Parameter iotHubName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (failoverRegion == null) { + throw new IllegalArgumentException("Parameter failoverRegion is required and cannot be null."); + } + FailoverInput failoverInput = new FailoverInput(); + failoverInput.withFailoverRegion(failoverRegion); + Observable> observable = service.manualFailover(iotHubName, this.client.subscriptionId(), resourceGroupName, this.client.apiVersion(), this.client.acceptLanguage(), failoverInput, this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Manually initiate a failover for the IoT Hub to its secondary region. + * Manually initiate a failover for the IoT Hub to its secondary region. To learn more, see https://aka.ms/manualfailover. + * + * @param iotHubName Name of the IoT hub to failover + * @param resourceGroupName Name of the resource group containing the IoT hub resource + * @param failoverRegion Region the hub will be failed over to + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorDetailsInnerException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginManualFailover(String iotHubName, String resourceGroupName, String failoverRegion) { + beginManualFailoverWithServiceResponseAsync(iotHubName, resourceGroupName, failoverRegion).toBlocking().single().body(); + } + + /** + * Manually initiate a failover for the IoT Hub to its secondary region. + * Manually initiate a failover for the IoT Hub to its secondary region. To learn more, see https://aka.ms/manualfailover. + * + * @param iotHubName Name of the IoT hub to failover + * @param resourceGroupName Name of the resource group containing the IoT hub resource + * @param failoverRegion Region the hub will be failed over to + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginManualFailoverAsync(String iotHubName, String resourceGroupName, String failoverRegion, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginManualFailoverWithServiceResponseAsync(iotHubName, resourceGroupName, failoverRegion), serviceCallback); + } + + /** + * Manually initiate a failover for the IoT Hub to its secondary region. + * Manually initiate a failover for the IoT Hub to its secondary region. To learn more, see https://aka.ms/manualfailover. + * + * @param iotHubName Name of the IoT hub to failover + * @param resourceGroupName Name of the resource group containing the IoT hub resource + * @param failoverRegion Region the hub will be failed over to + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginManualFailoverAsync(String iotHubName, String resourceGroupName, String failoverRegion) { + return beginManualFailoverWithServiceResponseAsync(iotHubName, resourceGroupName, failoverRegion).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Manually initiate a failover for the IoT Hub to its secondary region. + * Manually initiate a failover for the IoT Hub to its secondary region. To learn more, see https://aka.ms/manualfailover. + * + * @param iotHubName Name of the IoT hub to failover + * @param resourceGroupName Name of the resource group containing the IoT hub resource + * @param failoverRegion Region the hub will be failed over to + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginManualFailoverWithServiceResponseAsync(String iotHubName, String resourceGroupName, String failoverRegion) { + if (iotHubName == null) { + throw new IllegalArgumentException("Parameter iotHubName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (failoverRegion == null) { + throw new IllegalArgumentException("Parameter failoverRegion is required and cannot be null."); + } + FailoverInput failoverInput = new FailoverInput(); + failoverInput.withFailoverRegion(failoverRegion); + return service.beginManualFailover(iotHubName, this.client.subscriptionId(), resourceGroupName, this.client.apiVersion(), this.client.acceptLanguage(), failoverInput, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginManualFailoverDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginManualFailoverDelegate(Response response) throws ErrorDetailsInnerException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(ErrorDetailsInnerException.class) + .build(response); + } + +} diff --git a/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/implementation/JobResponseImpl.java b/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/implementation/JobResponseImpl.java new file mode 100644 index 0000000000000..6d56ea0951164 --- /dev/null +++ b/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/implementation/JobResponseImpl.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.iothub.v2020_03_01.implementation; + +import com.microsoft.azure.management.iothub.v2020_03_01.JobResponse; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import rx.Observable; +import com.microsoft.rest.DateTimeRfc1123; +import org.joda.time.DateTime; +import com.microsoft.azure.management.iothub.v2020_03_01.JobStatus; +import com.microsoft.azure.management.iothub.v2020_03_01.JobType; + +class JobResponseImpl extends WrapperImpl implements JobResponse { + private final DevicesManager manager; + private String resourceGroupName; + private String resourceName; + private String jobId; + + JobResponseImpl(JobResponseInner inner, DevicesManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public DevicesManager manager() { + return this.manager; + } + + + + @Override + public DateTime endTimeUtc() { + return this.inner().endTimeUtc(); + } + + @Override + public String failureReason() { + return this.inner().failureReason(); + } + + @Override + public String jobId() { + return this.inner().jobId(); + } + + @Override + public String parentJobId() { + return this.inner().parentJobId(); + } + + @Override + public DateTime startTimeUtc() { + return this.inner().startTimeUtc(); + } + + @Override + public JobStatus status() { + return this.inner().status(); + } + + @Override + public String statusMessage() { + return this.inner().statusMessage(); + } + + @Override + public JobType type() { + return this.inner().type(); + } + +} diff --git a/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/implementation/JobResponseInner.java b/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/implementation/JobResponseInner.java new file mode 100644 index 0000000000000..15c4214bf72be --- /dev/null +++ b/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/implementation/JobResponseInner.java @@ -0,0 +1,151 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.iothub.v2020_03_01.implementation; + +import com.microsoft.rest.DateTimeRfc1123; +import org.joda.time.DateTime; +import com.microsoft.azure.management.iothub.v2020_03_01.JobType; +import com.microsoft.azure.management.iothub.v2020_03_01.JobStatus; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The properties of the Job Response object. + */ +public class JobResponseInner { + /** + * The job identifier. + */ + @JsonProperty(value = "jobId", access = JsonProperty.Access.WRITE_ONLY) + private String jobId; + + /** + * The start time of the job. + */ + @JsonProperty(value = "startTimeUtc", access = JsonProperty.Access.WRITE_ONLY) + private DateTimeRfc1123 startTimeUtc; + + /** + * The time the job stopped processing. + */ + @JsonProperty(value = "endTimeUtc", access = JsonProperty.Access.WRITE_ONLY) + private DateTimeRfc1123 endTimeUtc; + + /** + * The type of the job. Possible values include: 'unknown', 'export', + * 'import', 'backup', 'readDeviceProperties', 'writeDeviceProperties', + * 'updateDeviceConfiguration', 'rebootDevice', 'factoryResetDevice', + * 'firmwareUpdate'. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private JobType type; + + /** + * The status of the job. Possible values include: 'unknown', 'enqueued', + * 'running', 'completed', 'failed', 'cancelled'. + */ + @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY) + private JobStatus status; + + /** + * If status == failed, this string containing the reason for the failure. + */ + @JsonProperty(value = "failureReason", access = JsonProperty.Access.WRITE_ONLY) + private String failureReason; + + /** + * The status message for the job. + */ + @JsonProperty(value = "statusMessage", access = JsonProperty.Access.WRITE_ONLY) + private String statusMessage; + + /** + * The job identifier of the parent job, if any. + */ + @JsonProperty(value = "parentJobId", access = JsonProperty.Access.WRITE_ONLY) + private String parentJobId; + + /** + * Get the job identifier. + * + * @return the jobId value + */ + public String jobId() { + return this.jobId; + } + + /** + * Get the start time of the job. + * + * @return the startTimeUtc value + */ + public DateTime startTimeUtc() { + if (this.startTimeUtc == null) { + return null; + } + return this.startTimeUtc.dateTime(); + } + + /** + * Get the time the job stopped processing. + * + * @return the endTimeUtc value + */ + public DateTime endTimeUtc() { + if (this.endTimeUtc == null) { + return null; + } + return this.endTimeUtc.dateTime(); + } + + /** + * Get the type of the job. Possible values include: 'unknown', 'export', 'import', 'backup', 'readDeviceProperties', 'writeDeviceProperties', 'updateDeviceConfiguration', 'rebootDevice', 'factoryResetDevice', 'firmwareUpdate'. + * + * @return the type value + */ + public JobType type() { + return this.type; + } + + /** + * Get the status of the job. Possible values include: 'unknown', 'enqueued', 'running', 'completed', 'failed', 'cancelled'. + * + * @return the status value + */ + public JobStatus status() { + return this.status; + } + + /** + * Get if status == failed, this string containing the reason for the failure. + * + * @return the failureReason value + */ + public String failureReason() { + return this.failureReason; + } + + /** + * Get the status message for the job. + * + * @return the statusMessage value + */ + public String statusMessage() { + return this.statusMessage; + } + + /** + * Get the job identifier of the parent job, if any. + * + * @return the parentJobId value + */ + public String parentJobId() { + return this.parentJobId; + } + +} diff --git a/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/implementation/OperationImpl.java b/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/implementation/OperationImpl.java new file mode 100644 index 0000000000000..f41a34a5caf9f --- /dev/null +++ b/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/implementation/OperationImpl.java @@ -0,0 +1,37 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.iothub.v2020_03_01.implementation; + +import com.microsoft.azure.management.iothub.v2020_03_01.Operation; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.iothub.v2020_03_01.OperationDisplay; + +class OperationImpl extends WrapperImpl implements Operation { + private final DevicesManager manager; + OperationImpl(OperationInner inner, DevicesManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public DevicesManager manager() { + return this.manager; + } + + @Override + public OperationDisplay display() { + return this.inner().display(); + } + + @Override + public String name() { + return this.inner().name(); + } + +} diff --git a/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/implementation/OperationInner.java b/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/implementation/OperationInner.java new file mode 100644 index 0000000000000..d03fa29f10ffb --- /dev/null +++ b/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/implementation/OperationInner.java @@ -0,0 +1,59 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.iothub.v2020_03_01.implementation; + +import com.microsoft.azure.management.iothub.v2020_03_01.OperationDisplay; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * IoT Hub 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; + + /** + * The object that represents the operation. + */ + @JsonProperty(value = "display") + private OperationDisplay display; + + /** + * Get operation name: {provider}/{resource}/{read | write | action | delete}. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Get the object that represents the operation. + * + * @return the display value + */ + public OperationDisplay display() { + return this.display; + } + + /** + * Set the object that represents the operation. + * + * @param display the display value to set + * @return the OperationInner object itself. + */ + public OperationInner withDisplay(OperationDisplay display) { + this.display = display; + return this; + } + +} diff --git a/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/implementation/OperationsImpl.java b/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/implementation/OperationsImpl.java new file mode 100644 index 0000000000000..8b8da345de863 --- /dev/null +++ b/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_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.iothub.v2020_03_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.iothub.v2020_03_01.Operations; +import rx.functions.Func1; +import rx.Observable; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.iothub.v2020_03_01.Operation; + +class OperationsImpl extends WrapperImpl implements Operations { + private final DevicesManager manager; + + OperationsImpl(DevicesManager manager) { + super(manager.inner().operations()); + this.manager = manager; + } + + public DevicesManager 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/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/implementation/OperationsInner.java b/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/implementation/OperationsInner.java new file mode 100644 index 0000000000000..7b006313a6655 --- /dev/null +++ b/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/implementation/OperationsInner.java @@ -0,0 +1,283 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.iothub.v2020_03_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.iothub.v2020_03_01.ErrorDetailsInnerException; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Operations. + */ +public class OperationsInner { + /** The Retrofit service to perform REST calls. */ + private OperationsService service; + /** The service client containing this operation class. */ + private IotHubClientImpl 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, IotHubClientImpl 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.iothub.v2020_03_01.Operations list" }) + @GET("providers/Microsoft.Devices/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.iothub.v2020_03_01.Operations listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Lists all of the available IoT Hub REST API operations. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorDetailsInnerException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<OperationInner> object if successful. + */ + public PagedList list() { + ServiceResponse> response = listSinglePageAsync().toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all of the available IoT Hub 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 IoT Hub 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 IoT Hub 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 IoT Hub REST API operations. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<OperationInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync() { + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.list(this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws ErrorDetailsInnerException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorDetailsInnerException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorDetailsInnerException.class) + .build(response); + } + + /** + * Lists all of the available IoT Hub REST API operations. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorDetailsInnerException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<OperationInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all of the available IoT Hub 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 IoT Hub 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 IoT Hub 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 IoT Hub REST API operations. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<OperationInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws ErrorDetailsInnerException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorDetailsInnerException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorDetailsInnerException.class) + .build(response); + } + +} diff --git a/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/implementation/PageImpl.java b/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/implementation/PageImpl.java new file mode 100644 index 0000000000000..c0caf8aeab363 --- /dev/null +++ b/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/implementation/PageImpl.java @@ -0,0 +1,75 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.iothub.v2020_03_01.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.azure.Page; +import java.util.List; + +/** + * An instance of this class defines a page of Azure resources and a link to + * get the next page of resources, if any. + * + * @param type of Azure resource + */ +public class PageImpl implements Page { + /** + * The link to the next page. + */ + @JsonProperty("nextLink") + private String nextPageLink; + + /** + * The list of items. + */ + @JsonProperty("value") + private List items; + + /** + * Gets the link to the next page. + * + * @return the link to the next page. + */ + @Override + public String nextPageLink() { + return this.nextPageLink; + } + + /** + * Gets the list of items. + * + * @return the list of items in {@link List}. + */ + @Override + public List items() { + return items; + } + + /** + * Sets the link to the next page. + * + * @param nextPageLink the link to the next page. + * @return this Page object itself. + */ + public PageImpl setNextPageLink(String nextPageLink) { + this.nextPageLink = nextPageLink; + return this; + } + + /** + * Sets the list of items. + * + * @param items the list of items in {@link List}. + * @return this Page object itself. + */ + public PageImpl setItems(List items) { + this.items = items; + return this; + } +} diff --git a/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/implementation/PageImpl1.java b/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/implementation/PageImpl1.java new file mode 100644 index 0000000000000..e921d93fd5fe1 --- /dev/null +++ b/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/implementation/PageImpl1.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.iothub.v2020_03_01.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.azure.Page; +import java.util.List; + +/** + * An instance of this class defines a page of Azure resources and a link to + * get the next page of resources, if any. + * + * @param type of Azure resource + */ +public class PageImpl1 implements Page { + /** + * The link to the next page. + */ + @JsonProperty("") + 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 PageImpl1 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 PageImpl1 setItems(List items) { + this.items = items; + return this; + } +} diff --git a/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/implementation/PrivateEndpointConnectionImpl.java b/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/implementation/PrivateEndpointConnectionImpl.java new file mode 100644 index 0000000000000..cf16b46f82ab8 --- /dev/null +++ b/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/implementation/PrivateEndpointConnectionImpl.java @@ -0,0 +1,112 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.iothub.v2020_03_01.implementation; + +import com.microsoft.azure.management.iothub.v2020_03_01.PrivateEndpointConnection; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import com.microsoft.azure.management.iothub.v2020_03_01.PrivateEndpointConnectionProperties; +import rx.functions.Func1; + +class PrivateEndpointConnectionImpl extends CreatableUpdatableImpl implements PrivateEndpointConnection, PrivateEndpointConnection.Update { + private final DevicesManager manager; + private String resourceGroupName; + private String resourceName; + private String privateEndpointConnectionName; + private PrivateEndpointConnectionProperties uproperties; + + PrivateEndpointConnectionImpl(String name, DevicesManager manager) { + super(name, new PrivateEndpointConnectionInner()); + this.manager = manager; + // Set resource name + this.privateEndpointConnectionName = name; + // + this.uproperties = new PrivateEndpointConnectionProperties(); + } + + PrivateEndpointConnectionImpl(PrivateEndpointConnectionInner inner, DevicesManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.privateEndpointConnectionName = inner.name(); + // set resource ancestor and positional variables + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.resourceName = IdParsingUtils.getValueFromIdByName(inner.id(), "iotHubs"); + this.privateEndpointConnectionName = IdParsingUtils.getValueFromIdByName(inner.id(), "privateEndpointConnections"); + // + this.uproperties = new PrivateEndpointConnectionProperties(); + } + + @Override + public DevicesManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + PrivateEndpointConnectionsInner client = this.manager().inner().privateEndpointConnections(); + return null; // NOP createResourceAsync implementation as create is not supported + } + + @Override + public Observable updateResourceAsync() { + PrivateEndpointConnectionsInner client = this.manager().inner().privateEndpointConnections(); + return client.updateAsync(this.resourceGroupName, this.resourceName, this.privateEndpointConnectionName, this.uproperties) + .map(new Func1() { + @Override + public PrivateEndpointConnectionInner call(PrivateEndpointConnectionInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + PrivateEndpointConnectionsInner client = this.manager().inner().privateEndpointConnections(); + return client.getAsync(this.resourceGroupName, this.resourceName, this.privateEndpointConnectionName); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + private void resetCreateUpdateParameters() { + this.uproperties = new PrivateEndpointConnectionProperties(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public PrivateEndpointConnectionProperties properties() { + return this.inner().properties(); + } + + @Override + public String type() { + return this.inner().type(); + } + + @Override + public PrivateEndpointConnectionImpl withProperties(PrivateEndpointConnectionProperties properties) { + this.uproperties = properties; + return this; + } + +} diff --git a/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/implementation/PrivateEndpointConnectionInner.java b/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/implementation/PrivateEndpointConnectionInner.java new file mode 100644 index 0000000000000..26235ebe90ae5 --- /dev/null +++ b/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_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.iothub.v2020_03_01.implementation; + +import com.microsoft.azure.management.iothub.v2020_03_01.PrivateEndpointConnectionProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.azure.ProxyResource; + +/** + * The private endpoint connection of an IotHub. + */ +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/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/implementation/PrivateEndpointConnectionsImpl.java b/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/implementation/PrivateEndpointConnectionsImpl.java new file mode 100644 index 0000000000000..2be03ea4d5965 --- /dev/null +++ b/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/implementation/PrivateEndpointConnectionsImpl.java @@ -0,0 +1,76 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * + */ + +package com.microsoft.azure.management.iothub.v2020_03_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.iothub.v2020_03_01.PrivateEndpointConnections; +import rx.Completable; +import rx.Observable; +import rx.functions.Func1; +import java.util.List; +import com.microsoft.azure.management.iothub.v2020_03_01.PrivateEndpointConnection; + +class PrivateEndpointConnectionsImpl extends WrapperImpl implements PrivateEndpointConnections { + private final DevicesManager manager; + + PrivateEndpointConnectionsImpl(DevicesManager manager) { + super(manager.inner().privateEndpointConnections()); + this.manager = manager; + } + + public DevicesManager manager() { + return this.manager; + } + + private PrivateEndpointConnectionImpl wrapModel(PrivateEndpointConnectionInner inner) { + return new PrivateEndpointConnectionImpl(inner, manager()); + } + + @Override + public Observable listAsync(String resourceGroupName, String resourceName) { + PrivateEndpointConnectionsInner client = this.inner(); + return client.listAsync(resourceGroupName, resourceName) + .flatMap(new Func1, Observable>() { + @Override + public Observable call(List innerList) { + return Observable.from(innerList); + } + }) + .map(new Func1() { + @Override + public PrivateEndpointConnection call(PrivateEndpointConnectionInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Observable getAsync(String resourceGroupName, String resourceName, String privateEndpointConnectionName) { + PrivateEndpointConnectionsInner client = this.inner(); + return client.getAsync(resourceGroupName, resourceName, privateEndpointConnectionName) + .flatMap(new Func1>() { + @Override + public Observable call(PrivateEndpointConnectionInner inner) { + if (inner == null) { + return Observable.empty(); + } else { + return Observable.just((PrivateEndpointConnection)wrapModel(inner)); + } + } + }); + } + + @Override + public Completable deleteAsync(String resourceGroupName, String resourceName, String privateEndpointConnectionName) { + PrivateEndpointConnectionsInner client = this.inner(); + return client.deleteAsync(resourceGroupName, resourceName, privateEndpointConnectionName).toCompletable(); + } + +} diff --git a/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/implementation/PrivateEndpointConnectionsInner.java b/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/implementation/PrivateEndpointConnectionsInner.java new file mode 100644 index 0000000000000..132ca0bdeab6b --- /dev/null +++ b/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/implementation/PrivateEndpointConnectionsInner.java @@ -0,0 +1,650 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.iothub.v2020_03_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.management.iothub.v2020_03_01.ErrorDetailsInnerException; +import com.microsoft.azure.management.iothub.v2020_03_01.PrivateEndpointConnectionProperties; +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; + +/** + * An instance of this class provides access to all the operations defined + * in PrivateEndpointConnections. + */ +public class PrivateEndpointConnectionsInner { + /** The Retrofit service to perform REST calls. */ + private PrivateEndpointConnectionsService service; + /** The service client containing this operation class. */ + private IotHubClientImpl client; + + /** + * Initializes an instance of PrivateEndpointConnectionsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public PrivateEndpointConnectionsInner(Retrofit retrofit, IotHubClientImpl client) { + this.service = retrofit.create(PrivateEndpointConnectionsService.class); + this.client = client; + } + + /** + * The interface defining all the services for PrivateEndpointConnections to be + * used by Retrofit to perform actually REST calls. + */ + interface PrivateEndpointConnectionsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.iothub.v2020_03_01.PrivateEndpointConnections list" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/iotHubs/{resourceName}/privateEndpointConnections") + 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.iothub.v2020_03_01.PrivateEndpointConnections get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/iotHubs/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}") + Observable> get(@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.iothub.v2020_03_01.PrivateEndpointConnections update" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/iotHubs/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}") + Observable> update(@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.iothub.v2020_03_01.PrivateEndpointConnections beginUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/iotHubs/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}") + Observable> beginUpdate(@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.iothub.v2020_03_01.PrivateEndpointConnections delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/iotHubs/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}", method = "DELETE", hasBody = true) + Observable> delete(@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.iothub.v2020_03_01.PrivateEndpointConnections beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/iotHubs/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@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); + + } + + /** + * List private endpoint connections. + * List private endpoint connection properties. + * + * @param resourceGroupName The name of the resource group that contains the IoT hub. + * @param resourceName The name of the IoT hub. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorDetailsInnerException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the List<PrivateEndpointConnectionInner> object if successful. + */ + public List list(String resourceGroupName, String resourceName) { + return listWithServiceResponseAsync(resourceGroupName, resourceName).toBlocking().single().body(); + } + + /** + * List private endpoint connections. + * List private endpoint connection properties. + * + * @param resourceGroupName The name of the resource group that contains the IoT hub. + * @param resourceName The name of the IoT hub. + * @param serviceCallback 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(String resourceGroupName, String resourceName, final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(listWithServiceResponseAsync(resourceGroupName, resourceName), serviceCallback); + } + + /** + * List private endpoint connections. + * List private endpoint connection properties. + * + * @param resourceGroupName The name of the resource group that contains the IoT hub. + * @param resourceName The name of the IoT hub. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<PrivateEndpointConnectionInner> object + */ + public Observable> listAsync(String resourceGroupName, String resourceName) { + return listWithServiceResponseAsync(resourceGroupName, resourceName).map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List private endpoint connections. + * List private endpoint connection properties. + * + * @param resourceGroupName The name of the resource group that contains the IoT hub. + * @param resourceName The name of the IoT hub. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<PrivateEndpointConnectionInner> object + */ + public Observable>> listWithServiceResponseAsync(String resourceGroupName, String resourceName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (resourceName == null) { + throw new IllegalArgumentException("Parameter resourceName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.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> clientResponse = listDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws ErrorDetailsInnerException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorDetailsInnerException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorDetailsInnerException.class) + .build(response); + } + + /** + * Get private endpoint connection. + * Get private endpoint connection properties. + * + * @param resourceGroupName The name of the resource group that contains the IoT hub. + * @param resourceName The name of the IoT hub. + * @param privateEndpointConnectionName The name of the private endpoint connection + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorDetailsInnerException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PrivateEndpointConnectionInner object if successful. + */ + public PrivateEndpointConnectionInner get(String resourceGroupName, String resourceName, String privateEndpointConnectionName) { + return getWithServiceResponseAsync(resourceGroupName, resourceName, privateEndpointConnectionName).toBlocking().single().body(); + } + + /** + * Get private endpoint connection. + * Get private endpoint connection properties. + * + * @param resourceGroupName The name of the resource group that contains the IoT hub. + * @param resourceName The name of the IoT hub. + * @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 getAsync(String resourceGroupName, String resourceName, String privateEndpointConnectionName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, resourceName, privateEndpointConnectionName), serviceCallback); + } + + /** + * Get private endpoint connection. + * Get private endpoint connection properties. + * + * @param resourceGroupName The name of the resource group that contains the IoT hub. + * @param resourceName The name of the IoT hub. + * @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 getAsync(String resourceGroupName, String resourceName, String privateEndpointConnectionName) { + return getWithServiceResponseAsync(resourceGroupName, resourceName, privateEndpointConnectionName).map(new Func1, PrivateEndpointConnectionInner>() { + @Override + public PrivateEndpointConnectionInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get private endpoint connection. + * Get private endpoint connection properties. + * + * @param resourceGroupName The name of the resource group that contains the IoT hub. + * @param resourceName The name of the IoT hub. + * @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> getWithServiceResponseAsync(String resourceGroupName, String resourceName, String privateEndpointConnectionName) { + 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 (privateEndpointConnectionName == null) { + throw new IllegalArgumentException("Parameter privateEndpointConnectionName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.get(this.client.subscriptionId(), resourceGroupName, resourceName, privateEndpointConnectionName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws ErrorDetailsInnerException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorDetailsInnerException.class) + .build(response); + } + + /** + * Update private endpoint connection. + * Update the status of a private endpoint connection with the specified name. + * + * @param resourceGroupName The name of the resource group that contains the IoT hub. + * @param resourceName The name of the IoT hub. + * @param privateEndpointConnectionName The name of the private endpoint connection + * @param properties the PrivateEndpointConnectionProperties value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorDetailsInnerException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PrivateEndpointConnectionInner object if successful. + */ + public PrivateEndpointConnectionInner update(String resourceGroupName, String resourceName, String privateEndpointConnectionName, PrivateEndpointConnectionProperties properties) { + return updateWithServiceResponseAsync(resourceGroupName, resourceName, privateEndpointConnectionName, properties).toBlocking().last().body(); + } + + /** + * Update private endpoint connection. + * Update the status of a private endpoint connection with the specified name. + * + * @param resourceGroupName The name of the resource group that contains the IoT hub. + * @param resourceName The name of the IoT hub. + * @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 updateAsync(String resourceGroupName, String resourceName, String privateEndpointConnectionName, PrivateEndpointConnectionProperties properties, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, resourceName, privateEndpointConnectionName, properties), serviceCallback); + } + + /** + * Update private endpoint connection. + * Update the status of a private endpoint connection with the specified name. + * + * @param resourceGroupName The name of the resource group that contains the IoT hub. + * @param resourceName The name of the IoT hub. + * @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 updateAsync(String resourceGroupName, String resourceName, String privateEndpointConnectionName, PrivateEndpointConnectionProperties properties) { + return updateWithServiceResponseAsync(resourceGroupName, resourceName, privateEndpointConnectionName, properties).map(new Func1, PrivateEndpointConnectionInner>() { + @Override + public PrivateEndpointConnectionInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Update private endpoint connection. + * Update the status of a private endpoint connection with the specified name. + * + * @param resourceGroupName The name of the resource group that contains the IoT hub. + * @param resourceName The name of the IoT hub. + * @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> updateWithServiceResponseAsync(String resourceGroupName, String resourceName, String privateEndpointConnectionName, PrivateEndpointConnectionProperties 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 (privateEndpointConnectionName == null) { + throw new IllegalArgumentException("Parameter privateEndpointConnectionName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (properties == null) { + throw new IllegalArgumentException("Parameter properties is required and cannot be null."); + } + Validator.validate(properties); + PrivateEndpointConnectionInner privateEndpointConnection = new PrivateEndpointConnectionInner(); + privateEndpointConnection.withProperties(properties); + Observable> observable = service.update(this.client.subscriptionId(), resourceGroupName, resourceName, privateEndpointConnectionName, this.client.apiVersion(), this.client.acceptLanguage(), privateEndpointConnection, this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Update private endpoint connection. + * Update the status of a private endpoint connection with the specified name. + * + * @param resourceGroupName The name of the resource group that contains the IoT hub. + * @param resourceName The name of the IoT hub. + * @param privateEndpointConnectionName The name of the private endpoint connection + * @param properties the PrivateEndpointConnectionProperties value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorDetailsInnerException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PrivateEndpointConnectionInner object if successful. + */ + public PrivateEndpointConnectionInner beginUpdate(String resourceGroupName, String resourceName, String privateEndpointConnectionName, PrivateEndpointConnectionProperties properties) { + return beginUpdateWithServiceResponseAsync(resourceGroupName, resourceName, privateEndpointConnectionName, properties).toBlocking().single().body(); + } + + /** + * Update private endpoint connection. + * Update the status of a private endpoint connection with the specified name. + * + * @param resourceGroupName The name of the resource group that contains the IoT hub. + * @param resourceName The name of the IoT hub. + * @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 beginUpdateAsync(String resourceGroupName, String resourceName, String privateEndpointConnectionName, PrivateEndpointConnectionProperties properties, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateWithServiceResponseAsync(resourceGroupName, resourceName, privateEndpointConnectionName, properties), serviceCallback); + } + + /** + * Update private endpoint connection. + * Update the status of a private endpoint connection with the specified name. + * + * @param resourceGroupName The name of the resource group that contains the IoT hub. + * @param resourceName The name of the IoT hub. + * @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 beginUpdateAsync(String resourceGroupName, String resourceName, String privateEndpointConnectionName, PrivateEndpointConnectionProperties properties) { + return beginUpdateWithServiceResponseAsync(resourceGroupName, resourceName, privateEndpointConnectionName, properties).map(new Func1, PrivateEndpointConnectionInner>() { + @Override + public PrivateEndpointConnectionInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Update private endpoint connection. + * Update the status of a private endpoint connection with the specified name. + * + * @param resourceGroupName The name of the resource group that contains the IoT hub. + * @param resourceName The name of the IoT hub. + * @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> beginUpdateWithServiceResponseAsync(String resourceGroupName, String resourceName, String privateEndpointConnectionName, PrivateEndpointConnectionProperties 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 (privateEndpointConnectionName == null) { + throw new IllegalArgumentException("Parameter privateEndpointConnectionName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (properties == null) { + throw new IllegalArgumentException("Parameter properties is required and cannot be null."); + } + Validator.validate(properties); + PrivateEndpointConnectionInner privateEndpointConnection = new PrivateEndpointConnectionInner(); + privateEndpointConnection.withProperties(properties); + return service.beginUpdate(this.client.subscriptionId(), resourceGroupName, resourceName, privateEndpointConnectionName, this.client.apiVersion(), this.client.acceptLanguage(), privateEndpointConnection, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginUpdateDelegate(Response response) throws ErrorDetailsInnerException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(ErrorDetailsInnerException.class) + .build(response); + } + + /** + * Delete private endpoint connection. + * Delete private endpoint connection with the specified name. + * + * @param resourceGroupName The name of the resource group that contains the IoT hub. + * @param resourceName The name of the IoT hub. + * @param privateEndpointConnectionName The name of the private endpoint connection + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorDetailsInnerException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PrivateEndpointConnectionInner object if successful. + */ + public PrivateEndpointConnectionInner delete(String resourceGroupName, String resourceName, String privateEndpointConnectionName) { + return deleteWithServiceResponseAsync(resourceGroupName, resourceName, privateEndpointConnectionName).toBlocking().last().body(); + } + + /** + * Delete private endpoint connection. + * Delete private endpoint connection with the specified name. + * + * @param resourceGroupName The name of the resource group that contains the IoT hub. + * @param resourceName The name of the IoT hub. + * @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 deleteAsync(String resourceGroupName, String resourceName, String privateEndpointConnectionName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, resourceName, privateEndpointConnectionName), serviceCallback); + } + + /** + * Delete private endpoint connection. + * Delete private endpoint connection with the specified name. + * + * @param resourceGroupName The name of the resource group that contains the IoT hub. + * @param resourceName The name of the IoT hub. + * @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 deleteAsync(String resourceGroupName, String resourceName, String privateEndpointConnectionName) { + return deleteWithServiceResponseAsync(resourceGroupName, resourceName, privateEndpointConnectionName).map(new Func1, PrivateEndpointConnectionInner>() { + @Override + public PrivateEndpointConnectionInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Delete private endpoint connection. + * Delete private endpoint connection with the specified name. + * + * @param resourceGroupName The name of the resource group that contains the IoT hub. + * @param resourceName The name of the IoT hub. + * @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> deleteWithServiceResponseAsync(String resourceGroupName, String resourceName, String privateEndpointConnectionName) { + 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 (privateEndpointConnectionName == null) { + throw new IllegalArgumentException("Parameter privateEndpointConnectionName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Observable> observable = service.delete(this.client.subscriptionId(), resourceGroupName, resourceName, privateEndpointConnectionName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Delete private endpoint connection. + * Delete private endpoint connection with the specified name. + * + * @param resourceGroupName The name of the resource group that contains the IoT hub. + * @param resourceName The name of the IoT hub. + * @param privateEndpointConnectionName The name of the private endpoint connection + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorDetailsInnerException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PrivateEndpointConnectionInner object if successful. + */ + public PrivateEndpointConnectionInner beginDelete(String resourceGroupName, String resourceName, String privateEndpointConnectionName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, resourceName, privateEndpointConnectionName).toBlocking().single().body(); + } + + /** + * Delete private endpoint connection. + * Delete private endpoint connection with the specified name. + * + * @param resourceGroupName The name of the resource group that contains the IoT hub. + * @param resourceName The name of the IoT hub. + * @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 beginDeleteAsync(String resourceGroupName, String resourceName, String privateEndpointConnectionName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, resourceName, privateEndpointConnectionName), serviceCallback); + } + + /** + * Delete private endpoint connection. + * Delete private endpoint connection with the specified name. + * + * @param resourceGroupName The name of the resource group that contains the IoT hub. + * @param resourceName The name of the IoT hub. + * @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 beginDeleteAsync(String resourceGroupName, String resourceName, String privateEndpointConnectionName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, resourceName, privateEndpointConnectionName).map(new Func1, PrivateEndpointConnectionInner>() { + @Override + public PrivateEndpointConnectionInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Delete private endpoint connection. + * Delete private endpoint connection with the specified name. + * + * @param resourceGroupName The name of the resource group that contains the IoT hub. + * @param resourceName The name of the IoT hub. + * @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> beginDeleteWithServiceResponseAsync(String resourceGroupName, String resourceName, String privateEndpointConnectionName) { + 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 (privateEndpointConnectionName == null) { + throw new IllegalArgumentException("Parameter privateEndpointConnectionName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.beginDelete(this.client.subscriptionId(), resourceGroupName, resourceName, privateEndpointConnectionName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteDelegate(Response response) throws ErrorDetailsInnerException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(ErrorDetailsInnerException.class) + .build(response); + } + +} diff --git a/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/implementation/PrivateLinkResourceImpl.java b/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/implementation/PrivateLinkResourceImpl.java new file mode 100644 index 0000000000000..11e3856e60843 --- /dev/null +++ b/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/implementation/PrivateLinkResourceImpl.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.iothub.v2020_03_01.implementation; + +import com.microsoft.azure.management.iothub.v2020_03_01.PrivateLinkResource; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import java.util.List; + +class PrivateLinkResourceImpl extends WrapperImpl implements PrivateLinkResource { + private final DevicesManager manager; + PrivateLinkResourceImpl(PrivateLinkResourceInner inner, DevicesManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public DevicesManager manager() { + return this.manager; + } + + @Override + public List value() { + return this.inner().value(); + } + +} diff --git a/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/implementation/PrivateLinkResourceInner.java b/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/implementation/PrivateLinkResourceInner.java new file mode 100644 index 0000000000000..99ee743470958 --- /dev/null +++ b/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/implementation/PrivateLinkResourceInner.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.iothub.v2020_03_01.implementation; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The available private link resources for an IotHub. + */ +public class PrivateLinkResourceInner { + /** + * The list of available private link resources for an IotHub. + */ + @JsonProperty(value = "value") + private List value; + + /** + * Get the list of available private link resources for an IotHub. + * + * @return the value value + */ + public List value() { + return this.value; + } + + /** + * Set the list of available private link resources for an IotHub. + * + * @param value the value value to set + * @return the PrivateLinkResourceInner object itself. + */ + public PrivateLinkResourceInner withValue(List value) { + this.value = value; + return this; + } + +} diff --git a/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/implementation/PrivateLinkResourcesImpl.java b/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/implementation/PrivateLinkResourcesImpl.java new file mode 100644 index 0000000000000..45b90c795ecb6 --- /dev/null +++ b/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/implementation/PrivateLinkResourcesImpl.java @@ -0,0 +1,63 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * + */ + +package com.microsoft.azure.management.iothub.v2020_03_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.iothub.v2020_03_01.PrivateLinkResources; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.management.iothub.v2020_03_01.PrivateLinkResource; +import com.microsoft.azure.management.iothub.v2020_03_01.GroupIdInformation; + +class PrivateLinkResourcesImpl extends WrapperImpl implements PrivateLinkResources { + private final DevicesManager manager; + + PrivateLinkResourcesImpl(DevicesManager manager) { + super(manager.inner().privateLinkResources()); + this.manager = manager; + } + + public DevicesManager manager() { + return this.manager; + } + + private GroupIdInformationImpl wrapModel(GroupIdInformationInner inner) { + return new GroupIdInformationImpl(inner, manager()); + } + + @Override + public Observable listAsync(String resourceGroupName, String resourceName) { + PrivateLinkResourcesInner client = this.inner(); + return client.listAsync(resourceGroupName, resourceName) + .map(new Func1() { + @Override + public PrivateLinkResource call(PrivateLinkResourceInner inner) { + return new PrivateLinkResourceImpl(inner, manager()); + } + }); + } + + @Override + public Observable getAsync(String resourceGroupName, String resourceName, String groupId) { + PrivateLinkResourcesInner client = this.inner(); + return client.getAsync(resourceGroupName, resourceName, groupId) + .flatMap(new Func1>() { + @Override + public Observable call(GroupIdInformationInner inner) { + if (inner == null) { + return Observable.empty(); + } else { + return Observable.just((GroupIdInformation)wrapModel(inner)); + } + } + }); + } + +} diff --git a/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/implementation/PrivateLinkResourcesInner.java b/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/implementation/PrivateLinkResourcesInner.java new file mode 100644 index 0000000000000..60976923acd26 --- /dev/null +++ b/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/implementation/PrivateLinkResourcesInner.java @@ -0,0 +1,251 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.iothub.v2020_03_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.management.iothub.v2020_03_01.ErrorDetailsInnerException; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Path; +import retrofit2.http.Query; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in PrivateLinkResources. + */ +public class PrivateLinkResourcesInner { + /** The Retrofit service to perform REST calls. */ + private PrivateLinkResourcesService service; + /** The service client containing this operation class. */ + private IotHubClientImpl client; + + /** + * Initializes an instance of PrivateLinkResourcesInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public PrivateLinkResourcesInner(Retrofit retrofit, IotHubClientImpl client) { + this.service = retrofit.create(PrivateLinkResourcesService.class); + this.client = client; + } + + /** + * The interface defining all the services for PrivateLinkResources to be + * used by Retrofit to perform actually REST calls. + */ + interface PrivateLinkResourcesService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.iothub.v2020_03_01.PrivateLinkResources list" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/iotHubs/{resourceName}/privateLinkResources") + 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.iothub.v2020_03_01.PrivateLinkResources get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/iotHubs/{resourceName}/privateLinkResources/{groupId}") + Observable> get(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("resourceName") String resourceName, @Path("groupId") String groupId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * List private link resources. + * List private link resources for the given IotHub. + * + * @param resourceGroupName The name of the resource group that contains the IoT hub. + * @param resourceName The name of the IoT hub. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorDetailsInnerException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PrivateLinkResourceInner object if successful. + */ + public PrivateLinkResourceInner list(String resourceGroupName, String resourceName) { + return listWithServiceResponseAsync(resourceGroupName, resourceName).toBlocking().single().body(); + } + + /** + * List private link resources. + * List private link resources for the given IotHub. + * + * @param resourceGroupName The name of the resource group that contains the IoT hub. + * @param resourceName The name of the IoT hub. + * @param serviceCallback 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(String resourceGroupName, String resourceName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(listWithServiceResponseAsync(resourceGroupName, resourceName), serviceCallback); + } + + /** + * List private link resources. + * List private link resources for the given IotHub. + * + * @param resourceGroupName The name of the resource group that contains the IoT hub. + * @param resourceName The name of the IoT hub. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PrivateLinkResourceInner object + */ + public Observable listAsync(String resourceGroupName, String resourceName) { + return listWithServiceResponseAsync(resourceGroupName, resourceName).map(new Func1, PrivateLinkResourceInner>() { + @Override + public PrivateLinkResourceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * List private link resources. + * List private link resources for the given IotHub. + * + * @param resourceGroupName The name of the resource group that contains the IoT hub. + * @param resourceName The name of the IoT hub. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PrivateLinkResourceInner object + */ + public Observable> listWithServiceResponseAsync(String resourceGroupName, String resourceName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (resourceName == null) { + throw new IllegalArgumentException("Parameter resourceName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.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 clientResponse = listDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse listDelegate(Response response) throws ErrorDetailsInnerException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorDetailsInnerException.class) + .build(response); + } + + /** + * Get the specified private link resource. + * Get the specified private link resource for the given IotHub. + * + * @param resourceGroupName The name of the resource group that contains the IoT hub. + * @param resourceName The name of the IoT hub. + * @param groupId The name of the private link resource + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorDetailsInnerException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the GroupIdInformationInner object if successful. + */ + public GroupIdInformationInner get(String resourceGroupName, String resourceName, String groupId) { + return getWithServiceResponseAsync(resourceGroupName, resourceName, groupId).toBlocking().single().body(); + } + + /** + * Get the specified private link resource. + * Get the specified private link resource for the given IotHub. + * + * @param resourceGroupName The name of the resource group that contains the IoT hub. + * @param resourceName The name of the IoT hub. + * @param groupId 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 getAsync(String resourceGroupName, String resourceName, String groupId, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, resourceName, groupId), serviceCallback); + } + + /** + * Get the specified private link resource. + * Get the specified private link resource for the given IotHub. + * + * @param resourceGroupName The name of the resource group that contains the IoT hub. + * @param resourceName The name of the IoT hub. + * @param groupId The name of the private link resource + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the GroupIdInformationInner object + */ + public Observable getAsync(String resourceGroupName, String resourceName, String groupId) { + return getWithServiceResponseAsync(resourceGroupName, resourceName, groupId).map(new Func1, GroupIdInformationInner>() { + @Override + public GroupIdInformationInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get the specified private link resource. + * Get the specified private link resource for the given IotHub. + * + * @param resourceGroupName The name of the resource group that contains the IoT hub. + * @param resourceName The name of the IoT hub. + * @param groupId The name of the private link resource + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the GroupIdInformationInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String resourceName, String groupId) { + 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 (groupId == null) { + throw new IllegalArgumentException("Parameter groupId is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.get(this.client.subscriptionId(), resourceGroupName, resourceName, groupId, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws ErrorDetailsInnerException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorDetailsInnerException.class) + .build(response); + } + +} diff --git a/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/implementation/RegistryStatisticsImpl.java b/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/implementation/RegistryStatisticsImpl.java new file mode 100644 index 0000000000000..fd015a0b252a9 --- /dev/null +++ b/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/implementation/RegistryStatisticsImpl.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.iothub.v2020_03_01.implementation; + +import com.microsoft.azure.management.iothub.v2020_03_01.RegistryStatistics; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; + +class RegistryStatisticsImpl extends WrapperImpl implements RegistryStatistics { + private final DevicesManager manager; + RegistryStatisticsImpl(RegistryStatisticsInner inner, DevicesManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public DevicesManager manager() { + return this.manager; + } + + @Override + public Long disabledDeviceCount() { + return this.inner().disabledDeviceCount(); + } + + @Override + public Long enabledDeviceCount() { + return this.inner().enabledDeviceCount(); + } + + @Override + public Long totalDeviceCount() { + return this.inner().totalDeviceCount(); + } + +} diff --git a/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/implementation/RegistryStatisticsInner.java b/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/implementation/RegistryStatisticsInner.java new file mode 100644 index 0000000000000..bdf2d71683578 --- /dev/null +++ b/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/implementation/RegistryStatisticsInner.java @@ -0,0 +1,62 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.iothub.v2020_03_01.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Identity registry statistics. + */ +public class RegistryStatisticsInner { + /** + * The total count of devices in the identity registry. + */ + @JsonProperty(value = "totalDeviceCount", access = JsonProperty.Access.WRITE_ONLY) + private Long totalDeviceCount; + + /** + * The count of enabled devices in the identity registry. + */ + @JsonProperty(value = "enabledDeviceCount", access = JsonProperty.Access.WRITE_ONLY) + private Long enabledDeviceCount; + + /** + * The count of disabled devices in the identity registry. + */ + @JsonProperty(value = "disabledDeviceCount", access = JsonProperty.Access.WRITE_ONLY) + private Long disabledDeviceCount; + + /** + * Get the total count of devices in the identity registry. + * + * @return the totalDeviceCount value + */ + public Long totalDeviceCount() { + return this.totalDeviceCount; + } + + /** + * Get the count of enabled devices in the identity registry. + * + * @return the enabledDeviceCount value + */ + public Long enabledDeviceCount() { + return this.enabledDeviceCount; + } + + /** + * Get the count of disabled devices in the identity registry. + * + * @return the disabledDeviceCount value + */ + public Long disabledDeviceCount() { + return this.disabledDeviceCount; + } + +} diff --git a/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/implementation/ResourceProviderCommonsImpl.java b/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/implementation/ResourceProviderCommonsImpl.java new file mode 100644 index 0000000000000..f69703f4d6606 --- /dev/null +++ b/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/implementation/ResourceProviderCommonsImpl.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.iothub.v2020_03_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.iothub.v2020_03_01.ResourceProviderCommons; +import rx.functions.Func1; +import rx.Observable; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.iothub.v2020_03_01.UserSubscriptionQuota; + +class ResourceProviderCommonsImpl extends WrapperImpl implements ResourceProviderCommons { + private final DevicesManager manager; + + ResourceProviderCommonsImpl(DevicesManager manager) { + super(manager.inner().resourceProviderCommons()); + this.manager = manager; + } + + public DevicesManager manager() { + return this.manager; + } + + @Override + public Observable listAsync() { + ResourceProviderCommonsInner client = this.inner(); + return client.listAsync() + .flatMap(new Func1, Observable>() { + @Override + public Observable call(Page innerPage) { + return Observable.from(innerPage.items()); + } + }) + .map(new Func1() { + @Override + public UserSubscriptionQuota call(UserSubscriptionQuotaInner inner) { + return new UserSubscriptionQuotaImpl(inner, manager()); + } + }); + } + +} diff --git a/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/implementation/ResourceProviderCommonsInner.java b/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/implementation/ResourceProviderCommonsInner.java new file mode 100644 index 0000000000000..e2a38cd4bd701 --- /dev/null +++ b/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/implementation/ResourceProviderCommonsInner.java @@ -0,0 +1,148 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.iothub.v2020_03_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.management.iothub.v2020_03_01.ErrorDetailsInnerException; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Path; +import retrofit2.http.Query; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in ResourceProviderCommons. + */ +public class ResourceProviderCommonsInner { + /** The Retrofit service to perform REST calls. */ + private ResourceProviderCommonsService service; + /** The service client containing this operation class. */ + private IotHubClientImpl client; + + /** + * Initializes an instance of ResourceProviderCommonsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public ResourceProviderCommonsInner(Retrofit retrofit, IotHubClientImpl client) { + this.service = retrofit.create(ResourceProviderCommonsService.class); + this.client = client; + } + + /** + * The interface defining all the services for ResourceProviderCommons to be + * used by Retrofit to perform actually REST calls. + */ + interface ResourceProviderCommonsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.iothub.v2020_03_01.ResourceProviderCommons list" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.Devices/usages") + Observable> list(@Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Get the number of iot hubs in the subscription. + * Get the number of free and paid iot hubs in the subscription. + * + * @return the PagedList object if successful. + */ + public PagedList list() { + PageImpl1 page = new PageImpl1<>(); + page.setItems(listWithServiceResponseAsync().toBlocking().single().body()); + page.setNextPageLink(null); + return new PagedList(page) { + @Override + public Page nextPage(String nextPageLink) { + return null; + } + }; + } + + /** + * Get the number of iot hubs in the subscription. + * Get the number of free and paid iot hubs in the subscription. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(listWithServiceResponseAsync(), serviceCallback); + } + + /** + * Get the number of iot hubs in the subscription. + * Get the number of free and paid iot hubs in the subscription. + * + * @return the observable to the List<UserSubscriptionQuotaInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync().map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + PageImpl1 page = new PageImpl1<>(); + page.setItems(response.body()); + return page; + } + }); + } + + /** + * Get the number of iot hubs in the subscription. + * Get the number of free and paid iot hubs in the subscription. + * + * @return the observable to the List<UserSubscriptionQuotaInner> object + */ + public Observable>> listWithServiceResponseAsync() { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.list(this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + List items = null; + if (result.body() != null) { + items = result.body().items(); + } + ServiceResponse> clientResponse = new ServiceResponse>(items, result.response()); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws ErrorDetailsInnerException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorDetailsInnerException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorDetailsInnerException.class) + .build(response); + } + +} diff --git a/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/implementation/SharedAccessSignatureAuthorizationRuleImpl.java b/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/implementation/SharedAccessSignatureAuthorizationRuleImpl.java new file mode 100644 index 0000000000000..07c4c2e66eff1 --- /dev/null +++ b/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/implementation/SharedAccessSignatureAuthorizationRuleImpl.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.iothub.v2020_03_01.implementation; + +import com.microsoft.azure.management.iothub.v2020_03_01.SharedAccessSignatureAuthorizationRule; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.iothub.v2020_03_01.AccessRights; + +class SharedAccessSignatureAuthorizationRuleImpl extends WrapperImpl implements SharedAccessSignatureAuthorizationRule { + private final DevicesManager manager; + SharedAccessSignatureAuthorizationRuleImpl(SharedAccessSignatureAuthorizationRuleInner inner, DevicesManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public DevicesManager manager() { + return this.manager; + } + + @Override + public String keyName() { + return this.inner().keyName(); + } + + @Override + public String primaryKey() { + return this.inner().primaryKey(); + } + + @Override + public AccessRights rights() { + return this.inner().rights(); + } + + @Override + public String secondaryKey() { + return this.inner().secondaryKey(); + } + +} diff --git a/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/implementation/SharedAccessSignatureAuthorizationRuleInner.java b/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/implementation/SharedAccessSignatureAuthorizationRuleInner.java new file mode 100644 index 0000000000000..48b756a6be8cc --- /dev/null +++ b/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/implementation/SharedAccessSignatureAuthorizationRuleInner.java @@ -0,0 +1,131 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.iothub.v2020_03_01.implementation; + +import com.microsoft.azure.management.iothub.v2020_03_01.AccessRights; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The properties of an IoT hub shared access policy. + */ +public class SharedAccessSignatureAuthorizationRuleInner { + /** + * The name of the shared access policy. + */ + @JsonProperty(value = "keyName", required = true) + private String keyName; + + /** + * The primary key. + */ + @JsonProperty(value = "primaryKey") + private String primaryKey; + + /** + * The secondary key. + */ + @JsonProperty(value = "secondaryKey") + private String secondaryKey; + + /** + * The permissions assigned to the shared access policy. Possible values + * include: 'RegistryRead', 'RegistryWrite', 'ServiceConnect', + * 'DeviceConnect', 'RegistryRead, RegistryWrite', 'RegistryRead, + * ServiceConnect', 'RegistryRead, DeviceConnect', 'RegistryWrite, + * ServiceConnect', 'RegistryWrite, DeviceConnect', 'ServiceConnect, + * DeviceConnect', 'RegistryRead, RegistryWrite, ServiceConnect', + * 'RegistryRead, RegistryWrite, DeviceConnect', 'RegistryRead, + * ServiceConnect, DeviceConnect', 'RegistryWrite, ServiceConnect, + * DeviceConnect', 'RegistryRead, RegistryWrite, ServiceConnect, + * DeviceConnect'. + */ + @JsonProperty(value = "rights", required = true) + private AccessRights rights; + + /** + * Get the name of the shared access policy. + * + * @return the keyName value + */ + public String keyName() { + return this.keyName; + } + + /** + * Set the name of the shared access policy. + * + * @param keyName the keyName value to set + * @return the SharedAccessSignatureAuthorizationRuleInner object itself. + */ + public SharedAccessSignatureAuthorizationRuleInner withKeyName(String keyName) { + this.keyName = keyName; + return this; + } + + /** + * Get the primary key. + * + * @return the primaryKey value + */ + public String primaryKey() { + return this.primaryKey; + } + + /** + * Set the primary key. + * + * @param primaryKey the primaryKey value to set + * @return the SharedAccessSignatureAuthorizationRuleInner object itself. + */ + public SharedAccessSignatureAuthorizationRuleInner withPrimaryKey(String primaryKey) { + this.primaryKey = primaryKey; + return this; + } + + /** + * Get the secondary key. + * + * @return the secondaryKey value + */ + public String secondaryKey() { + return this.secondaryKey; + } + + /** + * Set the secondary key. + * + * @param secondaryKey the secondaryKey value to set + * @return the SharedAccessSignatureAuthorizationRuleInner object itself. + */ + public SharedAccessSignatureAuthorizationRuleInner withSecondaryKey(String secondaryKey) { + this.secondaryKey = secondaryKey; + return this; + } + + /** + * Get the permissions assigned to the shared access policy. Possible values include: 'RegistryRead', 'RegistryWrite', 'ServiceConnect', 'DeviceConnect', 'RegistryRead, RegistryWrite', 'RegistryRead, ServiceConnect', 'RegistryRead, DeviceConnect', 'RegistryWrite, ServiceConnect', 'RegistryWrite, DeviceConnect', 'ServiceConnect, DeviceConnect', 'RegistryRead, RegistryWrite, ServiceConnect', 'RegistryRead, RegistryWrite, DeviceConnect', 'RegistryRead, ServiceConnect, DeviceConnect', 'RegistryWrite, ServiceConnect, DeviceConnect', 'RegistryRead, RegistryWrite, ServiceConnect, DeviceConnect'. + * + * @return the rights value + */ + public AccessRights rights() { + return this.rights; + } + + /** + * Set the permissions assigned to the shared access policy. Possible values include: 'RegistryRead', 'RegistryWrite', 'ServiceConnect', 'DeviceConnect', 'RegistryRead, RegistryWrite', 'RegistryRead, ServiceConnect', 'RegistryRead, DeviceConnect', 'RegistryWrite, ServiceConnect', 'RegistryWrite, DeviceConnect', 'ServiceConnect, DeviceConnect', 'RegistryRead, RegistryWrite, ServiceConnect', 'RegistryRead, RegistryWrite, DeviceConnect', 'RegistryRead, ServiceConnect, DeviceConnect', 'RegistryWrite, ServiceConnect, DeviceConnect', 'RegistryRead, RegistryWrite, ServiceConnect, DeviceConnect'. + * + * @param rights the rights value to set + * @return the SharedAccessSignatureAuthorizationRuleInner object itself. + */ + public SharedAccessSignatureAuthorizationRuleInner withRights(AccessRights rights) { + this.rights = rights; + return this; + } + +} diff --git a/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/implementation/TestAllRoutesResultImpl.java b/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/implementation/TestAllRoutesResultImpl.java new file mode 100644 index 0000000000000..f35cf0ba06b8a --- /dev/null +++ b/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/implementation/TestAllRoutesResultImpl.java @@ -0,0 +1,33 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.iothub.v2020_03_01.implementation; + +import com.microsoft.azure.management.iothub.v2020_03_01.TestAllRoutesResult; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import java.util.List; +import com.microsoft.azure.management.iothub.v2020_03_01.MatchedRoute; + +class TestAllRoutesResultImpl extends WrapperImpl implements TestAllRoutesResult { + private final DevicesManager manager; + TestAllRoutesResultImpl(TestAllRoutesResultInner inner, DevicesManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public DevicesManager manager() { + return this.manager; + } + + @Override + public List routes() { + return this.inner().routes(); + } + +} diff --git a/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/implementation/TestAllRoutesResultInner.java b/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/implementation/TestAllRoutesResultInner.java new file mode 100644 index 0000000000000..fd3faa8b2762e --- /dev/null +++ b/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/implementation/TestAllRoutesResultInner.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.iothub.v2020_03_01.implementation; + +import java.util.List; +import com.microsoft.azure.management.iothub.v2020_03_01.MatchedRoute; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Result of testing all routes. + */ +public class TestAllRoutesResultInner { + /** + * JSON-serialized array of matched routes. + */ + @JsonProperty(value = "routes") + private List routes; + + /** + * Get jSON-serialized array of matched routes. + * + * @return the routes value + */ + public List routes() { + return this.routes; + } + + /** + * Set jSON-serialized array of matched routes. + * + * @param routes the routes value to set + * @return the TestAllRoutesResultInner object itself. + */ + public TestAllRoutesResultInner withRoutes(List routes) { + this.routes = routes; + return this; + } + +} diff --git a/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/implementation/TestRouteResultImpl.java b/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/implementation/TestRouteResultImpl.java new file mode 100644 index 0000000000000..7aa7bf04b8c07 --- /dev/null +++ b/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/implementation/TestRouteResultImpl.java @@ -0,0 +1,38 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.iothub.v2020_03_01.implementation; + +import com.microsoft.azure.management.iothub.v2020_03_01.TestRouteResult; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.iothub.v2020_03_01.TestRouteResultDetails; +import com.microsoft.azure.management.iothub.v2020_03_01.TestResultStatus; + +class TestRouteResultImpl extends WrapperImpl implements TestRouteResult { + private final DevicesManager manager; + TestRouteResultImpl(TestRouteResultInner inner, DevicesManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public DevicesManager manager() { + return this.manager; + } + + @Override + public TestRouteResultDetails details() { + return this.inner().details(); + } + + @Override + public TestResultStatus result() { + return this.inner().result(); + } + +} diff --git a/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/implementation/TestRouteResultInner.java b/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/implementation/TestRouteResultInner.java new file mode 100644 index 0000000000000..69cc8a2e7e067 --- /dev/null +++ b/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/implementation/TestRouteResultInner.java @@ -0,0 +1,72 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.iothub.v2020_03_01.implementation; + +import com.microsoft.azure.management.iothub.v2020_03_01.TestResultStatus; +import com.microsoft.azure.management.iothub.v2020_03_01.TestRouteResultDetails; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Result of testing one route. + */ +public class TestRouteResultInner { + /** + * Result of testing route. Possible values include: 'undefined', 'false', + * 'true'. + */ + @JsonProperty(value = "result") + private TestResultStatus result; + + /** + * Detailed result of testing route. + */ + @JsonProperty(value = "details") + private TestRouteResultDetails details; + + /** + * Get result of testing route. Possible values include: 'undefined', 'false', 'true'. + * + * @return the result value + */ + public TestResultStatus result() { + return this.result; + } + + /** + * Set result of testing route. Possible values include: 'undefined', 'false', 'true'. + * + * @param result the result value to set + * @return the TestRouteResultInner object itself. + */ + public TestRouteResultInner withResult(TestResultStatus result) { + this.result = result; + return this; + } + + /** + * Get detailed result of testing route. + * + * @return the details value + */ + public TestRouteResultDetails details() { + return this.details; + } + + /** + * Set detailed result of testing route. + * + * @param details the details value to set + * @return the TestRouteResultInner object itself. + */ + public TestRouteResultInner withDetails(TestRouteResultDetails details) { + this.details = details; + return this; + } + +} diff --git a/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/implementation/UserSubscriptionQuotaImpl.java b/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/implementation/UserSubscriptionQuotaImpl.java new file mode 100644 index 0000000000000..1ca11e0174072 --- /dev/null +++ b/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/implementation/UserSubscriptionQuotaImpl.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.iothub.v2020_03_01.implementation; + +import com.microsoft.azure.management.iothub.v2020_03_01.UserSubscriptionQuota; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.iothub.v2020_03_01.Name; + +class UserSubscriptionQuotaImpl extends WrapperImpl implements UserSubscriptionQuota { + private final DevicesManager manager; + UserSubscriptionQuotaImpl(UserSubscriptionQuotaInner inner, DevicesManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public DevicesManager manager() { + return this.manager; + } + + @Override + public Integer currentValue() { + return this.inner().currentValue(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public Integer limit() { + return this.inner().limit(); + } + + @Override + public Name name() { + return this.inner().name(); + } + + @Override + public String type() { + return this.inner().type(); + } + + @Override + public String unit() { + return this.inner().unit(); + } + +} diff --git a/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/implementation/UserSubscriptionQuotaInner.java b/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/implementation/UserSubscriptionQuotaInner.java new file mode 100644 index 0000000000000..bae756f91ca63 --- /dev/null +++ b/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/implementation/UserSubscriptionQuotaInner.java @@ -0,0 +1,174 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.iothub.v2020_03_01.implementation; + +import com.microsoft.azure.management.iothub.v2020_03_01.Name; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * User subscription quota response. + */ +public class UserSubscriptionQuotaInner { + /** + * IotHub type id. + */ + @JsonProperty(value = "id") + private String id; + + /** + * Response type. + */ + @JsonProperty(value = "type") + private String type; + + /** + * Unit of IotHub type. + */ + @JsonProperty(value = "unit") + private String unit; + + /** + * Current number of IotHub type. + */ + @JsonProperty(value = "currentValue") + private Integer currentValue; + + /** + * Numerical limit on IotHub type. + */ + @JsonProperty(value = "limit") + private Integer limit; + + /** + * IotHub type. + */ + @JsonProperty(value = "name") + private Name name; + + /** + * Get iotHub type id. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set iotHub type id. + * + * @param id the id value to set + * @return the UserSubscriptionQuotaInner object itself. + */ + public UserSubscriptionQuotaInner withId(String id) { + this.id = id; + return this; + } + + /** + * Get response type. + * + * @return the type value + */ + public String type() { + return this.type; + } + + /** + * Set response type. + * + * @param type the type value to set + * @return the UserSubscriptionQuotaInner object itself. + */ + public UserSubscriptionQuotaInner withType(String type) { + this.type = type; + return this; + } + + /** + * Get unit of IotHub type. + * + * @return the unit value + */ + public String unit() { + return this.unit; + } + + /** + * Set unit of IotHub type. + * + * @param unit the unit value to set + * @return the UserSubscriptionQuotaInner object itself. + */ + public UserSubscriptionQuotaInner withUnit(String unit) { + this.unit = unit; + return this; + } + + /** + * Get current number of IotHub type. + * + * @return the currentValue value + */ + public Integer currentValue() { + return this.currentValue; + } + + /** + * Set current number of IotHub type. + * + * @param currentValue the currentValue value to set + * @return the UserSubscriptionQuotaInner object itself. + */ + public UserSubscriptionQuotaInner withCurrentValue(Integer currentValue) { + this.currentValue = currentValue; + return this; + } + + /** + * Get numerical limit on IotHub type. + * + * @return the limit value + */ + public Integer limit() { + return this.limit; + } + + /** + * Set numerical limit on IotHub type. + * + * @param limit the limit value to set + * @return the UserSubscriptionQuotaInner object itself. + */ + public UserSubscriptionQuotaInner withLimit(Integer limit) { + this.limit = limit; + return this; + } + + /** + * Get iotHub type. + * + * @return the name value + */ + public Name name() { + return this.name; + } + + /** + * Set iotHub type. + * + * @param name the name value to set + * @return the UserSubscriptionQuotaInner object itself. + */ + public UserSubscriptionQuotaInner withName(Name name) { + this.name = name; + return this; + } + +} diff --git a/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/implementation/package-info.java b/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/implementation/package-info.java new file mode 100644 index 0000000000000..c1b1fce03bbc7 --- /dev/null +++ b/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/implementation/package-info.java @@ -0,0 +1,11 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** + * This package contains the implementation classes for IotHubClient. + * Use this API to manage the IoT hubs in your Azure subscription. + */ +package com.microsoft.azure.management.iothub.v2020_03_01.implementation; diff --git a/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/package-info.java b/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/package-info.java new file mode 100644 index 0000000000000..14068584ec1e4 --- /dev/null +++ b/sdk/iothub/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/iothub/v2020_03_01/package-info.java @@ -0,0 +1,11 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** + * This package contains the classes for IotHubClient. + * Use this API to manage the IoT hubs in your Azure subscription. + */ +package com.microsoft.azure.management.iothub.v2020_03_01;